Remove _inherits

review670002
This commit is contained in:
Cédric Krier
2013-03-20 22:50:23 +01:00
parent 97f9a3796c
commit 81ede7cece
3 changed files with 34 additions and 20 deletions
+2 -2
View File
@@ -330,9 +330,9 @@ class Invoice(Workflow, ModelSQL, ModelView):
payment_term = self.party.supplier_payment_term
if self.company and self.type in ('out_credit_note', 'in_credit_note'):
if self.type == 'out_credit_note':
payment_term = self.company.customer_payment_term
payment_term = self.company.party.customer_payment_term
else:
payment_term = self.company.supplier_payment_term
payment_term = self.company.party.supplier_payment_term
if account:
result['account'] = account.id
result['account.rec_name'] = account.rec_name
+16 -9
View File
@@ -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 = 'Dunder Mifflin'
>>> party = Party(name='Dunder Mifflin')
>>> party.save()
>>> company.party = party
>>> company.currency = currency
>>> company_config.execute('add')
>>> company, = Company.find([])
@@ -144,16 +147,20 @@ 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.default_uom = unit
>>> product.type = 'service'
>>> product.list_price = Decimal('40')
>>> product.cost_price = Decimal('25')
>>> product.account_expense = expense
>>> product.account_revenue = revenue
>>> product.customer_taxes.append(tax)
>>> template = ProductTemplate()
>>> template.name = 'product'
>>> template.default_uom = unit
>>> template.type = 'service'
>>> template.list_price = Decimal('40')
>>> template.cost_price = Decimal('25')
>>> template.account_expense = expense
>>> template.account_revenue = revenue
>>> template.customer_taxes.append(tax)
>>> template.save()
>>> product.template = template
>>> product.save()
Create payment term::
+16 -9
View File
@@ -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 = 'Dunder Mifflin'
>>> party = Party(name='Dunder Mifflin')
>>> party.save()
>>> company.party = party
>>> company.currency = currency
>>> company_config.execute('add')
>>> company, = Company.find([])
@@ -144,16 +147,20 @@ 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.default_uom = unit
>>> product.type = 'service'
>>> product.list_price = Decimal('40')
>>> product.cost_price = Decimal('20')
>>> product.account_expense = expense
>>> product.account_revenue = revenue
>>> product.supplier_taxes.append(tax)
>>> template = ProductTemplate()
>>> template.name = 'product'
>>> template.default_uom = unit
>>> template.type = 'service'
>>> template.list_price = Decimal('40')
>>> template.cost_price = Decimal('20')
>>> template.account_expense = expense
>>> template.account_revenue = revenue
>>> template.supplier_taxes.append(tax)
>>> template.save()
>>> product.template = template
>>> product.save()
Create payment term::