Skip to content

Conversation

@almumu
Copy link
Member

@almumu almumu commented Oct 31, 2025

Solves access error when creating a Deposit invoice, because it was getting all the product taxes of the existing companies.
image

…ti company environment

Solves access error when creating a Deposit invoice, because it was getting all the product taxes of the existing companies.
@almumu almumu marked this pull request as ready for review November 6, 2025 07:33
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,

@almumu almumu requested a review from dreispt November 13, 2025 06:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants