diff options
| author | Ankita Raval <anr@odoo.com> | 2019-10-30 06:11:02 +0000 |
|---|---|---|
| committer | Jigar Vaghela <jva@odoo.com> | 2020-02-19 09:09:20 +0000 |
| commit | d675dbaa4c7174591e0e7c1a3caf3e76877312ce (patch) | |
| tree | 40840df0a36cb9a6ba3b918835da2a40a07e3a3b /addons/product_margin | |
| parent | 8f6bf2087e50020bfad4e336b1d4c5a98a4fa84f (diff) | |
[IMP] account,* : Change type field to move_type in account.move
task-id: 2028z813
Diffstat (limited to 'addons/product_margin')
| -rw-r--r-- | addons/product_margin/models/product_product.py | 4 | ||||
| -rw-r--r-- | addons/product_margin/tests/test_product_margin.py | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/addons/product_margin/models/product_product.py b/addons/product_margin/models/product_product.py index 79a81009217..c43ff4f925b 100644 --- a/addons/product_margin/models/product_product.py +++ b/addons/product_margin/models/product_product.py @@ -104,7 +104,7 @@ class ProductProduct(models.Model): #Cost price is calculated afterwards as it is a property self.env['account.move.line'].flush(['price_unit', 'quantity', 'balance', 'product_id', 'display_type']) - self.env['account.move'].flush(['state', 'payment_state', 'type', 'invoice_date', 'company_id']) + self.env['account.move'].flush(['state', 'payment_state', 'move_type', 'invoice_date', 'company_id']) self.env['product.template'].flush(['list_price']) sqlstr = """ WITH currency_rate AS ({}) @@ -125,7 +125,7 @@ class ProductProduct(models.Model): WHERE l.product_id = %s AND i.state IN %s AND i.payment_state IN %s - AND i.type IN %s + AND i.move_type IN %s AND i.invoice_date BETWEEN %s AND %s AND i.company_id = %s AND l.display_type IS NULL diff --git a/addons/product_margin/tests/test_product_margin.py b/addons/product_margin/tests/test_product_margin.py index 6bcca596b4a..b6eb005ab65 100644 --- a/addons/product_margin/tests/test_product_margin.py +++ b/addons/product_margin/tests/test_product_margin.py @@ -12,7 +12,7 @@ class TestProductMargin(AccountTestCommon): def create_account_invoice(self, invoice_type, partner, product, quantity=0.0, price_unit=0.0): """ Create an invoice as in a view by triggering its onchange methods""" - invoice_form = Form(self.env['account.move'].with_context(default_type=invoice_type)) + invoice_form = Form(self.env['account.move'].with_context(default_move_type=invoice_type)) invoice_form.partner_id = partner with invoice_form.invoice_line_ids.new() as line: line.product_id = product |
