Merge lp:~dorian-kemps/unifield-server/US-2350 into lp:unifield-server

Proposed by jftempo
Status: Merged
Merged at revision: 5540
Proposed branch: lp:~dorian-kemps/unifield-server/US-2350
Merge into: lp:unifield-server
Diff against target: 114 lines (+20/-5)
6 files modified
bin/addons/msf_profile/i18n/fr_MF.po (+1/-0)
bin/addons/msf_sync_data_server/data/sync_server.message_rule.csv (+2/-2)
bin/addons/stock/stock.py (+1/-0)
bin/addons/stock/stock_view.xml (+1/-0)
bin/addons/stock_batch_recall/product_expiry.py (+4/-1)
bin/addons/sync_so/picking.py (+11/-2)
To merge this branch: bzr merge lp:~dorian-kemps/unifield-server/US-2350
Reviewer Review Type Date Requested Status
UniField Reviewer Team Pending
Review via email: mp+371655@code.launchpad.net
To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'bin/addons/msf_profile/i18n/fr_MF.po'
--- bin/addons/msf_profile/i18n/fr_MF.po 2019-10-15 16:08:57 +0000
+++ bin/addons/msf_profile/i18n/fr_MF.po 2019-10-17 14:36:32 +0000
@@ -24856,6 +24856,7 @@
24856#: field:shipment.add.pack.processor.line,comment:024856#: field:shipment.add.pack.processor.line,comment:0
24857#: report:addons/msf_outgoing/report/packing_list_xls.mako:43124857#: report:addons/msf_outgoing/report/packing_list_xls.mako:431
24858#: field:check.products.supplier.updated.wizard,comment:024858#: field:check.products.supplier.updated.wizard,comment:0
24859#: field:stock.production.lot,comment:0
24859#, python-format24860#, python-format
24860msgid "Comment"24861msgid "Comment"
24861msgstr "Commentaire"24862msgstr "Commentaire"
2486224863
=== modified file 'bin/addons/msf_sync_data_server/data/sync_server.message_rule.csv'
--- bin/addons/msf_sync_data_server/data/sync_server.message_rule.csv 2019-08-08 13:55:43 +0000
+++ bin/addons/msf_sync_data_server/data/sync_server.message_rule.csv 2019-10-17 14:36:32 +0000
@@ -7,8 +7,8 @@
7msf_sync_data_server.update_in_ref,TRUE,TRUE,"['name','shipment_ref']","['&',('shipment_ref','!=',False),'!',('shipment_ref', 'like', 'invalid_by_recovery')]",partner_id,MISSION,stock.picking.update_in_ref,stock.picking,IN updates ref to OUT SHIP,10,,Valid7msf_sync_data_server.update_in_ref,TRUE,TRUE,"['name','shipment_ref']","['&',('shipment_ref','!=',False),'!',('shipment_ref', 'like', 'invalid_by_recovery')]",partner_id,MISSION,stock.picking.update_in_ref,stock.picking,IN updates ref to OUT SHIP,10,,Valid
8msf_sync_data_server.pol_create_sol,TRUE,TRUE,"['sync_local_id', 'order_id/name','product_id/id', 'product_id/name', 'name', 'state', 'product_qty', 'product_uom', 'price_unit', 'analytic_distribution_id/id','comment','have_analytic_distribution_from_header','line_number', 'nomen_manda_0/id','nomen_manda_1/id','nomen_manda_2/id','nomen_manda_3/id', 'nomenclature_description','notes','default_name','default_code','is_line_split','date_planned', 'stock_take_date']","[('sync_linked_sol', '=', False), ('order_id.partner_type', 'not in',['external','esc']), ('state', 'in', ['validated', 'confirmed', 'done']), ('order_id.state', 'not in', ['draft', 'draft_p', 'cancel'])]",partner_id,MISSION,sale.order.line.create_so_line,purchase.order.line,PO line creates FO line,11,,Valid8msf_sync_data_server.pol_create_sol,TRUE,TRUE,"['sync_local_id', 'order_id/name','product_id/id', 'product_id/name', 'name', 'state', 'product_qty', 'product_uom', 'price_unit', 'analytic_distribution_id/id','comment','have_analytic_distribution_from_header','line_number', 'nomen_manda_0/id','nomen_manda_1/id','nomen_manda_2/id','nomen_manda_3/id', 'nomenclature_description','notes','default_name','default_code','is_line_split','date_planned', 'stock_take_date']","[('sync_linked_sol', '=', False), ('order_id.partner_type', 'not in',['external','esc']), ('state', 'in', ['validated', 'confirmed', 'done']), ('order_id.state', 'not in', ['draft', 'draft_p', 'cancel'])]",partner_id,MISSION,sale.order.line.create_so_line,purchase.order.line,PO line creates FO line,11,,Valid
9msf_sync_data_server.sol_updates_pol,TRUE,TRUE,"['resourced_original_line/id', 'resourced_original_remote_line','sync_sourced_origin', 'sync_local_id', 'sync_linked_pol', 'order_id/name', 'product_id/id', 'product_id/name', 'name', 'state','product_uom_qty', 'product_uom', 'price_unit', 'in_name_goods_return', 'analytic_distribution_id/id','comment','have_analytic_distribution_from_header','line_number', 'nomen_manda_0/id','nomen_manda_1/id','nomen_manda_2/id','nomen_manda_3/id', 'nomenclature_description','notes','default_name','default_code','date_planned','is_line_split', 'original_line_id/id', 'confirmed_delivery_date', 'stock_take_date', 'cancel_split_ok', 'modification_comment', 'from_cancel_out']","[('order_id.partner_type', '!=', 'external'), ('state', '!=', 'draft'), ('product_uom_qty', '!=', 0.0), '!', '&', ('order_id.fo_created_by_po_sync', '=', False), ('order_id.state', '=', 'draft')]",partner_id,MISSION,purchase.order.line.sol_update_original_pol,sale.order.line,FO line updates PO line,12,"[('order_id.state', 'in', ['draft', 'draft_p']), ('order_id.partner_type', 'not in', ['external', 'esc']), ('order_id.client_order_ref', '=', False)]",Valid9msf_sync_data_server.sol_updates_pol,TRUE,TRUE,"['resourced_original_line/id', 'resourced_original_remote_line','sync_sourced_origin', 'sync_local_id', 'sync_linked_pol', 'order_id/name', 'product_id/id', 'product_id/name', 'name', 'state','product_uom_qty', 'product_uom', 'price_unit', 'in_name_goods_return', 'analytic_distribution_id/id','comment','have_analytic_distribution_from_header','line_number', 'nomen_manda_0/id','nomen_manda_1/id','nomen_manda_2/id','nomen_manda_3/id', 'nomenclature_description','notes','default_name','default_code','date_planned','is_line_split', 'original_line_id/id', 'confirmed_delivery_date', 'stock_take_date', 'cancel_split_ok', 'modification_comment', 'from_cancel_out']","[('order_id.partner_type', '!=', 'external'), ('state', '!=', 'draft'), ('product_uom_qty', '!=', 0.0), '!', '&', ('order_id.fo_created_by_po_sync', '=', False), ('order_id.state', '=', 'draft')]",partner_id,MISSION,purchase.order.line.sol_update_original_pol,sale.order.line,FO line updates PO line,12,"[('order_id.state', 'in', ['draft', 'draft_p']), ('order_id.partner_type', 'not in', ['external', 'esc']), ('order_id.client_order_ref', '=', False)]",Valid
10msf_sync_data_server.partial_shipped_coordo_updates_in_at_project,TRUE,TRUE,"['name', 'state', 'origin', 'partner_type_stock_picking', 'shipment_id/name', 'min_date', 'note', 'claim', 'move_lines/processed_stock_move', 'move_lines/id', 'move_lines/state','move_lines/original_qty_partial', 'move_lines/line_number', 'move_lines/name', 'move_lines/change_reason', 'move_lines/product_id/id', 'move_lines/product_id/name', 'move_lines/product_id/default_code', 'move_lines/product_qty', 'move_lines/prodlot_id/id','move_lines/prodlot_id/name','move_lines/prodlot_id/life_date', 'move_lines/expired_date', 'move_lines/asset_id/id','move_lines/product_uom/id', 'move_lines/product_uom/name', 'move_lines/date', 'move_lines/date_expected', 'move_lines/note', 'move_lines/location_dest_id/usage', 'move_lines/comment', 'move_lines/sale_line_id/id', 'move_lines/sale_line_id/in_name_goods_return', 'sale_id/claim_name_goods_return', 'sale_id/client_order_ref']","['&','&','&','&','&',('partner_type_stock_picking', '!=', 'external'), ('type', '=', 'out'), ('subtype', 'in', ['standard', 'packing']), ('state', '=', 'done'), ('already_shipped', '=', True), ('do_not_sync', '=', False)]",partner_id,MISSION,stock.picking.partial_shipped_fo_updates_in_po,stock.picking,Partial shipped at Coordo updates IN at Project,19,,Valid10msf_sync_data_server.partial_shipped_coordo_updates_in_at_project,TRUE,TRUE,"['name', 'state', 'origin', 'partner_type_stock_picking', 'shipment_id/name', 'min_date', 'note', 'claim', 'move_lines/processed_stock_move', 'move_lines/id', 'move_lines/state','move_lines/original_qty_partial', 'move_lines/line_number', 'move_lines/name', 'move_lines/change_reason', 'move_lines/product_id/id', 'move_lines/product_id/name', 'move_lines/product_id/default_code', 'move_lines/product_qty', 'move_lines/prodlot_id/id','move_lines/prodlot_id/name','move_lines/prodlot_id/life_date', 'move_lines/prodlot_id/comment', 'move_lines/expired_date', 'move_lines/asset_id/id','move_lines/product_uom/id', 'move_lines/product_uom/name', 'move_lines/date', 'move_lines/date_expected', 'move_lines/note', 'move_lines/location_dest_id/usage', 'move_lines/comment', 'move_lines/sale_line_id/id', 'move_lines/sale_line_id/in_name_goods_return', 'sale_id/claim_name_goods_return', 'sale_id/client_order_ref']","['&','&','&','&','&',('partner_type_stock_picking', '!=', 'external'), ('type', '=', 'out'), ('subtype', 'in', ['standard', 'packing']), ('state', '=', 'done'), ('already_shipped', '=', True), ('do_not_sync', '=', False)]",partner_id,MISSION,stock.picking.partial_shipped_fo_updates_in_po,stock.picking,Partial shipped at Coordo updates IN at Project,19,,Valid
11msf_sync_data_server.moves_from_dpo_closed_coordo_updates_in_at_project,TRUE,TRUE,"['name', 'state', 'origin', 'subtype', 'partner_type_stock_picking', 'shipment_id/name', 'min_date', 'note', 'move_lines/processed_stock_move', 'move_lines/id', 'move_lines/state','move_lines/original_qty_partial', 'move_lines/line_number', 'move_lines/name', 'move_lines/change_reason', 'move_lines/product_id/id', 'move_lines/product_id/name', 'move_lines/product_id/default_code', 'move_lines/product_qty', 'move_lines/prodlot_id/id','move_lines/prodlot_id/name','move_lines/prodlot_id/life_date', 'move_lines/expired_date', 'move_lines/asset_id/id','move_lines/product_uom/id', 'move_lines/product_uom/name', 'move_lines/date', 'move_lines/date_expected', 'move_lines/note', 'move_lines/dpo_line_id', 'move_lines/comment']","['&', '&', '&', ('partner_type_stock_picking', '!=', 'external'), ('type', '=', 'out'), ('subtype', 'in', ['picking', 'standard']), ('dpo_out', '=', True)]",partner_id,MISSION,stock.picking.partial_shippped_dpo_updates_in_po,stock.picking,Moves from DPO closed at Coordo updates IN at Project,20,,Valid11msf_sync_data_server.moves_from_dpo_closed_coordo_updates_in_at_project,TRUE,TRUE,"['name', 'state', 'origin', 'subtype', 'partner_type_stock_picking', 'shipment_id/name', 'min_date', 'note', 'move_lines/processed_stock_move', 'move_lines/id', 'move_lines/state','move_lines/original_qty_partial', 'move_lines/line_number', 'move_lines/name', 'move_lines/change_reason', 'move_lines/product_id/id', 'move_lines/product_id/name', 'move_lines/product_id/default_code', 'move_lines/product_qty', 'move_lines/prodlot_id/id','move_lines/prodlot_id/name','move_lines/prodlot_id/life_date', 'move_lines/prodlot_id/comment', 'move_lines/expired_date', 'move_lines/asset_id/id','move_lines/product_uom/id', 'move_lines/product_uom/name', 'move_lines/date', 'move_lines/date_expected', 'move_lines/note', 'move_lines/dpo_line_id', 'move_lines/comment']","['&', '&', '&', ('partner_type_stock_picking', '!=', 'external'), ('type', '=', 'out'), ('subtype', 'in', ['picking', 'standard']), ('dpo_out', '=', True)]",partner_id,MISSION,stock.picking.partial_shippped_dpo_updates_in_po,stock.picking,Moves from DPO closed at Coordo updates IN at Project,20,,Valid
12msf_sync_data_server.dpo_service_lines_update_in_at_project,FALSE,TRUE,"['order_id/name', 'order_id/delivery_confirmed_date', 'sync_local_id', 'origin', 'confirmed_delivery_date', 'name', 'product_uom/id', 'product_uom/name', 'link_sol_id/line_number', 'notes', 'product_qty', 'product_id/name', 'product_id/id', 'product_id/default_code', 'comment']","[('dest_partner_id.partner_type', '=', 'internal'), ('order_id.order_type', '=', 'direct'), ('order_id.state', 'in', ['approved', 'done']), ('product_id.type', 'in', ['service', 'service_recep'])]",dest_partner_id,MISSION,purchase.order.line.confirmed_dpo_service_lines_update_in_po,purchase.order.line,DPO service lines update IN at Project,21,,Valid12msf_sync_data_server.dpo_service_lines_update_in_at_project,FALSE,TRUE,"['order_id/name', 'order_id/delivery_confirmed_date', 'sync_local_id', 'origin', 'confirmed_delivery_date', 'name', 'product_uom/id', 'product_uom/name', 'link_sol_id/line_number', 'notes', 'product_qty', 'product_id/name', 'product_id/id', 'product_id/default_code', 'comment']","[('dest_partner_id.partner_type', '=', 'internal'), ('order_id.order_type', '=', 'direct'), ('order_id.state', 'in', ['approved', 'done']), ('product_id.type', 'in', ['service', 'service_recep'])]",dest_partner_id,MISSION,purchase.order.line.confirmed_dpo_service_lines_update_in_po,purchase.order.line,DPO service lines update IN at Project,21,,Valid
13msf_sync_data_server.closed_in_validates_delivery_out_ship,TRUE,TRUE,"['name', 'state', 'shipment_ref']","['&','&','&','&','&',('partner_type_stock_picking', '!=', 'external'), ('type', '=', 'in'),('subtype', 'in', ['standard']), ('state', '=', 'done'), ('shipment_ref', '!=', False), ('dpo_incoming', '=', False)]",partner_id,MISSION,stock.picking.closed_in_validates_delivery_out_ship,stock.picking,Closed IN validates delivery of OUT-SHIP,26,,Valid13msf_sync_data_server.closed_in_validates_delivery_out_ship,TRUE,TRUE,"['name', 'state', 'shipment_ref']","['&','&','&','&','&',('partner_type_stock_picking', '!=', 'external'), ('type', '=', 'in'),('subtype', 'in', ['standard']), ('state', '=', 'done'), ('shipment_ref', '!=', False), ('dpo_incoming', '=', False)]",partner_id,MISSION,stock.picking.closed_in_validates_delivery_out_ship,stock.picking,Closed IN validates delivery of OUT-SHIP,26,,Valid
14msf_sync_data_server.closed_in_confirms_dpo_reception,TRUE,TRUE,"['name', 'state', 'dpo_line_id']","['&','&','&','&',('picking_id.partner_type_stock_picking', '!=', 'external'), ('picking_id.type', '=', 'in'), ('picking_id.subtype', 'in', ['standard']), ('state', '=', 'done'), ('dpo_line_id', '!=', 0)]",partner_id,MISSION,stock.picking.closed_in_confirms_dpo_reception,stock.move,Closed IN confirms DPO reception,27,,Valid14msf_sync_data_server.closed_in_confirms_dpo_reception,TRUE,TRUE,"['name', 'state', 'dpo_line_id']","['&','&','&','&',('picking_id.partner_type_stock_picking', '!=', 'external'), ('picking_id.type', '=', 'in'), ('picking_id.subtype', 'in', ['standard']), ('state', '=', 'done'), ('dpo_line_id', '!=', 0)]",partner_id,MISSION,stock.picking.closed_in_confirms_dpo_reception,stock.move,Closed IN confirms DPO reception,27,,Valid
1515
=== modified file 'bin/addons/stock/stock.py'
--- bin/addons/stock/stock.py 2019-09-25 14:20:09 +0000
+++ bin/addons/stock/stock.py 2019-10-17 14:36:32 +0000
@@ -2008,6 +2008,7 @@
2008 'revisions': fields.one2many('stock.production.lot.revision', 'lot_id', 'Revisions'),2008 'revisions': fields.one2many('stock.production.lot.revision', 'lot_id', 'Revisions'),
2009 'company_id': fields.many2one('res.company', 'Company', select=True),2009 'company_id': fields.many2one('res.company', 'Company', select=True),
2010 'move_ids': fields.one2many('stock.move', 'prodlot_id', 'Moves for this production lot', readonly=True),2010 'move_ids': fields.one2many('stock.move', 'prodlot_id', 'Moves for this production lot', readonly=True),
2011 'comment': fields.char('Comment', size=100),
2011 }2012 }
2012 _defaults = {2013 _defaults = {
2013 'date': lambda *a: time.strftime('%Y-%m-%d %H:%M:%S'),2014 'date': lambda *a: time.strftime('%Y-%m-%d %H:%M:%S'),
20142015
=== modified file 'bin/addons/stock/stock_view.xml'
--- bin/addons/stock/stock_view.xml 2019-08-02 14:06:44 +0000
+++ bin/addons/stock/stock_view.xml 2019-10-17 14:36:32 +0000
@@ -321,6 +321,7 @@
321 <group col="2" colspan="2">321 <group col="2" colspan="2">
322 <separator string="Traceability" colspan="4"/>322 <separator string="Traceability" colspan="4"/>
323 <field name="stock_available" colspan="4"/>323 <field name="stock_available" colspan="4"/>
324 <field name="comment" colspan="4"/>
324 <button name="action_traceability" string="Upstream Traceability" type="object" context="{'type': '', 'field': 'prodlot_id'}" icon="gtk-go-up" colspan="2"/>325 <button name="action_traceability" string="Upstream Traceability" type="object" context="{'type': '', 'field': 'prodlot_id'}" icon="gtk-go-up" colspan="2"/>
325 <button name="action_traceability" string="Downstream Traceability" type="object" context="{'type': 'move_history_ids', 'field': 'prodlot_id'}" icon="gtk-go-down" colspan="2"/>326 <button name="action_traceability" string="Downstream Traceability" type="object" context="{'type': 'move_history_ids', 'field': 'prodlot_id'}" icon="gtk-go-down" colspan="2"/>
326 </group>327 </group>
327328
=== modified file 'bin/addons/stock_batch_recall/product_expiry.py'
--- bin/addons/stock_batch_recall/product_expiry.py 2019-07-30 09:13:43 +0000
+++ bin/addons/stock_batch_recall/product_expiry.py 2019-10-17 14:36:32 +0000
@@ -51,7 +51,7 @@
5151
5252
53 # US-838: This method got moved from addons/msf_outgoing/wizard/incoming_shipment_processor.py53 # US-838: This method got moved from addons/msf_outgoing/wizard/incoming_shipment_processor.py
54 def _get_prodlot_from_expiry_date(self, cr, uid, expiry_date, product_id, context=None):54 def _get_prodlot_from_expiry_date(self, cr, uid, expiry_date, product_id, comment, context=None):
55 """55 """
56 Search if an internal batch exists in the system with this expiry date.56 Search if an internal batch exists in the system with this expiry date.
57 If no, create the batch.57 If no, create the batch.
@@ -74,10 +74,13 @@
74 'life_date': expiry_date,74 'life_date': expiry_date,
75 'name': seq_ed,75 'name': seq_ed,
76 'type': 'internal',76 'type': 'internal',
77 'comment': comment, # Add comment through synchro
77 }78 }
78 lot_id = self.create(cr, uid, vals, context)79 lot_id = self.create(cr, uid, vals, context)
79 else:80 else:
80 lot_id = lot_ids[0]81 lot_id = lot_ids[0]
82 # Add comment through synchro
83 self.write(cr, uid, lot_id, {'comment': comment}, context=context)
8184
82 return lot_id85 return lot_id
8386
8487
=== modified file 'bin/addons/sync_so/picking.py'
--- bin/addons/sync_so/picking.py 2019-07-31 12:02:50 +0000
+++ bin/addons/sync_so/picking.py 2019-10-17 14:36:32 +0000
@@ -163,8 +163,9 @@
163 if 'life_date' in batch_values:163 if 'life_date' in batch_values:
164 # If name exists in the sync message, search by name and product, not by xmlid164 # If name exists in the sync message, search by name and product, not by xmlid
165 life_date = batch_values['life_date']165 life_date = batch_values['life_date']
166 lot_comment = batch_values.get('comment', False)
166 # US-838: use different way to retrieve the EP object167 # US-838: use different way to retrieve the EP object
167 batch_id = prodlot_obj._get_prodlot_from_expiry_date(cr, uid, life_date, product_id, context=context)168 batch_id = prodlot_obj._get_prodlot_from_expiry_date(cr, uid, life_date, product_id, lot_comment, context=context)
168 if not batch_id:169 if not batch_id:
169 raise Exception, "Error while retrieving or creating the expiry date %s for the product %s" % (batch_values, prod.name)170 raise Exception, "Error while retrieving or creating the expiry date %s for the product %s" % (batch_values, prod.name)
170 else:171 else:
@@ -841,12 +842,20 @@
841 existing_bn = batch_obj.search(cr, uid, [('name', '=', batch_dict['name']), ('product_id', '=', product_id),842 existing_bn = batch_obj.search(cr, uid, [('name', '=', batch_dict['name']), ('product_id', '=', product_id),
842 ('life_date', '=', batch_dict['life_date'])], context=context)843 ('life_date', '=', batch_dict['life_date'])], context=context)
843 if existing_bn: # existed already, then don't need to create a new one844 if existing_bn: # existed already, then don't need to create a new one
845 # Add comment through synchro
846 if batch_dict.get('comment'):
847 batch_obj.write(cr, uid, existing_bn[0], {'comment': batch_dict['comment']}, context=context)
844 message = "Batch object exists in the current system. No new batch created."848 message = "Batch object exists in the current system. No new batch created."
845 self._logger.info(message)849 self._logger.info(message)
846 return existing_bn[0], message850 return existing_bn[0], message
847851
848 # If not exists, then create this new batch object852 # If not exists, then create this new batch object
849 new_bn_vals = {'name': batch_dict['name'], 'product_id': product_id, 'life_date': batch_dict['life_date']}853 new_bn_vals = {
854 'name': batch_dict['name'],
855 'product_id': product_id,
856 'life_date': batch_dict['life_date'],
857 'comment': batch_dict.get('comment', False), # Add comment through synchro
858 }
850 message = "The new BN " + batch_dict['name'] + " has been created"859 message = "The new BN " + batch_dict['name'] + " has been created"
851 self._logger.info(message)860 self._logger.info(message)
852 bn_id = batch_obj.create(cr, uid, new_bn_vals, context=context)861 bn_id = batch_obj.create(cr, uid, new_bn_vals, context=context)

Subscribers

People subscribed via source and target branches