Skip to content

Commit adfb01d

Browse files
committed
[ADD] grap_custom_import_recurring_consignment
1 parent 3d78e37 commit adfb01d

File tree

12 files changed

+77
-0
lines changed

12 files changed

+77
-0
lines changed

grap_custom_import_recurring_consignment/README.rst

Whitespace-only changes.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
from . import models
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Copyright (C) 2024 - Today: GRAP (http://www.grap.coop)
2+
# @author: Sylvain LE GAL (https://twitter.com/legalsylvain)
3+
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
4+
5+
{
6+
"name": "GRAP - Custom Import Recurring Consignment Module",
7+
"summary": "Extra GRAP Tools to import data for" " Recurring Consignment module",
8+
"version": "16.0.1.0.0",
9+
"category": "Tools",
10+
"author": "GRAP",
11+
"website": "https://github.com/grap/grap-odoo-import",
12+
"license": "AGPL-3",
13+
"depends": ["grap_custom_import_product", "recurring_consignment"],
14+
"auto_install": True,
15+
"installable": True,
16+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
from . import product_product
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Copyright (C) 2024 - Today: GRAP (http://www.grap.coop)
2+
# @author: Sylvain LE GAL (https://twitter.com/legalsylvain)
3+
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
4+
5+
from odoo import fields, models
6+
7+
8+
class ProductProduct(models.Model):
9+
_inherit = "product.product"
10+
11+
grap_import_supplier_multiplier_qty = fields.Float(
12+
string="Product Package Quantity - Supplier (For import)", store=False
13+
)
14+
15+
def _custom_import_prepare_supplierinfo_vals(self, partner, vals):
16+
res = super()._custom_import_prepare_supplierinfo_vals(partner, vals)
17+
res["multiplier_qty"] = vals.get("grap_import_supplier_multiplier_qty")
18+
return res
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
* Sylvain LE GAL <https://twitter.com/legalsylvain>
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
This module improve the "import" features provided by Odoo.
2+
3+
* ``product.product``:
4+
5+
* Allow to import deposited product. (see ``recurring_consignment`` module)
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
from . import test_module
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
name,uom_id,categ_id,barcode,list_price,grap_import_supplier_name,grap_import_supplier_product_code,grap_import_supplier_product_name,grap_import_supplier_gross_price,grap_import_supplier_multiplier_qty
2+
Mention Good (Late chocolate),Units,All / Saleable,3222472195092,2.29,Ready Mat,GOOD,MENTION GOOD,1.98,24
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# Copyright (C) 2024 - Today: GRAP (http://www.grap.coop)
2+
# @author: Sylvain LE GAL (https://twitter.com/legalsylvain)
3+
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
4+
5+
from odoo.tests import tagged
6+
7+
from odoo.addons.grap_custom_import_product.tests.test_module import TestModuleProduct
8+
9+
10+
@tagged("post_install", "-at_install")
11+
class TestModuleProductSupplierinfoQtyMultiplier(TestModuleProduct):
12+
@classmethod
13+
def setUpClass(cls):
14+
super().setUpClass()
15+
cls.ProductProduct = cls.env["product.product"]
16+
17+
def test_01_import_product_supplierinfo_qty_multiplier(self):
18+
products, messages = self._test_import_file(
19+
"grap_custom_import_product_supplierinfo_qty_multiplier",
20+
"product.product",
21+
"product.csv",
22+
)
23+
self.assertFalse(messages)
24+
self.assertEqual(len(products), 1)
25+
self.assertEqual(products.mapped("seller_ids.multiplier_qty"), [24.0])
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../../../grap_custom_import_recurring_consignment
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
import setuptools
2+
3+
setuptools.setup(
4+
setup_requires=['setuptools-odoo'],
5+
odoo_addon=True,
6+
)

0 commit comments

Comments
 (0)