From 24d9bffd5900ed5a021f0bfd04864a57efca181d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Wed, 20 Mar 2013 22:50:37 +0100 Subject: [PATCH] Remove _inherits review670002 --- carrier.xml | 8 +--- ...percentage_with_purchase_shipment_cost.rst | 48 ++++++++++++------- tests/test_carrier_percentage.py | 6 ++- view/carrier_form.xml | 4 +- view/carrier_form2.xml | 11 ----- 5 files changed, 37 insertions(+), 40 deletions(-) delete mode 100644 view/carrier_form2.xml diff --git a/carrier.xml b/carrier.xml index 9fccef0359..260ea0edba 100644 --- a/carrier.xml +++ b/carrier.xml @@ -5,15 +5,9 @@ this repository contains the full copyright notices and license terms. --> carrier + form carrier_form - - - carrier - form - - carrier_form2 - diff --git a/tests/scenario_carrier_percentage_with_purchase_shipment_cost.rst b/tests/scenario_carrier_percentage_with_purchase_shipment_cost.rst index 0af7957bbb..492ea10000 100644 --- a/tests/scenario_carrier_percentage_with_purchase_shipment_cost.rst +++ b/tests/scenario_carrier_percentage_with_purchase_shipment_cost.rst @@ -34,10 +34,13 @@ Create company:: >>> Currency = Model.get('currency.currency') >>> CurrencyRate = Model.get('currency.currency.rate') >>> Company = Model.get('company.company') + >>> Party = Model.get('party.party') >>> company_config = Wizard('company.company.config') >>> company_config.execute('company') >>> company = company_config.form - >>> company.name = 'B2CK' + >>> party = Party(name='B2CK') + >>> party.save() + >>> company.party = party >>> currencies = Currency.find([('code', '=', 'EUR')]) >>> if not currencies: ... currency = Currency(name='Euro', symbol=u'€', code='EUR', @@ -130,34 +133,43 @@ Create category:: Create products:: >>> ProductUom = Model.get('product.uom') + >>> ProductTemplate = Model.get('product.template') >>> Product = Model.get('product.product') >>> unit, = ProductUom.find([('name', '=', 'Unit')]) >>> product = Product() - >>> product.name = 'Product' - >>> product.category = category - >>> product.default_uom = unit - >>> product.type = 'goods' - >>> product.salable = True - >>> product.list_price = Decimal('20') - >>> product.cost_price = Decimal('8') - >>> product.account_revenue = revenue + >>> template = ProductTemplate() + >>> template.name = 'Product' + >>> template.category = category + >>> template.default_uom = unit + >>> template.type = 'goods' + >>> template.salable = True + >>> template.list_price = Decimal('20') + >>> template.cost_price = Decimal('8') + >>> template.account_revenue = revenue + >>> template.save() + >>> product.template = template >>> product.save() >>> carrier_product = Product() - >>> carrier_product.name = 'Carrier Product' - >>> carrier_product.category = category - >>> carrier_product.default_uom = unit - >>> carrier_product.type = 'service' - >>> carrier_product.salable = True - >>> carrier_product.list_price = Decimal('5') - >>> carrier_product.cost_price = Decimal('3') - >>> carrier_product.account_revenue = revenue + >>> carrier_template = ProductTemplate() + >>> carrier_template.name = 'Carrier Product' + >>> carrier_template.category = category + >>> carrier_template.default_uom = unit + >>> carrier_template.type = 'service' + >>> carrier_template.salable = True + >>> carrier_template.list_price = Decimal('5') + >>> carrier_template.cost_price = Decimal('3') + >>> carrier_template.account_revenue = revenue + >>> carrier_template.save() + >>> carrier_product.template = carrier_template >>> carrier_product.save() Create carrier:: >>> Carrier = Model.get('carrier') >>> carrier = Carrier() - >>> carrier.name = 'Carrier' + >>> party = Party(name='Carrier') + >>> party.save() + >>> carrier.party = party >>> carrier.carrier_product = carrier_product >>> carrier.carrier_cost_method = 'percentage' >>> carrier.percentage = Decimal('15') diff --git a/tests/test_carrier_percentage.py b/tests/test_carrier_percentage.py index 0a8e43e022..4a250b0170 100644 --- a/tests/test_carrier_percentage.py +++ b/tests/test_carrier_percentage.py @@ -27,6 +27,7 @@ class CarrierWeightTestCase(unittest.TestCase): trytond.tests.test_tryton.install_module('carrier_percentage') self.party = POOL.get('party.party') self.uom = POOL.get('product.uom') + self.template = POOL.get('product.template') self.product = POOL.get('product.product') self.category = POOL.get('product.category') self.currency = POOL.get('currency.currency') @@ -58,7 +59,7 @@ class CarrierWeightTestCase(unittest.TestCase): category, = self.category.create([{ 'name': 'Category', }]) - product, = self.product.create([{ + template, = self.template.create([{ 'name': 'Carrier', 'default_uom': uom.id, 'category': category.id, @@ -66,6 +67,9 @@ class CarrierWeightTestCase(unittest.TestCase): 'list_price': Decimal(0), 'cost_price': Decimal(0), }]) + product, = self.product.create([{ + 'template': template.id, + }]) currency, = self.currency.search([ ('code', '=', 'cu1'), ]) diff --git a/view/carrier_form.xml b/view/carrier_form.xml index 761795f839..f933186092 100644 --- a/view/carrier_form.xml +++ b/view/carrier_form.xml @@ -2,9 +2,7 @@ - +