Skip to content
Open
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
4 changes: 3 additions & 1 deletion purchase_deposit/wizard/purchase_make_invoice_advance.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,9 @@ class PurchaseAdvancePaymentInv(models.TransientModel):
def _compute_deposit_account_id(self):
product = self.purchase_deposit_product_id
self.deposit_account_id = product.property_account_expense_id
self.deposit_taxes_id = product.supplier_taxes_id
self.deposit_taxes_id = product.supplier_taxes_id.filtered(
lambda tx: tx.company_id == self.env.company
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't we honor the document's company?

Suggested change
lambda tx: tx.company_id == self.env.company
lambda tx: tx.company_id == self.company_id

Copy link
Member Author

@almumu almumu Nov 10, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

in this case "self" is the wizard, not the document, and the wizard has no company field. This method

depends on purchase_deposit_product_id field, and where the purchase_deposit_product_id field is defined, it uses the env company
default=lambda self: self.env.company.purchase_deposit_product_id,

)

def _prepare_deposit_val(self, order, po_line, amount):
ir_property_obj = self.env["ir.property"]
Expand Down