Merge pull request #298 from odoo-dev/saas-5-fixes-product-chm

[FIX] product
Context in _set_standard_price and many2one in product.packaging;
Set required at false for product template field when creating a product product;
Remove wrong field on product.template. TODO: move packaging field form product.product to product.template
This commit is contained in:
Christophe Matthieu
2014-06-03 13:16:27 +02:00
2 changed files with 3 additions and 4 deletions
+2 -3
View File
@@ -458,6 +458,8 @@ class product_template(osv.osv):
def _set_standard_price(self, cr, uid, product_tmpl_id, value, context=None):
''' Store the standard price change in order to be able to retrieve the cost of a product template for a given date'''
if context is None:
context = {}
price_history_obj = self.pool['product.price.history']
user_company = self.pool.get('res.users').browse(cr, uid, uid, context=context).company_id.id
company_id = context.get('force_company', user_company)
@@ -533,9 +535,6 @@ class product_template(osv.osv):
"resized as a 64x64px image, with aspect ratio preserved. "\
"Use this field anywhere a small image is required."),
'packaging' : fields.one2many('product.packaging', 'product_id', 'Logistical Units',
help="Gives the different ways to package the same product. This has no impact on the picking order and is mainly used if you use the EDI module."),
'seller_ids': fields.one2many('product.supplierinfo', 'product_tmpl_id', 'Supplier'),
'seller_delay': fields.related('seller_ids','delay', type='integer', string='Supplier Lead Time',
help="This is the average delay in days between the purchase order confirmation and the reception of goods for this product and for the default supplier. It is used by the scheduler to order requests based on reordering delays."),
+1 -1
View File
@@ -270,7 +270,7 @@
</form>
<field name="name" position="replace">
<field name="name" attrs="{'invisible': [('id', '!=', False)]}"/>
<field name="product_tmpl_id" class="oe_inline" readonly="1" attrs="{'invisible': [('id', '=', False)]}"/>
<field name="product_tmpl_id" class="oe_inline" readonly="1" attrs="{'invisible': [('id', '=', False)], 'required': [('id', '!=', False)]}"/>
</field>
<xpath expr="//div[@class='oe_title']" position="inside">
<field name="attribute_value_ids" widget="many2many_tags"/>