Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # -*- coding: utf-8 -*-
- from datetime import datetime
- from optparse import OptionParser
- from proteus import Model, Wizard
- from proteus import config
- database = 'example'
- user = 'admin'
- psw = 'admin'
- config.set_trytond(database, user=user, password=psw)
- # ----------------------------
- Category = Model.get('product.category')
- Template = Model.get('product.template')
- Product = Model.get('product.product')
- UOM = Model.get('product.uom')
- # Create a category
- category1 = Category()
- category1.name = 'Category 1'
- category1.save()
- # Create a template
- template = Template()
- template.name = 'Product template 1'
- template.type = 'goods'
- template.category = category1
- product = template.products[0]
- product.code = '00001'
- template.default_uom, = UOM.find([('symbol','=','u')])
- # How do I assign a list_price or cost_price (Property fields)?
- template.list_price = ???????????
- template.cost_price = ???????????
- template.save()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement