Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[14.0][FIX] l10n_br_sale: fix partner used to invoicing #3185

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions l10n_br_sale/models/sale_order.py
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,12 @@ def _prepare_invoice(self):
if self.fiscal_operation_id:
result.update(self._prepare_br_fiscal_dict())

# By default, the value of the partner_id field should be the same
# as the partner_invoice_id field. The _prepare_br_fiscal_dict()
# method changes the partner_id value in the super result to the
# value of the partner_id field from the sale.order model.
result["partner_id"] = self.partner_invoice_id.id

document_type_id = self._context.get("document_type_id")

if not document_type_id:
Expand Down
2 changes: 1 addition & 1 deletion l10n_br_sale/models/sale_order_line.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ def _fiscal_operation_domain(self):

partner_id = fields.Many2one(
comodel_name="res.partner",
related="order_id.partner_id",
related="order_id.partner_invoice_id",
string="Partner",
)

Expand Down
Loading