[MERGE] merge with changes qdp

bzr revid: jco@openerp.com-20130516145114-mtr9taaq0vecezbw
This commit is contained in:
Josse Colpaert 2013-05-16 16:51:14 +02:00
commit 3d0da85306
3 changed files with 9 additions and 7 deletions

View File

@ -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
)""")

View File

@ -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 = [

View File

@ -250,7 +250,7 @@
</record>
<record id="stock_location_shop1" model="stock.location">
<field model="res.partner" name="partner_id" search="[('name','=','Eric')]"/>
<field name="company_id" ref="res_company_1"/>
<field name="company_id" ref="res_company_2"/>
<field name="location_id" ref="stock.stock_location_locations"/>
<field name="usage">internal</field>
<field eval="1" name="active"/>