diff --git a/sale.py b/sale.py index 4a4f4ad566..b634fdef44 100644 --- a/sale.py +++ b/sale.py @@ -1666,7 +1666,6 @@ class OpenCustomer(Wizard): model_data, = ModelData.search([ ('fs_id', '=', 'act_open_customer'), ('module', '=', 'sale'), - ('inherit', '=', None), ], limit=1) wizard = Wizard(model_data.db_id) diff --git a/tests/scenario_sale.rst b/tests/scenario_sale.rst index fb2b303cd5..10936c9a2d 100644 --- a/tests/scenario_sale.rst +++ b/tests/scenario_sale.rst @@ -38,10 +38,13 @@ Create company:: ... else: ... currency, = currencies >>> 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 >>> company.currency = currency >>> company_config.execute('add') >>> company, = Company.find([]) @@ -153,19 +156,23 @@ Create product:: >>> ProductUom = Model.get('product.uom') >>> unit, = ProductUom.find([('name', '=', 'Unit')]) + >>> ProductTemplate = Model.get('product.template') >>> Product = Model.get('product.product') >>> product = Product() - >>> product.name = 'product' - >>> product.category = category - >>> product.default_uom = unit - >>> product.type = 'goods' - >>> product.purchasable = True - >>> product.salable = True - >>> product.list_price = Decimal('10') - >>> product.cost_price = Decimal('5') - >>> product.cost_price_method = 'fixed' - >>> product.account_expense = expense - >>> product.account_revenue = revenue + >>> template = ProductTemplate() + >>> template.name = 'product' + >>> template.category = category + >>> template.default_uom = unit + >>> template.type = 'goods' + >>> template.purchasable = True + >>> template.salable = True + >>> template.list_price = Decimal('10') + >>> template.cost_price = Decimal('5') + >>> template.cost_price_method = 'fixed' + >>> template.account_expense = expense + >>> template.account_revenue = revenue + >>> template.save() + >>> product.template = template >>> product.save() Create payment term:: @@ -328,7 +335,7 @@ Check Return Shipments:: >>> ShipmentReturn = Model.get('stock.shipment.out.return') >>> ShipmentReturn.receive([ship_return.id], config.context) >>> move_return, = ship_return.incoming_moves - >>> move_return.product.name + >>> move_return.product.rec_name u'product' >>> move_return.quantity 4.0 @@ -391,7 +398,7 @@ Checking Shipments:: >>> config.user = stock_user.id >>> ShipmentReturn.receive([mix_returns.id], config.context) >>> move_return, = mix_returns.incoming_moves - >>> move_return.product.name + >>> move_return.product.rec_name u'product' >>> move_return.quantity 2.0 @@ -400,7 +407,7 @@ Checking Shipments:: >>> ShipmentOut.pack([mix_shipments.id], config.context) >>> ShipmentOut.done([mix_shipments.id], config.context) >>> move_shipment, = mix_shipments.outgoing_moves - >>> move_shipment.product.name + >>> move_shipment.product.rec_name u'product' >>> move_shipment.quantity 7.0 @@ -468,7 +475,7 @@ Checking Shipments:: >>> config.user = stock_user.id >>> ShipmentReturn.receive([mix_returns.id], config.context) >>> move_return, = mix_returns.incoming_moves - >>> move_return.product.name + >>> move_return.product.rec_name u'product' >>> move_return.quantity 3.0 @@ -476,7 +483,7 @@ Checking Shipments:: True >>> ShipmentOut.pack([mix_shipments.id], config.context) >>> move_shipment, = mix_shipments.outgoing_moves - >>> move_shipment.product.name + >>> move_shipment.product.rec_name u'product' >>> move_shipment.quantity 6.0 diff --git a/view/product_list_sale_line.xml b/view/product_list_sale_line.xml index 838edaf199..5c638ca215 100644 --- a/view/product_list_sale_line.xml +++ b/view/product_list_sale_line.xml @@ -2,7 +2,7 @@ - +