Skip to content

Commit bf7572a

Browse files
[FIX] l10n_br_sale: fix partner used to invoicing
1 parent 37b813b commit bf7572a

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

l10n_br_sale/models/sale_order.py

+6
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,12 @@ def _prepare_invoice(self):
200200
if self.fiscal_operation_id:
201201
result.update(self._prepare_br_fiscal_dict())
202202

203+
# By default, the value of the partner_id field should be the same
204+
# as the partner_invoice_id field. The _prepare_br_fiscal_dict()
205+
# method changes the partner_id value in the super result to the
206+
# value of the partner_id field from the sale.order model.
207+
result["partner_id"] = self.partner_invoice_id.id
208+
203209
document_type_id = self._context.get("document_type_id")
204210

205211
if not document_type_id:

0 commit comments

Comments
 (0)