[FIX] sale: income account in invoice with down payments
When creating an invoice with 'Down payment' option for an SO, it should first consider income account of the 'Deposit Product'. if it does not have one then it should consider that product category's income account. Fixes #23100 Task# 1819531
This commit is contained in:
committed by
Nicolas Martinelli
parent
7147622665
commit
aaadfd7d76
@@ -65,7 +65,7 @@ class SaleAdvancePaymentInv(models.TransientModel):
|
||||
|
||||
account_id = False
|
||||
if self.product_id.id:
|
||||
account_id = self.product_id.property_account_income_id.id
|
||||
account_id = self.product_id.property_account_income_id.id or self.product_id.categ_id.property_account_income_categ_id.id
|
||||
if not account_id:
|
||||
inc_acc = ir_property_obj.get('property_account_income_categ_id', 'product.category')
|
||||
account_id = order.fiscal_position_id.map_account(inc_acc).id if inc_acc else False
|
||||
|
||||
Reference in New Issue
Block a user