[FIX] sale: fiscal position

- Create a fiscal position FP which maps the deposit product account to
  another account
- Create a SO, use the fiscal position FP.
- Create a downpayment

The account is not mapped following the fiscal position.

opw-1947069

closes odoo/odoo#31781

Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
This commit is contained in:
Nicolas Martinelli
2019-03-12 12:52:10 +00:00
parent c16d2827bc
commit 4524dcd691
@@ -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 or self.product_id.categ_id.property_account_income_categ_id.id
account_id = order.fiscal_position_id.map_account(self.product_id.property_account_income_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