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

Proposed by jftempo
Status: Merged
Merged at revision: 6288
Proposed branch: lp:~dorian-kemps/unifield-server/US-7388
Merge into: lp:unifield-server
Diff against target: 216 lines (+56/-15)
5 files modified
bin/addons/msf_profile/i18n/fr_MF.po (+10/-0)
bin/addons/sales_followup/report/ir_follow_up_location_report.py (+20/-5)
bin/addons/sales_followup/report/ir_follow_up_location_report.rml (+5/-5)
bin/addons/sales_followup/report/ir_follow_up_location_report_xls.mako (+13/-5)
bin/addons/stock_override/stock.py (+8/-0)
To merge this branch: bzr merge lp:~dorian-kemps/unifield-server/US-7388
Reviewer Review Type Date Requested Status
UniField Reviewer Team Pending
Review via email: mp+426541@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
1=== modified file 'bin/addons/msf_profile/i18n/fr_MF.po'
2--- bin/addons/msf_profile/i18n/fr_MF.po 2022-06-27 08:45:20 +0000
3+++ bin/addons/msf_profile/i18n/fr_MF.po 2022-07-08 07:47:57 +0000
4@@ -101972,6 +101972,16 @@
5 msgstr "Picking/Out lié"
6
7 #. module: stock_override
8+#: help:stock.move,from_pick_move_cancel_id:0
9+msgid "Move from Picking or Out that created that Internal Move after cancellation"
10+msgstr "Mouvement de Picking ou Out qui a créé ce Mouvement Interne après annulation"
11+
12+#. module: stock_override
13+#: field:stock.move,from_pick_move_cancel_id:0
14+msgid "Linked Picking/Out move"
15+msgstr "Mouvement Picking/Out lié"
16+
17+#. module: stock_override
18 #: field:stock.move.cancel.wizard,is_move_from_cross_docking:0
19 msgid "Is the move from the Cross docking Location ?"
20 msgstr "Est-ce que le mouvement vient de la Zone de Transbordement ?"
21
22=== modified file 'bin/addons/sales_followup/report/ir_follow_up_location_report.py'
23--- bin/addons/sales_followup/report/ir_follow_up_location_report.py 2021-12-16 15:03:07 +0000
24+++ bin/addons/sales_followup/report/ir_follow_up_location_report.py 2022-07-08 07:47:57 +0000
25@@ -205,6 +205,7 @@
26 data = {
27 'state': line.state,
28 'state_display': line_state_display_dict.get(line.state_to_display),
29+ 'cancelled_move': move.state in ('cancel', 'cancel_r')
30 }
31 m_type = move.state in ('cancel', 'cancel_r') or move.product_qty != 0.00 and move.picking_id.type == 'out'
32 ppl = move.picking_id.subtype == 'packing' and move.picking_id.shipment_id and not self._is_returned(move)
33@@ -223,8 +224,21 @@
34 line.product_uom.id,
35 )
36 delivery_order = move.picking_id.name
37- if move.picking_id.state not in ('done', 'delivered'):
38+ if move.state != 'done':
39 delivery_order = '-'
40+ # Search if there is an INT created from the cancellation, even if it is not closed
41+ if move.state in ('cancel', 'cancel_r') and not from_stock:
42+ self.cr.execute("""
43+ SELECT p.name FROM stock_move m
44+ LEFT JOIN stock_picking p ON m.picking_id = p.id
45+ LEFT JOIN purchase_order_line pl ON m.purchase_line_id = pl.id
46+ LEFT JOIN sale_order_line sl ON pl.linked_sol_id = sl.id
47+ WHERE p.type = 'internal' AND p.subtype = 'standard' AND from_pick_move_cancel_id = %s
48+ LIMIT 1
49+ """, (move.id,))
50+ int_cancel_info = self.cr.fetchone()
51+ if int_cancel_info:
52+ delivery_order = int_cancel_info[0]
53 data.update({
54 'po_name': po_name,
55 'edd': edd,
56@@ -266,8 +280,8 @@
57 'packing': packing,
58 'shipment': shipment,
59 'is_delivered': is_delivered,
60- 'delivered_qty': (is_shipment_done or is_delivered) and move.product_qty or 0.00,
61- 'delivered_uom': (is_shipment_done or is_delivered) and move.product_uom.name or '-',
62+ 'delivered_qty': move.state == 'cancel' and 'N/A' or (is_shipment_done or is_delivered) and move.product_qty or 0.00,
63+ 'delivered_uom': move.product_uom.name or '-',
64 'backordered_qty': not is_shipment_done and not is_delivered and line.order_id.state != 'cancel' and move.product_qty or 0.00,
65 'rts': move.picking_id.shipment_id and move.picking_id.shipment_id.shipment_expected_date[0:10],
66 'eta': eta and eta.strftime('%Y-%m-%d'),
67@@ -311,7 +325,7 @@
68 data.update({
69 'packing': packing,
70 'delivered_qty': is_shipment_done and move.product_qty or 0.00,
71- 'delivered_uom': is_shipment_done and move.product_uom.name or '-',
72+ 'delivered_uom': move.product_uom.name or '-',
73 'rts': line.order_id.ready_to_ship_date,
74 'shipment': shipment,
75 })
76@@ -363,6 +377,7 @@
77 data = {
78 'state': line.state,
79 'state_display': line_state_display_dict.get(line.state_to_display),
80+ 'cancelled_move': False,
81 'line_number': line.line_number,
82 'line_comment': line.comment or '-',
83 'po_name': po_name,
84@@ -372,7 +387,7 @@
85 'ordered_qty': line.product_uom_qty,
86 'rts': line.order_id.state not in ('draft', 'validated', 'cancel') and line.order_id.ready_to_ship_date,
87 'delivered_qty': received_qty,
88- 'delivered_uom': received_qty and line.product_uom.name or '-',
89+ 'delivered_uom': line.product_uom.name or '-',
90 'delivery_order': int_name or '-',
91 'backordered_qty': line.order_id.state != 'cancel' and line.product_uom_qty - received_qty or 0.00,
92 'edd': edd,
93
94=== modified file 'bin/addons/sales_followup/report/ir_follow_up_location_report.rml'
95--- bin/addons/sales_followup/report/ir_follow_up_location_report.rml 2021-12-17 10:00:53 +0000
96+++ bin/addons/sales_followup/report/ir_follow_up_location_report.rml 2022-07-08 07:47:57 +0000
97@@ -295,17 +295,17 @@
98 <para style="LinesGrey">[[ line.get('state') in ['cancel', 'cancel_r'] and line.get('uom_id', '-') or removeParentNode('para') ]]</para>
99 </td>
100 <td>
101- <para style="LinesBlue">[[ line.get('state') not in ['cancel', 'cancel_r'] and formatLang(line.get('delivered_qty', 0.00)) or removeParentNode('para') ]]</para>
102- <para style="LinesGrey">[[ line.get('state') in ['cancel', 'cancel_r'] and formatLang(line.get('delivered_qty', 0.00)) or removeParentNode('para') ]]</para>
103+ <para style="LinesBlue">[[ line.get('state') not in ['cancel', 'cancel_r'] and (line.get('cancelled_move') and 'N/A' or formatLang(line.get('delivered_qty', 0.00))) or removeParentNode('para') ]]</para>
104+ <para style="LinesGrey">[[ line.get('state') in ['cancel', 'cancel_r'] and (line.get('cancelled_move') and 'N/A' or formatLang(line.get('delivered_qty', 0.00))) or removeParentNode('para') ]]</para>
105 </td>
106 <td>
107 <para style="LinesBlue">[[ line.get('state') not in ['cancel', 'cancel_r'] and line.get('delivered_uom', '-') or removeParentNode('para') ]]</para>
108 <para style="LinesGrey">[[ line.get('state') in ['cancel', 'cancel_r'] and line.get('delivered_uom', '-') or removeParentNode('para') ]]</para>
109 </td>
110 <td>
111- <para style="LinesBlue">[[ line.get('state') not in ['cancel', 'cancel_r'] and (line.get('extra_qty', 0) == 0 and formatLang(line.get('backordered_qty', 0.00)) or removeParentNode('para')) or removeParentNode('para') ]]</para>
112- <para style="LinesBlue">[[ line.get('state') not in ['cancel', 'cancel_r'] and (line.get('extra_qty', 0) and formatLang(line.get('backordered_qty', 0.00)) or removeParentNode('para')) or removeParentNode('para') ]] (+[[ formatLang(abs(line.get('extra_qty', 0.00))) ]])</para>
113- <para style="LinesGrey">[[ line.get('state') in ['cancel', 'cancel_r'] and '-' or removeParentNode('para') ]]</para>
114+ <para style="LinesBlue">[[ line.get('state') not in ['cancel', 'cancel_r'] and (line.get('extra_qty', 0) == 0 and (line.get('cancelled_move') and '0.00' or formatLang(line.get('backordered_qty', 0.00))) or removeParentNode('para')) or removeParentNode('para') ]]</para>
115+ <para style="LinesBlue">[[ line.get('state') not in ['cancel', 'cancel_r'] and (line.get('extra_qty', 0) and (line.get('cancelled_move') and '0.00' or formatLang(line.get('backordered_qty', 0.00))) or removeParentNode('para')) or removeParentNode('para') ]] (+[[ formatLang(abs(line.get('extra_qty', 0.00))) ]])</para>
116+ <para style="LinesGrey">[[ line.get('state') in ['cancel', 'cancel_r'] and (line.get('cancelled_move') and '0.00' or '-') or removeParentNode('para') ]]</para>
117 </td>
118 <td>
119 <para style="LinesBlue">[[ line.get('state') not in ['cancel', 'cancel_r'] and line.get('delivery_order', '-') or removeParentNode('para') ]]</para>
120
121=== modified file 'bin/addons/sales_followup/report/ir_follow_up_location_report_xls.mako'
122--- bin/addons/sales_followup/report/ir_follow_up_location_report_xls.mako 2021-12-17 10:00:53 +0000
123+++ bin/addons/sales_followup/report/ir_follow_up_location_report_xls.mako 2022-07-08 07:47:57 +0000
124@@ -378,14 +378,18 @@
125 <Cell ss:StyleID="line_left_grey"><Data ss:Type="String">N/A</Data></Cell>
126 % endif
127 <Cell ss:StyleID="line_left_grey"><Data ss:Type="String">${line.get('uom_id', '-')|x}</Data></Cell>
128- % if line.get('delivered_qty'):
129+ % if line.get('delivered_qty') or not line.get('cancelled_move'):
130 <Cell ss:StyleID="line_right_grey"><Data ss:Type="Number">${line.get('delivered_qty')}</Data></Cell>
131 % else:
132 <Cell ss:StyleID="line_left_grey"><Data ss:Type="String">N/A</Data></Cell>
133 % endif
134 <Cell ss:StyleID="line_left_grey"><Data ss:Type="String">${line.get('delivered_uom', '')|x}</Data></Cell>
135 <Cell ss:StyleID="line_left_grey"><Data ss:Type="String">${line.get('delivery_order', '')|x}</Data></Cell>
136+ % if line.get('cancelled_move'):
137+ <Cell ss:StyleID="line_right_grey"><Data ss:Type="Number">0.00</Data></Cell>
138+ % else:
139 <Cell ss:StyleID="line_left_grey"><Data ss:Type="String">-</Data></Cell>
140+ % endif
141 % if line.get('edd'):
142 % if isDate(line['edd']):
143 % if getLang() == 'fr_MF':
144@@ -457,17 +461,21 @@
145 <Cell ss:StyleID="line_left"><Data ss:Type="String">N/A</Data></Cell>
146 % endif
147 <Cell ss:StyleID="line_left"><Data ss:Type="String">${line.get('uom_id', '-')|x}</Data></Cell>
148- % if line.get('delivered_qty'):
149+ % if line.get('delivered_qty') and not line.get('cancelled_move'):
150 <Cell ss:StyleID="line_right"><Data ss:Type="Number">${line.get('delivered_qty')}</Data></Cell>
151 % else:
152 <Cell ss:StyleID="line_left"><Data ss:Type="String">N/A</Data></Cell>
153 % endif
154 <Cell ss:StyleID="line_left"><Data ss:Type="String">${line.get('delivered_uom', '')|x}</Data></Cell>
155 <Cell ss:StyleID="line_left"><Data ss:Type="String">${line.get('delivery_order', '')|x}</Data></Cell>
156- % if line.get('extra_qty', False):
157- <Cell ss:StyleID="line_left"><Data ss:Type="String">${line.get('backordered_qty', 0.00)} (+${line.get('extra_qty', 0.00)|x})</Data></Cell>
158+ % if not line.get('cancelled_move'):
159+ % if line.get('extra_qty', False):
160+ <Cell ss:StyleID="line_left"><Data ss:Type="String">${line.get('backordered_qty', 0.00)} (+${line.get('extra_qty', 0.00)|x})</Data></Cell>
161+ % else:
162+ <Cell ss:StyleID="line_right"><Data ss:Type="Number">${line.get('backordered_qty')}</Data></Cell>
163+ % endif
164 % else:
165- <Cell ss:StyleID="line_right"><Data ss:Type="Number">${line.get('backordered_qty')}</Data></Cell>
166+ <Cell ss:StyleID="line_right"><Data ss:Type="Number">0.00</Data></Cell>
167 % endif
168 % if line.get('cdd'):
169 % if isDate(line['cdd']):
170
171=== modified file 'bin/addons/stock_override/stock.py'
172--- bin/addons/stock_override/stock.py 2022-04-14 10:10:19 +0000
173+++ bin/addons/stock_override/stock.py 2022-07-08 07:47:57 +0000
174@@ -1149,6 +1149,8 @@
175 },
176 ),
177 'linked_incoming_move': fields.many2one('stock.move', 'Linked Incoming move', readonly=True, help="Link between INT and IN"),
178+ 'from_pick_move_cancel_id': fields.many2one('stock.move', string='Linked Picking/Out move', readonly=True,
179+ help='Move from Picking or Out that created that Internal Move after cancellation'),
180 }
181
182 _defaults = {
183@@ -1158,6 +1160,7 @@
184 'inactive_error': lambda *a: '',
185 'has_to_be_resourced': False,
186 'is_ext_cu': _default_is_ext_cu,
187+ 'from_pick_move_cancel_id': False,
188 }
189
190 @check_rw_warning
191@@ -1556,6 +1559,9 @@
192 if not 'sync_dpo' in default:
193 default['sync_dpo'] = False
194
195+ if not 'from_pick_move_cancel_id' in default:
196+ default['from_pick_move_cancel_id'] = False
197+
198 return super(stock_move, self).copy_data(cr, uid, id, default, context=context)
199
200 def check_product_quantity(self, cr, uid, ids, context=None):
201@@ -2190,6 +2196,7 @@
202 'prodlot_id': move.prodlot_id and move.prodlot_id.id or False,
203 'expired_date': move.expired_date or False,
204 'reason_type_id': int_reason_type_id,
205+ 'from_pick_move_cancel_id': move.id,
206 }
207 move_obj.create(cr, uid, m_data, context=context)
208
209@@ -2443,6 +2450,7 @@
210 'prodlot_id': m.prodlot_id and m.prodlot_id.id or False,
211 'expired_date': m.expired_date or False,
212 'reason_type_id': int_reason_type_id,
213+ 'from_pick_move_cancel_id': m.id,
214 }
215 move_obj.create(cr, uid, m_data, context=context)
216 moves_ids_to_cancel.append(m.id)

Subscribers

People subscribed via source and target branches