[MERGE] forward port branch saas-6 up to b3944ed

This commit is contained in:
Christophe Simonis
2016-11-25 12:57:15 +01:00
2 changed files with 33 additions and 2 deletions
+13 -2
View File
@@ -285,6 +285,13 @@ class product_pricelist_item(osv.osv):
return False
return True
def _get_product_pricelist(self, cr, uid, ids, context=None):
result = set()
for pricelist in self.pool['product.pricelist'].browse(cr, uid, ids, context=context):
for item in pricelist.item_ids:
result.add(item.id)
return list(result)
_columns = {
'product_tmpl_id': fields.many2one('product.template', 'Product Template', ondelete='cascade', help="Specify a template if this rule only applies to one product template. Keep empty otherwise."),
'product_id': fields.many2one('product.product', 'Product', ondelete='cascade', help="Specify a product if this rule only applies to one product. Keep empty otherwise."),
@@ -315,9 +322,13 @@ class product_pricelist_item(osv.osv):
'price_max_margin': fields.float('Max. Price Margin',
digits_compute= dp.get_precision('Product Price'), help='Specify the maximum amount of margin over the base price.'),
'company_id': fields.related('pricelist_id','company_id',type='many2one',
readonly=True, relation='res.company', string='Company', store=True),
readonly=True, relation='res.company', string='Company', store={
'product.pricelist': (_get_product_pricelist, ['company_id'], 30),
}),
'currency_id': fields.related('pricelist_id', 'currency_id', type='many2one',
readonly=True, relation='res.currency', string='Currency', store=True),
readonly=True, relation='res.currency', string='Currency', store={
'product.pricelist': (_get_product_pricelist, ['currency_id'], 30),
}),
'date_start': fields.date('Start Date', help="Starting date for the pricelist item validation"),
'date_end': fields.date('End Date', help="Ending valid for the pricelist item validation"),
'compute_price': fields.selection([('fixed', 'Fix Price'), ('percentage', 'Percentage (discount)'), ('formula', 'Formula')], select=True, default='fixed'),
+20
View File
@@ -0,0 +1,20 @@
Spain, 2016-11-21
Diagram Software, S.L. agrees to the terms of the Odoo Corporate Contributor License
Agreement v1.0.
I declare that I am authorized and able to make this agreement and sign this
declaration.
Signed,
Jose Zambudio jose.zambudio@diagram.es https://github.com/zamberjo
List of contributors:
Cristian Moncho cristian.moncho@diagram.es https://github.com/crimoniv
Jose Zambudio jose.zambudio@diagram.es https://github.com/zamberjo
Almudena de la Puente almudena.delapuente@diagram.es https://github.com/almumu
Mauro Cebriá mauro.cebria@diagram.es https://github.com/maurochip
Pedro Albujer pedro.albujer.rico@diagram.es https://github.com/P4R
Rubén Cerdà ruben.cerda.roig@diagram.es https://github.com/rubencr7