mirror of
https://github.com/NaN-tic/trytond-stock_distribution_in.git
synced 2023-12-14 06:03:03 +01:00
Remove accounts from products
This commit is contained in:
parent
d570956f4e
commit
82ad59a5c4
|
@ -69,6 +69,15 @@ Get stock locations::
|
|||
>>> storage_loc, = Location.find([('code', '=', 'STO')])
|
||||
>>> production_loc, = Location.find([('code', '=', 'PROD')])
|
||||
|
||||
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.save()
|
||||
|
||||
Create product::
|
||||
|
||||
>>> ProductUom = Model.get('product.uom')
|
||||
|
@ -80,8 +89,7 @@ Create product::
|
|||
>>> template.type = 'goods'
|
||||
>>> template.list_price = Decimal('20')
|
||||
>>> template.purchasable = True
|
||||
>>> template.account_expense = expense
|
||||
>>> template.account_revenue = revenue
|
||||
>>> template.account_category = account_category
|
||||
>>> template.save()
|
||||
>>> product, = template.products
|
||||
>>> location = product.locations.new()
|
||||
|
|
Loading…
Reference in a new issue