Remove accounts from product

This commit is contained in:
Albert Cervera i Areny 2019-02-07 23:15:46 +01:00
parent 7f297e7a98
commit a3d236fc74

View file

@ -66,6 +66,16 @@ Create parties::
>>> 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 = expense
>>> account_category.account_revenue = revenue
>>> account_category.customer_taxes.append(tax)
>>> account_category.save()
Create product::
>>> ProductUom = Model.get('product.uom')
@ -80,11 +90,8 @@ Create product::
>>> 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.customer_taxes.append(tax)
>>> template.account_category = account_category
>>> template.save()
>>> product, = template.products
>>> product.save()