Remove accounts from products.

This commit is contained in:
Albert Cervera i Areny 2018-09-03 23:34:42 +02:00
parent b6875e930b
commit e7c5a76301

View File

@ -58,8 +58,12 @@ Create parties::
Create category:: Create category::
>>> ProductCategory = Model.get('product.category') >>> ProductCategory = Model.get('product.category')
>>> category = ProductCategory(name='Category') >>> account_category = ProductCategory(name='Category')
>>> category.save() >>> account_category.accounting = True
>>> account_category.account_expense = expense
>>> account_category.account_revenue = revenue
>>> account_category.customer_taxes.append(tax)
>>> account_category.save()
Create product:: Create product::
@ -70,15 +74,12 @@ Create product::
>>> product = Product() >>> product = Product()
>>> template = ProductTemplate() >>> template = ProductTemplate()
>>> template.name = 'product' >>> template.name = 'product'
>>> template.category = category
>>> template.default_uom = unit >>> template.default_uom = unit
>>> template.type = 'service' >>> template.type = 'service'
>>> template.purchasable = True >>> template.purchasable = True
>>> template.salable = True >>> template.salable = True
>>> template.list_price = Decimal('10') >>> template.list_price = Decimal('10')
>>> template.account_expense = expense >>> template.account_category = account_category
>>> template.account_revenue = revenue
>>> template.customer_taxes.append(tax)
>>> product, = template.products >>> product, = template.products
>>> product.cost_price = Decimal('5') >>> product.cost_price = Decimal('5')
>>> template.save() >>> template.save()