Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def getProduct():
- Product = Model.get('product.template')
- product, = Product.find([('name', '=', 'CARBON STEEL BALLS 3/8" 1000 -EN')])
- print "Produit EN: " + product.name
- config._context['language'] = 'fr_FR'
- product, = Product.find([('name', '=', 'CARBON STEEL BALLS 3/8" 1000 -EN')])
- print "Produit FR: " + product.name
- config._context['language'] = 'en_EN'
- product, = Product.find([('name', '=', 'CARBON STEEL BALLS 3/8" 1000 -EN')])
- print "Produit EN: " + product.name
- def newProduct():
- config._context['language'] = 'en'
- ProductUom = Model.get('product.uom')
- Product = Model.get('product.template')
- unit, = ProductUom.find([('name', '=', 'Unit')])
- product = Product()
- product.name = 'TEST - NAME ENGLISH'
- product.default_uom = unit
- product.type = 'goods'
- product.list_price = Decimal('0')
- product.purchasable = True
- product.save()
- config._context['language'] = 'fr'
- product.name = 'TEST - NOM FRANCAIS'
- product.save()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement