Merge lp:~hbrunn/ocb-addons/trunk-lp1252652 into lp:ocb-addons

Proposed by Holger Brunn (Therp)
Status: Rejected
Rejected by: Holger Brunn (Therp)
Proposed branch: lp:~hbrunn/ocb-addons/trunk-lp1252652
Merge into: lp:ocb-addons
Diff against target: 55 lines (+18/-6)
1 file modified
mrp/mrp.py (+18/-6)
To merge this branch: bzr merge lp:~hbrunn/ocb-addons/trunk-lp1252652
Reviewer Review Type Date Requested Status
Holger Brunn (Therp) Disapprove
Ana Juaristi Olalde (community) code review Approve
Pedro Manuel Baeza code review Approve
Review via email: mp+210981@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Pedro Manuel Baeza (pedro.baeza) wrote :

Good point, thanks for bringing this.

Regards.

review: Approve (code review)
Revision history for this message
Ana Juaristi Olalde (ajuaristio) wrote :

+1 Pedro.
Thank you Jordi

review: Approve (code review)
Revision history for this message
Holger Brunn (Therp) (hbrunn) wrote :

Development for 7.0 has moved to github on https://github.com/OCA/ocb - please move your merge proposal there if it is still valid.

(I close and reject this in order to have a cleaner overview for 6.1 MPs which indeed have to be done on launchpad)

review: Disapprove

Unmerged revisions

10009. By Jordi Llinares - KM Sistemas

[FIX] use mo's routing, not the bom's

10008. By Jordi Llinares - KM Sistemas

[FIX] get produce lines' source location and consume lines' destination
location from routing if available

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'mrp/mrp.py'
--- mrp/mrp.py 2014-03-13 17:17:59 +0000
+++ mrp/mrp.py 2014-03-14 08:15:06 +0000
@@ -957,8 +957,8 @@
957957
958 # Take routing address as a Shipment Address.958 # Take routing address as a Shipment Address.
959 # If usage of routing location is a internal, make outgoing shipment otherwise internal shipment959 # If usage of routing location is a internal, make outgoing shipment otherwise internal shipment
960 if production.bom_id.routing_id and production.bom_id.routing_id.location_id:960 if production.routing_id and production.routing_id.location_id:
961 routing_loc = production.bom_id.routing_id.location_id961 routing_loc = production.routing_id.location_id
962 if routing_loc.usage != 'internal':962 if routing_loc.usage != 'internal':
963 pick_type = 'out'963 pick_type = 'out'
964 partner_id = routing_loc.partner_id and routing_loc.partner_id.id or False964 partner_id = routing_loc.partner_id and routing_loc.partner_id.id or False
@@ -984,7 +984,13 @@
984984
985 def _make_production_produce_line(self, cr, uid, production, context=None):985 def _make_production_produce_line(self, cr, uid, production, context=None):
986 stock_move = self.pool.get('stock.move')986 stock_move = self.pool.get('stock.move')
987 source_location_id = production.product_id.property_stock_production.id987
988 if production.routing_id and production.routing_id.location_id:
989 source_location_id = production.routing_id.location_id.id
990 else:
991 source_location_id = production.product_id\
992 .property_stock_production.id
993
988 destination_location_id = production.location_dest_id.id994 destination_location_id = production.location_dest_id.id
989 data = {995 data = {
990 'name': production.name,996 'name': production.name,
@@ -1010,7 +1016,13 @@
1010 # Internal shipment is created for Stockable and Consumer Products1016 # Internal shipment is created for Stockable and Consumer Products
1011 if production_line.product_id.type not in ('product', 'consu'):1017 if production_line.product_id.type not in ('product', 'consu'):
1012 return False1018 return False
1013 destination_location_id = production.product_id.property_stock_production.id1019
1020 if production.routing_id and production.routing_id.location_id:
1021 destination_location_id = production.routing_id.location_id.id
1022 else:
1023 destination_location_id = production.product_id\
1024 .property_stock_production.id
1025
1014 if not source_location_id:1026 if not source_location_id:
1015 source_location_id = production.location_src_id.id1027 source_location_id = production.location_src_id.id
1016 move_id = stock_move.create(cr, uid, {1028 move_id = stock_move.create(cr, uid, {
@@ -1044,8 +1056,8 @@
10441056
1045 # Take routing location as a Source Location.1057 # Take routing location as a Source Location.
1046 source_location_id = production.location_src_id.id1058 source_location_id = production.location_src_id.id
1047 if production.bom_id.routing_id and production.bom_id.routing_id.location_id:1059 if production.routing_id and production.routing_id.location_id:
1048 source_location_id = production.bom_id.routing_id.location_id.id1060 source_location_id = production.routing_id.location_id.id
10491061
1050 for line in production.product_lines:1062 for line in production.product_lines:
1051 consume_move_id = self._make_production_consume_line(cr, uid, line, produce_move_id, source_location_id=source_location_id, context=context)1063 consume_move_id = self._make_production_consume_line(cr, uid, line, produce_move_id, source_location_id=source_location_id, context=context)