Skip to content

Commit

Permalink
[MIG] l10n_br_nfe: Migration to 16.0
Browse files Browse the repository at this point in the history
  • Loading branch information
rvalyi committed Jun 20, 2024
1 parent f8104da commit a328cc4
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 7 deletions.
2 changes: 1 addition & 1 deletion l10n_br_nfe/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"maintainers": ["rvalyi", "renatonlima"],
"website": "https://github.com/OCA/l10n-brazil",
"development_status": "Beta",
"version": "15.0.1.0.0",
"version": "16.0.1.0.0",
"depends": [
"l10n_br_fiscal",
"l10n_br_fiscal_certificate",
Expand Down
6 changes: 5 additions & 1 deletion l10n_br_nfe/models/document_line.py
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,11 @@ def _export_fields_nfe_40_prod(self, xsd_fields, class_obj, export_dict):
export_dict["cProd"] = nfe40_cProd

nfe40_xProd = (
self.product_id.with_context(display_default_code=False).display_name
self.product_id.with_context(
display_default_code=False,
lang=self._context.get("force_product_lang") # used for tests
or self._context.get("lang"),
).display_name
or self.name
or ""
)
Expand Down
2 changes: 1 addition & 1 deletion l10n_br_nfe/models/res_partner.py
Original file line number Diff line number Diff line change
Expand Up @@ -373,7 +373,7 @@ def _compute_nfe40_ender(self):
rec.nfe40_xMun = rec.city_id.name
rec.nfe40_UF = rec.state_id.code
rec.nfe40_cPais = rec.country_id.bc_code
rec.nfe40_xPais = rec.country_id.name
rec.nfe40_xPais = rec.country_id.name.replace("Brazil", "Brasil")
else:
rec.nfe40_xLgr = None
rec.nfe40_nro = None
Expand Down
2 changes: 1 addition & 1 deletion l10n_br_nfe/tests/test_nfe_import_wizard.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ def test_imported_products(self):
first_product.product_supplier_id = self.env["product.supplierinfo"].create(
{
"product_id": self.product_1.id,
"name": self.partner_1.id,
"partner_id": self.partner_1.id,
"partner_uom_id": self.env["uom.uom"].search([], limit=1).id,
"price": 100,
}
Expand Down
2 changes: 1 addition & 1 deletion l10n_br_nfe/tests/test_nfe_serialize.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ def prepare_test_nfe(self, nfe):
nfe.action_document_confirm()
nfe.nfe40_cNF = "06277716"
nfe.company_id.country_id.name = "Brasil"
nfe._document_export()
nfe.with_context(force_product_lang="en_US")._document_export()

def serialize_xml(self, nfe_data):
nfe = nfe_data["nfe"]
Expand Down
4 changes: 2 additions & 2 deletions l10n_br_nfe/wizards/import_document.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ def _prepare_imported_product_values(self, product):
def _search_product_supplier_by_product_code(self, code):
return self.env["product.supplierinfo"].search(
[
("name", "=", self.partner_id.id),
("partner_id", "=", self.partner_id.id),
("product_code", "=", code),
],
limit=1,
Expand Down Expand Up @@ -346,7 +346,7 @@ def _create_product_supplier(self):
"product_name": self.product_name,
"product_code": self.product_code,
"price": price,
"name": self.imported_partner_id.id,
"partner_id": self.imported_partner_id.id,
"partner_uom_id": self.uom_internal.id,
"partner_uom_factor": self.uom_conversion_factor,
}
Expand Down

0 comments on commit a328cc4

Please sign in to comment.