Remove accounts from products.

This commit is contained in:
Albert Cervera i Areny 2018-08-18 12:05:03 +02:00
parent 823f53f968
commit 90729a0798
3 changed files with 31 additions and 9 deletions

View File

@ -48,6 +48,16 @@ Create tax::
>>> tax = create_tax(Decimal('.10'))
>>> tax.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.customer_taxes.append(tax)
>>> account_category.save()
Create product::
>>> ProductUom = Model.get('product.uom')
@ -60,10 +70,7 @@ Create product::
>>> template.default_uom = unit
>>> template.type = 'service'
>>> template.list_price = Decimal('50')
>>> template.cost_price = Decimal('25')
>>> template.account_expense = account_expense
>>> template.account_revenue = account_revenue
>>> template.customer_taxes.append(tax)
>>> template.account_category = account_category
>>> template.save()
>>> product.template = template
>>> product.save()

View File

@ -48,6 +48,15 @@ Create customer::
>>> 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 commission product::
>>> Uom = Model.get('product.uom')
@ -60,9 +69,7 @@ Create commission product::
>>> template.default_uom = unit
>>> template.type = 'service'
>>> template.list_price = Decimal(0)
>>> template.cost_price = Decimal(0)
>>> template.account_expense = accounts['expense']
>>> template.account_revenue = accounts['revenue']
>>> template.account_category = account_category
>>> template.save()
>>> commission_product.template = template
>>> commission_product.save()

View File

@ -70,6 +70,15 @@ Create employee::
>>> employee.company = company
>>> employee.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')
@ -82,8 +91,7 @@ Create product::
>>> template.default_uom = hour
>>> template.type = 'service'
>>> template.list_price = Decimal('20')
>>> template.cost_price = Decimal('5')
>>> template.account_revenue = revenue
>>> template.account_category = account_category
>>> template.save()
>>> product.template = template
>>> product.save()