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 | 24856 | #: field:shipment.add.pack.processor.line,comment:0 | 24856 | #: field:shipment.add.pack.processor.line,comment:0 |
6 | 24857 | #: report:addons/msf_outgoing/report/packing_list_xls.mako:431 | 24857 | #: report:addons/msf_outgoing/report/packing_list_xls.mako:431 |
7 | 24858 | #: field:check.products.supplier.updated.wizard,comment:0 | 24858 | #: field:check.products.supplier.updated.wizard,comment:0 |
8 | 24859 | #: field:stock.production.lot,comment:0 | ||
9 | 24859 | #, python-format | 24860 | #, python-format |
10 | 24860 | msgid "Comment" | 24861 | msgid "Comment" |
11 | 24861 | msgstr "Commentaire" | 24862 | msgstr "Commentaire" |
12 | 24862 | 24863 | ||
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 | 7 | 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 | 7 | 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 | 8 | 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 | 8 | 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 | 9 | 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 | 9 | 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 |
22 | 10 | 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 | 10 | 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 | 11 | 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 | 11 | 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 | 12 | 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 | 12 | 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 | 13 | 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 | 13 | 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 | 14 | 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 | 14 | 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 | 15 | 15 | ||
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 | 2008 | 'revisions': fields.one2many('stock.production.lot.revision', 'lot_id', 'Revisions'), | 2008 | 'revisions': fields.one2many('stock.production.lot.revision', 'lot_id', 'Revisions'), |
33 | 2009 | 'company_id': fields.many2one('res.company', 'Company', select=True), | 2009 | 'company_id': fields.many2one('res.company', 'Company', select=True), |
34 | 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), |
35 | 2011 | 'comment': fields.char('Comment', size=100), | ||
36 | 2011 | } | 2012 | } |
37 | 2012 | _defaults = { | 2013 | _defaults = { |
38 | 2013 | 'date': lambda *a: time.strftime('%Y-%m-%d %H:%M:%S'), | 2014 | 'date': lambda *a: time.strftime('%Y-%m-%d %H:%M:%S'), |
39 | 2014 | 2015 | ||
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 | 321 | <group col="2" colspan="2"> | 321 | <group col="2" colspan="2"> |
45 | 322 | <separator string="Traceability" colspan="4"/> | 322 | <separator string="Traceability" colspan="4"/> |
46 | 323 | <field name="stock_available" colspan="4"/> | 323 | <field name="stock_available" colspan="4"/> |
47 | 324 | <field name="comment" colspan="4"/> | ||
48 | 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"/> |
49 | 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"/> |
50 | 326 | </group> | 327 | </group> |
51 | 327 | 328 | ||
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 | 51 | 51 | ||
57 | 52 | 52 | ||
58 | 53 | # US-838: This method got moved from addons/msf_outgoing/wizard/incoming_shipment_processor.py | 53 | # US-838: This method got moved from addons/msf_outgoing/wizard/incoming_shipment_processor.py |
60 | 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): |
61 | 55 | """ | 55 | """ |
62 | 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. |
63 | 57 | If no, create the batch. | 57 | If no, create the batch. |
64 | @@ -74,10 +74,13 @@ | |||
65 | 74 | 'life_date': expiry_date, | 74 | 'life_date': expiry_date, |
66 | 75 | 'name': seq_ed, | 75 | 'name': seq_ed, |
67 | 76 | 'type': 'internal', | 76 | 'type': 'internal', |
68 | 77 | 'comment': comment, # Add comment through synchro | ||
69 | 77 | } | 78 | } |
70 | 78 | lot_id = self.create(cr, uid, vals, context) | 79 | lot_id = self.create(cr, uid, vals, context) |
71 | 79 | else: | 80 | else: |
72 | 80 | lot_id = lot_ids[0] | 81 | lot_id = lot_ids[0] |
73 | 82 | # Add comment through synchro | ||
74 | 83 | self.write(cr, uid, lot_id, {'comment': comment}, context=context) | ||
75 | 81 | 84 | ||
76 | 82 | return lot_id | 85 | return lot_id |
77 | 83 | 86 | ||
78 | 84 | 87 | ||
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 | 163 | if 'life_date' in batch_values: | 163 | if 'life_date' in batch_values: |
84 | 164 | # If name exists in the sync message, search by name and product, not by xmlid | 164 | # If name exists in the sync message, search by name and product, not by xmlid |
85 | 165 | life_date = batch_values['life_date'] | 165 | life_date = batch_values['life_date'] |
86 | 166 | lot_comment = batch_values.get('comment', False) | ||
87 | 166 | # US-838: use different way to retrieve the EP object | 167 | # US-838: use different way to retrieve the EP object |
89 | 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) |
90 | 168 | if not batch_id: | 169 | if not batch_id: |
91 | 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) |
92 | 170 | else: | 171 | else: |
93 | @@ -841,12 +842,20 @@ | |||
94 | 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), |
95 | 842 | ('life_date', '=', batch_dict['life_date'])], context=context) | 843 | ('life_date', '=', batch_dict['life_date'])], context=context) |
96 | 843 | if existing_bn: # existed already, then don't need to create a new one | 844 | if existing_bn: # existed already, then don't need to create a new one |
97 | 845 | # Add comment through synchro | ||
98 | 846 | if batch_dict.get('comment'): | ||
99 | 847 | batch_obj.write(cr, uid, existing_bn[0], {'comment': batch_dict['comment']}, context=context) | ||
100 | 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." |
101 | 845 | self._logger.info(message) | 849 | self._logger.info(message) |
102 | 846 | return existing_bn[0], message | 850 | return existing_bn[0], message |
103 | 847 | 851 | ||
104 | 848 | # If not exists, then create this new batch object | 852 | # If not exists, then create this new batch object |
106 | 849 | new_bn_vals = {'name': batch_dict['name'], 'product_id': product_id, 'life_date': batch_dict['life_date']} | 853 | new_bn_vals = { |
107 | 854 | 'name': batch_dict['name'], | ||
108 | 855 | 'product_id': product_id, | ||
109 | 856 | 'life_date': batch_dict['life_date'], | ||
110 | 857 | 'comment': batch_dict.get('comment', False), # Add comment through synchro | ||
111 | 858 | } | ||
112 | 850 | message = "The new BN " + batch_dict['name'] + " has been created" | 859 | message = "The new BN " + batch_dict['name'] + " has been created" |
113 | 851 | self._logger.info(message) | 860 | self._logger.info(message) |
114 | 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) |