Skip to content

Commit

Permalink
Merge commit 'refs/pull/121725/head' of https://github.com/odoo/odoo
Browse files Browse the repository at this point in the history
…into 16.0-2491
  • Loading branch information
docker-odoo committed May 24, 2023
2 parents c1a81f7 + 0f04e60 commit ebb880f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
5 changes: 3 additions & 2 deletions addons/account/models/account_move.py
Expand Up @@ -770,16 +770,17 @@ def _compute_fiscal_position_id(self):
move.fiscal_position_id = self.env['account.fiscal.position'].with_company(move.company_id)._get_fiscal_position(
move.partner_id, delivery=delivery_partner)

@api.depends('bank_partner_id')
@api.depends('bank_partner_id', 'company_id')
def _compute_partner_bank_id(self):
for move in self:
bank_ids = move.bank_partner_id.bank_ids.filtered(
lambda bank: not bank.company_id or bank.company_id == move.company_id)
move.partner_bank_id = bank_ids[0] if bank_ids else False

@api.depends('partner_id')
@api.depends('partner_id', 'company_id')
def _compute_invoice_payment_term_id(self):
for move in self:
move = move.with_company(move.company_id)
if move.is_sale_document(include_receipts=True) and move.partner_id.property_payment_term_id:
move.invoice_payment_term_id = move.partner_id.property_payment_term_id
elif move.is_purchase_document(include_receipts=True) and move.partner_id.property_supplier_payment_term_id:
Expand Down
3 changes: 2 additions & 1 deletion addons/account/models/account_move_line.py
Expand Up @@ -499,6 +499,7 @@ def _compute_account_id(self):
WHERE line.move_id = ANY(%(move_ids)s)
AND line.display_type = 'payment_term'
AND line.id != ANY(%(current_ids)s)
AND company_id = ANY(%(company_ids)s)
),
properties AS(
SELECT DISTINCT ON (property.company_id, property.name)
Expand Down Expand Up @@ -855,7 +856,7 @@ def _compute_price_unit(self):
product_uom=line.product_uom_id,
)

@api.depends('product_id', 'product_uom_id')
@api.depends('product_id', 'product_uom_id', 'company_id')
def _compute_tax_ids(self):
for line in self:
if line.display_type in ('line_section', 'line_note'):
Expand Down

0 comments on commit ebb880f

Please sign in to comment.