Remove _inherits

review670002
This commit is contained in:
Cédric Krier committed 2013-03-20 22:50:37 +01:00
1 parent 71068b38e7
commit 24d9bffd59
5 files changed
+37 -40

No files matched your search

+1 -7
View File
@@ -5,15 +5,9 @@ this repository contains the full copyright notices and license terms. -->
<data>
<record model="ir.ui.view" id="carrier_view_form">
<field name="model">carrier</field>
<field name="type">form</field>
<field name="inherit" ref="carrier.carrier_view_form"/>
<field name="name">carrier_form</field>
</record>
<record model="ir.ui.view" id="carrier_view_form2">
<field name="model">carrier</field>
<field name="type">form</field>
<field name="inherit" ref="carrier.carrier_view_form2"/>
<field name="name">carrier_form2</field>
</record>
</data>
</tryton>
@@ -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')
+5 -1
View File
@@ -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'),
])
+1 -3
View File
@@ -2,9 +2,7 @@
<!-- This file is part of Tryton. The COPYRIGHT file at the top level of
this repository contains the full copyright notices and license terms. -->
<data>
<xpath
expr="/form/notebook/page[@id='carrier']/field[@name='carrier_cost_method']"
position="after">
<xpath expr="/form/field[@name='carrier_cost_method']" position="after">
<newline/>
<label name="percentage"/>
<field name="percentage"/>
-11
View File
@@ -1,11 +0,0 @@
<?xml version="1.0"?>
<!-- This file is part of Tryton. The COPYRIGHT file at the top level of
this repository contains the full copyright notices and license terms. -->
<data>
<xpath expr="/form/field[@name='carrier_cost_method']" position="after">
<newline/>
<label name="percentage"/>
<field name="percentage"/>
<newline/>
</xpath>
</data>