-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by legalsylvain
- Loading branch information
Showing
148 changed files
with
1,125 additions
and
212 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 2 additions & 0 deletions
2
fermente_custom_import_account_product_fiscal_classification/models/__init__.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
from . import custom_import_product_mixin | ||
from . import product_template |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
fermente_custom_import_account_product_fiscal_classification/models/product_template.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# Copyright (C) 2024 - Today: GRAP (http://www.grap.coop) | ||
# @author: Sylvain LE GAL (https://twitter.com/legalsylvain) | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). | ||
|
||
from odoo import fields, models | ||
|
||
|
||
class ProductTemplate(models.Model): | ||
_inherit = "product.template" | ||
|
||
grap_import_vat_amount = fields.Float(string="VAT Amount (For import)", store=False) | ||
|
||
grap_import_list_price_vat_excl = fields.Float( | ||
string="Sale Price Vat Excl (For import)", store=False | ||
) | ||
|
||
grap_import_list_price_vat_incl = fields.Float( | ||
string="Sale Price Vat Incl (For import)", store=False | ||
) |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
3 changes: 3 additions & 0 deletions
3
...e_custom_import_account_product_fiscal_classification/tests/templates/product/product.csv
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
name,uom_id,categ_id,grap_import_vat_amount,grap_import_list_price_vat_excl,grap_import_list_price_vat_incl | ||
Product 1,Units,All / Saleable,0.20,1,1.21 | ||
Product 2,Units,All / Saleable,0.20,0.99,1.20 |
79 changes: 79 additions & 0 deletions
79
fermente_custom_import_account_product_fiscal_classification/tests/test_module.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
# Copyright (C) 2024 - Today: GRAP (http://www.grap.coop) | ||
# @author: Sylvain LE GAL (https://twitter.com/legalsylvain) | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). | ||
|
||
from odoo.tests import tagged | ||
|
||
from odoo.addons.fermente_custom_import_product.tests.test_module import ( | ||
TestModuleProduct, | ||
) | ||
|
||
|
||
@tagged("post_install", "-at_install") | ||
class TestModuleProductSupplierinfoQtyMultiplier(TestModuleProduct): | ||
@classmethod | ||
def setUpClass(cls): | ||
super().setUpClass() | ||
cls.classification_20 = cls.env.ref( | ||
"account_product_fiscal_classification.fiscal_classification_A_company_1" | ||
) | ||
cls.tax_20 = cls.env.ref( | ||
"account_product_fiscal_classification.account_tax_sale_20_company_1" | ||
) | ||
|
||
def _test_import_product_account_product_fiscal_classification( | ||
self, model, vat_included | ||
): | ||
products, messages = self._test_import_file( | ||
"fermente_custom_import_account_product_fiscal_classification", | ||
model, | ||
"product.csv", | ||
folder="product", | ||
) | ||
self.assertFalse(messages) | ||
self.assertEqual(len(products), 2) | ||
|
||
product_1 = products.filtered(lambda x: x.name == "Product 1") | ||
self.assertEqual(product_1.fiscal_classification_id, self.classification_20) | ||
|
||
product_2 = products.filtered(lambda x: x.name == "Product 2") | ||
self.assertEqual(product_2.fiscal_classification_id, self.classification_20) | ||
|
||
if vat_included: | ||
self.assertEqual(product_1.list_price, 1.21) | ||
self.assertEqual(product_2.list_price, 1.20) | ||
else: | ||
self.assertEqual(product_1.list_price, 1.00) | ||
self.assertEqual(product_2.list_price, 0.99) | ||
|
||
def test_01_import_product_account_product_fiscal_classification_product_vat_excl( | ||
self, | ||
): | ||
self.tax_20.price_include = False | ||
self._test_import_product_account_product_fiscal_classification( | ||
"product.product", False | ||
) | ||
|
||
def test_02_import_product_account_product_fiscal_classification_product_vat_incl( | ||
self, | ||
): | ||
self.tax_20.price_include = True | ||
self._test_import_product_account_product_fiscal_classification( | ||
"product.product", True | ||
) | ||
|
||
def test_11_import_product_account_product_fiscal_classification_template_vat_excl( | ||
self, | ||
): | ||
self.tax_20.price_include = False | ||
self._test_import_product_account_product_fiscal_classification( | ||
"product.template", False | ||
) | ||
|
||
def test_12_import_product_account_product_fiscal_classification_template_vat_incl( | ||
self, | ||
): | ||
self.tax_20.price_include = True | ||
self._test_import_product_account_product_fiscal_classification( | ||
"product.template", True | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
1 change: 1 addition & 0 deletions
1
grap_custom_import_base/models/__init__.py → ...nte_custom_import_base/models/__init__.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
from . import custom_import_mixin | ||
from . import custom_import_partner_mixin | ||
from . import res_partner |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# Copyright (C) 2024 - Today: GRAP (http://www.grap.coop) | ||
# @author: Sylvain LE GAL (https://twitter.com/legalsylvain) | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). | ||
|
||
import logging | ||
|
||
from odoo import models | ||
|
||
logger = logging.getLogger(__name__) | ||
|
||
|
||
class ResPartner(models.Model): | ||
_name = "res.partner" | ||
_inherit = ["res.partner", "custom.import.partner.mixin"] |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
from . import test_module | ||
from . import test_module_partner |
File renamed without changes.
2 changes: 2 additions & 0 deletions
2
fermente_custom_import_base/tests/templates/res.partner/supplier_existing_duplicates_vat.csv
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
name,email,phone,mobile,website,street,street2,zip,city,country_id,vat | ||
Azure Interior,,,,,,,,,, |
File renamed without changes.
Oops, something went wrong.