Browse Source

Merge PR #400 into 12.0

Signed-off-by sbejaoui
pull/403/head
OCA-git-bot 5 years ago
parent
commit
dff239fdac
  1. 2
      contract_sale_invoicing/models/contract.py
  2. 4
      contract_sale_invoicing/tests/test_contract_sale_invoicing.py

2
contract_sale_invoicing/models/contract.py

@ -19,7 +19,7 @@ class ContractContract(models.Model):
if not self.invoicing_sales: if not self.invoicing_sales:
return invoices return invoices
sales = self.env['sale.order'].search([ sales = self.env['sale.order'].search([
('analytic_account_id', '=', self.analytic_account_id.id),
('analytic_account_id', '=', self.group_id.id),
('partner_invoice_id', 'child_of', ('partner_invoice_id', 'child_of',
self.partner_id.commercial_partner_id.ids), self.partner_id.commercial_partner_id.ids),
('invoice_status', '=', 'to invoice'), ('invoice_status', '=', 'to invoice'),

4
contract_sale_invoicing/tests/test_contract_sale_invoicing.py

@ -8,7 +8,7 @@ class TestContractSaleInvoicing(TestContractBase):
@classmethod @classmethod
def setUpClass(cls): def setUpClass(cls):
super(TestContractSaleInvoicing, cls).setUpClass() super(TestContractSaleInvoicing, cls).setUpClass()
cls.contract.analytic_account_id = \
cls.contract.group_id = \
cls.env['account.analytic.account'].search([], limit=1) cls.env['account.analytic.account'].search([], limit=1)
cls.product_so = cls.env.ref( cls.product_so = cls.env.ref(
'product.product_product_1') 'product.product_product_1')
@ -23,7 +23,7 @@ class TestContractSaleInvoicing(TestContractBase):
'product_uom': cls.product_so.uom_id.id, 'product_uom': cls.product_so.uom_id.id,
'price_unit': cls.product_so.list_price})], 'price_unit': cls.product_so.list_price})],
'pricelist_id': cls.partner.property_product_pricelist.id, 'pricelist_id': cls.partner.property_product_pricelist.id,
'analytic_account_id': cls.contract.analytic_account_id.id,
'analytic_account_id': cls.contract.group_id.id,
'date_order': '2016-02-15', 'date_order': '2016-02-15',
}) })

Loading…
Cancel
Save