From 6d4e8de95908e7ef14f4f776af9f1fe9db329e4e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Wed, 20 Jun 2018 12:09:53 +0200 Subject: [PATCH] Remove accounts from products issue3805 review45111002 --- tests/scenario_sale_supply.rst | 15 +++++++++++---- .../scenario_sale_supply_shipment_on_invoice.rst | 12 ++++++++++-- 2 files changed, 21 insertions(+), 6 deletions(-) diff --git a/tests/scenario_sale_supply.rst b/tests/scenario_sale_supply.rst index f6f40fd2f2..b955a22ee9 100644 --- a/tests/scenario_sale_supply.rst +++ b/tests/scenario_sale_supply.rst @@ -83,6 +83,15 @@ Create parties:: >>> customer = Party(name='Customer') >>> customer.save() +Create account category:: + + >>> ProductCategory = Model.get('product.category') + >>> account_category = ProductCategory(name="Account Category") + >>> account_category.accounting = True + >>> account_category.account_expense = expense + >>> account_category.account_revenue = revenue + >>> account_category.save() + Create product:: >>> ProductUom = Model.get('product.uom') @@ -96,9 +105,8 @@ Create product:: >>> template.purchasable = True >>> template.salable = True >>> template.list_price = Decimal('10') - >>> template.account_expense = expense - >>> template.account_revenue = revenue >>> template.supply_on_sale = True + >>> template.account_category = account_category >>> template.save() >>> product, = template.products @@ -207,8 +215,7 @@ not create a new purchase request:: >>> changing_template.purchasable = True >>> changing_template.salable = True >>> changing_template.list_price = Decimal('10') - >>> changing_template.account_expense = expense - >>> changing_template.account_revenue = revenue + >>> changing_template.account_category = account_category >>> changing_template.supply_on_sale = False >>> changing_template.save() >>> changing_product, = changing_template.products diff --git a/tests/scenario_sale_supply_shipment_on_invoice.rst b/tests/scenario_sale_supply_shipment_on_invoice.rst index 7acc748108..19abdd0a76 100644 --- a/tests/scenario_sale_supply_shipment_on_invoice.rst +++ b/tests/scenario_sale_supply_shipment_on_invoice.rst @@ -46,6 +46,15 @@ Create parties:: >>> customer = Party(name='Customer') >>> customer.save() +Create account category:: + + >>> ProductCategory = Model.get('product.category') + >>> account_category = ProductCategory(name="Account Category") + >>> account_category.accounting = True + >>> account_category.account_expense = accounts['expense'] + >>> account_category.account_revenue = accounts['revenue'] + >>> account_category.save() + Create product:: >>> ProductUom = Model.get('product.uom') @@ -59,9 +68,8 @@ Create product:: >>> template.salable = True >>> template.purchasable = True >>> template.list_price = Decimal('10') - >>> template.account_revenue = accounts['revenue'] - >>> template.account_expense = accounts['expense'] >>> template.supply_on_sale = True + >>> template.account_category = account_category >>> template.save() >>> product, = template.products