Merge lp:~dorian-kemps/unifield-server/US-2350 into lp:unifield-server
- US-2350
- Merge into trunk
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 |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
UniField Reviewer Team | Pending | ||
Review via email: mp+371655@code.launchpad.net |
Commit message
Description of the change
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
1 | === modified file 'bin/addons/msf_profile/i18n/fr_MF.po' |
2 | --- bin/addons/msf_profile/i18n/fr_MF.po 2019-10-15 16:08:57 +0000 |
3 | +++ bin/addons/msf_profile/i18n/fr_MF.po 2019-10-17 14:36:32 +0000 |
4 | @@ -24856,6 +24856,7 @@ |
5 | #: field:shipment.add.pack.processor.line,comment:0 |
6 | #: report:addons/msf_outgoing/report/packing_list_xls.mako:431 |
7 | #: field:check.products.supplier.updated.wizard,comment:0 |
8 | +#: field:stock.production.lot,comment:0 |
9 | #, python-format |
10 | msgid "Comment" |
11 | msgstr "Commentaire" |
12 | |
13 | === modified file 'bin/addons/msf_sync_data_server/data/sync_server.message_rule.csv' |
14 | --- bin/addons/msf_sync_data_server/data/sync_server.message_rule.csv 2019-08-08 13:55:43 +0000 |
15 | +++ bin/addons/msf_sync_data_server/data/sync_server.message_rule.csv 2019-10-17 14:36:32 +0000 |
16 | @@ -7,8 +7,8 @@ |
17 | msf_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 |
18 | msf_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 |
19 | msf_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 |
20 | -msf_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,,Valid |
21 | -msf_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,,Valid |
22 | +msf_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 |
23 | +msf_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 |
24 | msf_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 |
25 | msf_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 |
26 | msf_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 |
27 | |
28 | === modified file 'bin/addons/stock/stock.py' |
29 | --- bin/addons/stock/stock.py 2019-09-25 14:20:09 +0000 |
30 | +++ bin/addons/stock/stock.py 2019-10-17 14:36:32 +0000 |
31 | @@ -2008,6 +2008,7 @@ |
32 | 'revisions': fields.one2many('stock.production.lot.revision', 'lot_id', 'Revisions'), |
33 | 'company_id': fields.many2one('res.company', 'Company', select=True), |
34 | 'move_ids': fields.one2many('stock.move', 'prodlot_id', 'Moves for this production lot', readonly=True), |
35 | + 'comment': fields.char('Comment', size=100), |
36 | } |
37 | _defaults = { |
38 | 'date': lambda *a: time.strftime('%Y-%m-%d %H:%M:%S'), |
39 | |
40 | === modified file 'bin/addons/stock/stock_view.xml' |
41 | --- bin/addons/stock/stock_view.xml 2019-08-02 14:06:44 +0000 |
42 | +++ bin/addons/stock/stock_view.xml 2019-10-17 14:36:32 +0000 |
43 | @@ -321,6 +321,7 @@ |
44 | <group col="2" colspan="2"> |
45 | <separator string="Traceability" colspan="4"/> |
46 | <field name="stock_available" colspan="4"/> |
47 | + <field name="comment" colspan="4"/> |
48 | <button name="action_traceability" string="Upstream Traceability" type="object" context="{'type': '', 'field': 'prodlot_id'}" icon="gtk-go-up" colspan="2"/> |
49 | <button name="action_traceability" string="Downstream Traceability" type="object" context="{'type': 'move_history_ids', 'field': 'prodlot_id'}" icon="gtk-go-down" colspan="2"/> |
50 | </group> |
51 | |
52 | === modified file 'bin/addons/stock_batch_recall/product_expiry.py' |
53 | --- bin/addons/stock_batch_recall/product_expiry.py 2019-07-30 09:13:43 +0000 |
54 | +++ bin/addons/stock_batch_recall/product_expiry.py 2019-10-17 14:36:32 +0000 |
55 | @@ -51,7 +51,7 @@ |
56 | |
57 | |
58 | # US-838: This method got moved from addons/msf_outgoing/wizard/incoming_shipment_processor.py |
59 | - def _get_prodlot_from_expiry_date(self, cr, uid, expiry_date, product_id, context=None): |
60 | + def _get_prodlot_from_expiry_date(self, cr, uid, expiry_date, product_id, comment, context=None): |
61 | """ |
62 | Search if an internal batch exists in the system with this expiry date. |
63 | If no, create the batch. |
64 | @@ -74,10 +74,13 @@ |
65 | 'life_date': expiry_date, |
66 | 'name': seq_ed, |
67 | 'type': 'internal', |
68 | + 'comment': comment, # Add comment through synchro |
69 | } |
70 | lot_id = self.create(cr, uid, vals, context) |
71 | else: |
72 | lot_id = lot_ids[0] |
73 | + # Add comment through synchro |
74 | + self.write(cr, uid, lot_id, {'comment': comment}, context=context) |
75 | |
76 | return lot_id |
77 | |
78 | |
79 | === modified file 'bin/addons/sync_so/picking.py' |
80 | --- bin/addons/sync_so/picking.py 2019-07-31 12:02:50 +0000 |
81 | +++ bin/addons/sync_so/picking.py 2019-10-17 14:36:32 +0000 |
82 | @@ -163,8 +163,9 @@ |
83 | if 'life_date' in batch_values: |
84 | # If name exists in the sync message, search by name and product, not by xmlid |
85 | life_date = batch_values['life_date'] |
86 | + lot_comment = batch_values.get('comment', False) |
87 | # US-838: use different way to retrieve the EP object |
88 | - batch_id = prodlot_obj._get_prodlot_from_expiry_date(cr, uid, life_date, product_id, context=context) |
89 | + batch_id = prodlot_obj._get_prodlot_from_expiry_date(cr, uid, life_date, product_id, lot_comment, context=context) |
90 | if not batch_id: |
91 | raise Exception, "Error while retrieving or creating the expiry date %s for the product %s" % (batch_values, prod.name) |
92 | else: |
93 | @@ -841,12 +842,20 @@ |
94 | existing_bn = batch_obj.search(cr, uid, [('name', '=', batch_dict['name']), ('product_id', '=', product_id), |
95 | ('life_date', '=', batch_dict['life_date'])], context=context) |
96 | if existing_bn: # existed already, then don't need to create a new one |
97 | + # Add comment through synchro |
98 | + if batch_dict.get('comment'): |
99 | + batch_obj.write(cr, uid, existing_bn[0], {'comment': batch_dict['comment']}, context=context) |
100 | message = "Batch object exists in the current system. No new batch created." |
101 | self._logger.info(message) |
102 | return existing_bn[0], message |
103 | |
104 | # If not exists, then create this new batch object |
105 | - new_bn_vals = {'name': batch_dict['name'], 'product_id': product_id, 'life_date': batch_dict['life_date']} |
106 | + new_bn_vals = { |
107 | + 'name': batch_dict['name'], |
108 | + 'product_id': product_id, |
109 | + 'life_date': batch_dict['life_date'], |
110 | + 'comment': batch_dict.get('comment', False), # Add comment through synchro |
111 | + } |
112 | message = "The new BN " + batch_dict['name'] + " has been created" |
113 | self._logger.info(message) |
114 | bn_id = batch_obj.create(cr, uid, new_bn_vals, context=context) |