diff options
| author | Christophe Simonis <chs@odoo.com> | 2016-12-08 12:27:18 +0100 |
|---|---|---|
| committer | Christophe Simonis <chs@odoo.com> | 2016-12-08 12:27:18 +0100 |
| commit | 1568c81269cb1f76e985fb9916579d894b97900a (patch) | |
| tree | 10b1ee66b90843ed6075a90a8090bbc7a6ff4815 | |
| parent | 63d230b0070bea40681ce11bbafba127a79c9f49 (diff) | |
| parent | da5d6289114c0cf687681bde8debed6676698abf (diff) | |
[MERGE] forward port branch saas-6 up to da5d628
| -rw-r--r-- | addons/product/pricelist.py | 2 | ||||
| -rw-r--r-- | addons/stock/stock.py | 3 | ||||
| -rw-r--r-- | openerp/models.py | 7 |
3 files changed, 7 insertions, 5 deletions
diff --git a/addons/product/pricelist.py b/addons/product/pricelist.py index 7047cebb1f6..8a88ee059c0 100644 --- a/addons/product/pricelist.py +++ b/addons/product/pricelist.py @@ -324,10 +324,12 @@ class product_pricelist_item(osv.osv): 'company_id': fields.related('pricelist_id','company_id',type='many2one', readonly=True, relation='res.company', string='Company', store={ 'product.pricelist': (_get_product_pricelist, ['company_id'], 30), + 'product.pricelist.item': (lambda self, cr, uid, ids, c=None: ids, ['pricelist_id'], 30), }), 'currency_id': fields.related('pricelist_id', 'currency_id', type='many2one', readonly=True, relation='res.currency', string='Currency', store={ 'product.pricelist': (_get_product_pricelist, ['currency_id'], 30), + 'product.pricelist.item': (lambda self, cr, uid, ids, c=None: ids, ['pricelist_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"), diff --git a/addons/stock/stock.py b/addons/stock/stock.py index f305332e707..ae6b3888dc2 100644 --- a/addons/stock/stock.py +++ b/addons/stock/stock.py @@ -4278,7 +4278,6 @@ class stock_package(osv.osv): context = dict(context or {}, active_ids=ids) return self.pool.get("report").get_action(cr, uid, ids, 'stock.report_package_barcode_small', context=context) - def unpack(self, cr, uid, ids, context=None): quant_obj = self.pool.get('stock.quant') for package in self.browse(cr, uid, ids, context=context): @@ -4286,8 +4285,6 @@ class stock_package(osv.osv): quant_obj.write(cr, SUPERUSER_ID, quant_ids, {'package_id': package.parent_id.id or False}, context=context) children_package_ids = [child_package.id for child_package in package.children_ids] self.write(cr, uid, children_package_ids, {'parent_id': package.parent_id.id or False}, context=context) - #delete current package since it contains nothing anymore - self.unlink(cr, uid, ids, context=context) return self.pool.get('ir.actions.act_window').for_xml_id(cr, uid, 'stock', 'action_package_view', context=context) def get_content(self, cr, uid, ids, context=None): diff --git a/openerp/models.py b/openerp/models.py index 42fec7535ae..2af2ec78d09 100644 --- a/openerp/models.py +++ b/openerp/models.py @@ -747,8 +747,11 @@ class BaseModel(object): cls = type(self) methods = [] for attr, func in getmembers(cls, is_constraint): - if not all(name in cls._fields for name in func._constrains): - _logger.warning("@constrains%r parameters must be field names", func._constrains) + for name in func._constrains: + if name not in cls._fields: + _logger.warning("method %s.%s: @constrains parameter %r is not a field name", cls._name, attr, name) + if not cls._fields[name].store: + _logger.warning("method %s.%s: @constrains parameter %r is not stored", cls._name, attr, name) methods.append(func) # optimization: memoize result on cls, it will not be recomputed |
