From fb927c08bb3ec99c313eb34e9e21b3ac30e1e518 Mon Sep 17 00:00:00 2001 From: "Quentin (OpenERP)" Date: Thu, 16 May 2013 15:24:12 +0200 Subject: [PATCH 1/3] [FIX] mrp: fixed the psql view in order to take into consideration properties defined for company_id = False as a fallback (if no property can be found for given company) bzr revid: qdp-launchpad@openerp.com-20130516132412-ynuegr1gj1m6jdaf --- addons/mrp/report/mrp_report.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/addons/mrp/report/mrp_report.py b/addons/mrp/report/mrp_report.py index 656b015e55b..9acdebe0f05 100644 --- a/addons/mrp/report/mrp_report.py +++ b/addons/mrp/report/mrp_report.py @@ -86,16 +86,18 @@ class report_mrp_inout(osv.osv): on (pp.id = sm.product_id) left join product_template pt on (pt.id = pp.product_tmpl_id) - LEFT JOIN ir_property ip - ON (ip.name='standard_price' AND ip.res_id=CONCAT('product.template,',pt.id) AND ip.company_id=sm.company_id) left join stock_location sl on ( sl.id = sm.location_id) left join stock_location sl2 - on ( sl2.id = sm.location_dest_id) + on ( sl2.id = sm.location_dest_id), + ir_property ip where sm.state in ('waiting','confirmed','assigned') + and + ip.name='standard_price' AND ip.res_id=CONCAT('product.template,',pt.id) AND (ip.company_id=sm.company_id OR ip.company_id IS NULL) group by - to_char(sm.date,'YYYY:IW') + to_char(sm.date,'YYYY:IW'), ip.company_id + order by ip.company_id ASC LIMIT 1 )""") From c3d4b82b361e5140fae760295e482449e513a53b Mon Sep 17 00:00:00 2001 From: "Quentin (OpenERP)" Date: Thu, 16 May 2013 15:30:41 +0200 Subject: [PATCH 2/3] [IMP] stock: improved the constraint error message to be more clear bzr revid: qdp-launchpad@openerp.com-20130516133041-yvh5cug4idbme3gk --- addons/stock/stock.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/stock/stock.py b/addons/stock/stock.py index 18e10e8c5e8..0fe8f30ae49 100644 --- a/addons/stock/stock.py +++ b/addons/stock/stock.py @@ -1630,9 +1630,9 @@ class stock_move(osv.osv): def _check_company_location(self, cr, uid, ids, context=None): for record in self.browse(cr, uid, ids, context=context): if record.location_id.company_id and (record.company_id.id != record.location_id.company_id.id): - raise osv.except_osv(_('Error'), _('The company of the source location %s of %s and the company of the stock move %s %s should be the same') % (record.location_id.name, record.location_id.company_id.name, record.name, record.company_id)) + raise osv.except_osv(_('Error'), _('The company of the source location (%s) and the company of the stock move (%s) should be the same') % (record.location_id.company_id.name, record.company_id.name)) if record.location_dest_id.company_id and (record.company_id.id != record.location_dest_id.company_id.id): - raise osv.except_osv(_('Error'), _('The company of the destination location %s of %s and the company of the stock move %s %s should be the same') % (record.location_dest_id.name, record.location_dest_id.company_id.name, record.name, record.company_id.name)) + raise osv.except_osv(_('Error'), _('The company of the destination location (%s) and the company of the stock move (%s) should be the same') % (record.location_dest_id.company_id.name, record.company_id.name)) return True _constraints = [ From b0826eebb349f4b778d7f865cbf10b9ad0bf668b Mon Sep 17 00:00:00 2001 From: "Quentin (OpenERP)" Date: Thu, 16 May 2013 15:43:19 +0200 Subject: [PATCH 3/3] [FIX] stock, demo data: set the Birmingham shop as belonging to Birmingham company bzr revid: qdp-launchpad@openerp.com-20130516134319-sonlcbg2lk9910z6 --- addons/stock/stock_demo.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/stock/stock_demo.xml b/addons/stock/stock_demo.xml index ebd831c92da..9b7a04f933a 100644 --- a/addons/stock/stock_demo.xml +++ b/addons/stock/stock_demo.xml @@ -250,7 +250,7 @@ - + internal