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

Proposed by jftempo
Status: Merged
Merged at revision: 5417
Proposed branch: lp:~dorian-kemps/unifield-server/US-5952
Merge into: lp:unifield-server
Diff against target: 429 lines (+89/-43)
13 files modified
bin/addons/msf_cross_docking/cross_docking_view.xml (+4/-4)
bin/addons/msf_outgoing/msf_outgoing.py (+2/-2)
bin/addons/msf_outgoing/msf_outgoing_view.xml (+1/-1)
bin/addons/msf_profile/data/patches.xml (+5/-0)
bin/addons/msf_profile/i18n/fr_MF.po (+12/-3)
bin/addons/msf_profile/msf_profile.py (+12/-0)
bin/addons/out_step/out_step.py (+11/-10)
bin/addons/out_step/out_step_view.xml (+2/-2)
bin/addons/stock/stock.py (+19/-1)
bin/addons/stock/stock_view.xml (+4/-4)
bin/addons/stock_override/stock.py (+3/-1)
bin/addons/stock_override/stock_view.xml (+9/-10)
bin/addons/sync_so/picking.py (+5/-5)
To merge this branch: bzr merge lp:~dorian-kemps/unifield-server/US-5952
Reviewer Review Type Date Requested Status
UniField Reviewer Team Pending
Review via email: mp+368968@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_cross_docking/cross_docking_view.xml'
2--- bin/addons/msf_cross_docking/cross_docking_view.xml 2018-11-05 10:49:58 +0000
3+++ bin/addons/msf_cross_docking/cross_docking_view.xml 2019-06-18 12:13:56 +0000
4@@ -34,20 +34,20 @@
5 <xpath expr="//tree[@string='Stock Moves']//field[@name='location_id']" position="after" >
6 <field name="product_type" invisible="1" />
7 <button name="button_cross_docking" string="Cross docking" type="object" icon="gtk-select-color"
8- attrs="{'invisible':['|', '|', '|', ('product_type', 'in', ['consu', 'service_recep']), ('allocation_setup', '=', 'unallocated'),('move_cross_docking_ok','=', True), ('state', 'in', ('done','cancel'))]}"
9+ attrs="{'invisible':['|', '|', '|', ('product_type', 'in', ['consu', 'service_recep']), ('allocation_setup', '=', 'unallocated'),('move_cross_docking_ok','=', True), ('state', 'in', ('done','delivered','cancel'))]}"
10 context="{'from_button': True}" />
11 <button name="button_stock" string="Stock" type="object" icon="gtk-media-play"
12- attrs="{'invisible':['|', '|', ('product_type', 'in', ['consu', 'service_recep']), ('move_cross_docking_ok','=', False), ('state', 'in', ('done','cancel'))]}"
13+ attrs="{'invisible':['|', '|', ('product_type', 'in', ['consu', 'service_recep']), ('move_cross_docking_ok','=', False), ('state', 'in', ('done','delivered','cancel'))]}"
14 context="{'from_button': True}" />
15 <field name="move_cross_docking_ok" invisible='1'/>
16 <field name="allocation_setup" invisible="1" />
17 </xpath>
18 <xpath expr="/form/notebook/page[@string='Products']/group/field[@name='state']" position="after" >
19 <button name="button_cross_docking_all" string="Cross docking" type="object" icon="gtk-select-color"
20- attrs="{'invisible':['|', '|', ('allocation_setup', '=', 'unallocated'), ('cross_docking_ok','=', True), ('state', 'in', ('done','cancel'))]}"
21+ attrs="{'invisible':['|', '|', ('allocation_setup', '=', 'unallocated'), ('cross_docking_ok','=', True), ('state', 'in', ('done','delivered','cancel'))]}"
22 context="{'from_button': True}" />
23 <button name="button_stock_all" string="Stock" type="object" icon="gtk-media-play"
24- attrs="{'invisible':['|', ('cross_docking_ok','=', False), ('state', 'in', ('done','cancel'))]}"
25+ attrs="{'invisible':['|', ('cross_docking_ok','=', False), ('state', 'in', ('done','delivered','cancel'))]}"
26 context="{'from_button': True}" />
27 <field name="allocation_setup" invisible="1" />
28 </xpath>
29
30=== modified file 'bin/addons/msf_outgoing/msf_outgoing.py'
31--- bin/addons/msf_outgoing/msf_outgoing.py 2019-05-10 13:59:15 +0000
32+++ bin/addons/msf_outgoing/msf_outgoing.py 2019-06-18 12:13:56 +0000
33@@ -1801,12 +1801,12 @@
34 # gather the corresponding packing and trigger the corresponding function
35 packing_ids = pick_obj.search(cr, uid, [('shipment_id', '=', shipment.id), ('state', '=', 'done')], context=context)
36 # set delivered all packings
37- pick_obj.set_delivered(cr, uid, packing_ids, context=context)
38+ # TODO: Rework after the out_step module removal
39+ pick_obj.write(cr, uid, packing_ids, {'delivered': True}, context=context)
40
41 return True
42
43
44-
45 shipment()
46
47
48
49=== modified file 'bin/addons/msf_outgoing/msf_outgoing_view.xml'
50--- bin/addons/msf_outgoing/msf_outgoing_view.xml 2019-04-02 15:58:15 +0000
51+++ bin/addons/msf_outgoing/msf_outgoing_view.xml 2019-06-18 12:13:56 +0000
52@@ -217,7 +217,7 @@
53 <group colspan="2" col="2">
54 <field name="date" readonly="1"/>
55 <field name="stock_journal_id" widget="selection" invisible="True" />
56- <field name="min_date" string="Expected Pick Date" attrs="{'readonly': [('state', 'in', ['done', 'cancel'])]}"
57+ <field name="min_date" string="Expected Pick Date" attrs="{'readonly': [('state', 'in', ['done', 'cancel', 'delivered'])]}"
58 on_change="change_min_date()" required="1" />
59 <field name="min_date_manually" invisible="1" />
60 <field name="sale_id" invisible="True" />
61
62=== modified file 'bin/addons/msf_profile/data/patches.xml'
63--- bin/addons/msf_profile/data/patches.xml 2019-04-09 12:51:41 +0000
64+++ bin/addons/msf_profile/data/patches.xml 2019-06-18 12:13:56 +0000
65@@ -416,5 +416,10 @@
66 <field name="method">us_5771_allow_all_cc_in_default_dest</field>
67 </record>
68
69+ <!-- UF14.0 -->
70+ <record id="us_5952_delivered_closed_outs_to_delivered_state" model="patch.scripts">
71+ <field name="method">us_5952_delivered_closed_outs_to_delivered_state</field>
72+ </record>
73+
74 </data>
75 </openerp>
76
77=== modified file 'bin/addons/msf_profile/i18n/fr_MF.po'
78--- bin/addons/msf_profile/i18n/fr_MF.po 2019-06-04 19:13:17 +0000
79+++ bin/addons/msf_profile/i18n/fr_MF.po 2019-06-18 12:13:56 +0000
80@@ -83812,12 +83812,14 @@
81 msgid "B7 21 88 x 125 mm"
82 msgstr "B7 21 88 x 125 mm"
83
84-#. modules: out_step, msf_outgoing, sale
85+#. modules: out_step, msf_outgoing, sale, stock_forecast, stock
86 #: view:shipment:0
87 #: view:stock.picking:0
88 #: field:stock.picking,delivered:0
89 #: selection:stock.picking,state_hidden:0
90 #: field:sale.order,shipped:0
91+#: selection:stock.picking,state:0
92+#: selection:stock.forecast.line,state:0
93 msgid "Delivered"
94 msgstr "Livré"
95
96@@ -95852,14 +95854,16 @@
97 "* Available: products reserved, simply waiting for confirmation.\n"
98 "* Available Shipped: products already shipped at supplier, simply waiting for arrival confirmation.\n"
99 "* Waiting: waiting for another move to proceed before it becomes automatically available (e.g. in Make-To-Order flows)\n"
100-"* Closed: has been processed, can't be modified or cancelled anymore\n"
101+"* Done: has been processed, can't be modified or cancelled anymore. Can still be processed to Delivered if the document is an OUT\n"
102+"* Delivered: has been delivered, only for a closed OUT\n"
103 "* Cancelled: has been cancelled, can't be confirmed anymore"
104 msgstr "* Brouillon: pas encore confirmé et ne sera pas planifié avant confirmation\n"
105 "* Confirmé: encore en attente de la disponibilité produits\n"
106 "* Disponible: produits reservé, simplement en attente de confirmation.\n"
107 "* Disponible Expédié: produits déjà envoyés au fourniseur, simplement en attente de confirmation d'arrivée.\n"
108 "* En attente: attendant l'exécution d'un autre mouvement avant de devenir automatiquement disponible (ex: flux A Commander)\n"
109-"* Fermé: a été exécuté, ne peut plus être modifié ou annulé\n"
110+"* Fermé: a été exécuté, ne peut plus être modifié ou annulé. Peut toujours être changé en Livré si le document est un OUT\n"
111+"* Livré: a été livré, seulement pour un OUT fermé\n"
112 "* Annulé: a été annulé, ne peut plus être confirmé"
113
114 #. module: delivery_mechanism
115@@ -106827,3 +106831,8 @@
116 msgid "Stop report"
117 msgstr "Arrêter le rapport"
118
119+#. module: stock
120+#: code:addons/stock/stock.py:1780
121+#, python-format
122+msgid "is delivered."
123+msgstr "est livré."
124
125=== modified file 'bin/addons/msf_profile/msf_profile.py'
126--- bin/addons/msf_profile/msf_profile.py 2019-04-09 12:51:41 +0000
127+++ bin/addons/msf_profile/msf_profile.py 2019-06-18 12:13:56 +0000
128@@ -69,6 +69,18 @@
129 err_msg,
130 )
131
132+ # UF1340
133+ def us_5952_delivered_closed_outs_to_delivered_state(self, cr, uid, *a, **b):
134+ """
135+ Set the OUT pickings in 'Done' state with delivered = True to the 'Delivered' state
136+ """
137+ cr.execute('''
138+ UPDATE stock_picking SET state = 'delivered'
139+ WHERE state = 'done' AND type = 'out' AND subtype = 'standard' AND delivered = 't'
140+ ''')
141+
142+ return True
143+
144 # UF13.0
145 def us_5771_allow_all_cc_in_default_dest(self, cr, uid, *a, **b):
146 """
147
148=== modified file 'bin/addons/out_step/out_step.py'
149--- bin/addons/out_step/out_step.py 2015-11-10 13:23:06 +0000
150+++ bin/addons/out_step/out_step.py 2019-06-18 12:13:56 +0000
151@@ -56,7 +56,7 @@
152 result[obj.id] = {}
153 for f in fields:
154 result[obj.id].update({f:False,})
155-
156+
157 # delivered_hidden
158 result[obj.id]['delivered_hidden'] = obj.delivered
159 # state_hidden
160@@ -71,11 +71,11 @@
161 'delivered_hidden': fields.function(_vals_get_out_step, method=True, type='boolean', string='Delivered Hidden', multi='get_vals_out_step',),
162 'state_hidden': fields.function(_vals_get_out_step, method=True, type='selection', selection=PICKING_STATE, string='State', multi='get_vals_out_step',),
163 }
164-
165+
166 _defaults = {
167 'delivered': False,
168 }
169-
170+
171 def copy_data(self, cr, uid, id, default=None, context=None):
172 '''
173 set delivered to False
174@@ -87,12 +87,13 @@
175 default.update(delivered=False)
176 res = super(stock_picking, self).copy_data(cr, uid, id, default=default, context=context)
177 return res
178-
179- def set_delivered(self, cr, uid, ids, context=None):
180- '''
181- set the delivered flag
182- '''
183- self.write(cr, uid, ids, {'delivered': True,}, context=context)
184- return True
185+
186+ # TODO: Remove after full implamentation of 'Delivered' state
187+ # def set_delivered(self, cr, uid, ids, context=None):
188+ # '''
189+ # set the delivered flag
190+ # '''
191+ # self.write(cr, uid, ids, {'delivered': True,}, context=context)
192+ # return True
193
194 stock_picking()
195
196=== modified file 'bin/addons/out_step/out_step_view.xml'
197--- bin/addons/out_step/out_step_view.xml 2016-11-04 12:57:37 +0000
198+++ bin/addons/out_step/out_step_view.xml 2019-06-18 12:13:56 +0000
199@@ -39,8 +39,8 @@
200
201 <filter name="done" position="replace">
202 <!-- <separator orientation="vertical"/> -->
203- <filter icon="terp-dialog-close" name="done" string="Closed" domain="[('state','=','done'), ('delivered', '=', False)]" help="Delivery orders already processed"/>
204- <filter icon="gtk-yes" name="delivered" string="Delivered" domain="[('state', '=', 'done'), ('delivered', '=', True)]" help="Delivered Delivery Orders" />
205+ <filter icon="terp-dialog-close" name="done" string="Closed" domain="[('state','=','done')]" help="Delivery orders already processed"/>
206+ <filter icon="gtk-yes" name="delivered" string="Delivered" domain="[('state', '=', 'delivered')]" help="Delivered Delivery Orders" />
207 <!-- <filter icon="gtk-no" name="not_delivered" string="Not Delivered" domain="[('state', '=', 'done'), ('delivered', '=', False)]" help="Not Delivered Delivery Orders" /> -->
208 <separator orientation="vertical"/>
209 </filter>
210
211=== modified file 'bin/addons/stock/stock.py'
212--- bin/addons/stock/stock.py 2019-05-10 14:40:57 +0000
213+++ bin/addons/stock/stock.py 2019-06-18 12:13:56 +0000
214@@ -680,13 +680,15 @@
215 ('confirmed', 'Confirmed'),
216 ('assigned', 'Available'),
217 ('done', 'Done'),
218+ ('delivered', 'Delivered'),
219 ('cancel', 'Cancelled'),
220 ], 'State', readonly=True, select=True,
221 help="* Draft: not confirmed yet and will not be scheduled until confirmed\n"\
222 "* Confirmed: still waiting for the availability of products\n"\
223 "* Available: products reserved, simply waiting for confirmation.\n"\
224 "* Waiting: waiting for another move to proceed before it becomes automatically available (e.g. in Make-To-Order flows)\n"\
225- "* Done: has been processed, can't be modified or cancelled anymore\n"\
226+ "* Done: has been processed, can't be modified or cancelled anymore. Can be processed to Delivered if the document is an OUT\n"\
227+ "* Delivered: has been delivered, only for a closed OUT\n"\
228 "* Cancelled: has been cancelled, can't be confirmed anymore"),
229 'min_date': fields.function(get_min_max_date, fnct_inv=_set_minimum_date, multi="min_max_date",
230 method=True, store=True, type='datetime', string='Expected Date', select=1, help="Expected date for the picking to be processed"),
231@@ -1775,6 +1777,7 @@
232 'assigned': _('is ready to process.'),
233 'cancel': _('is cancelled.'),
234 'done': _('is done.'),
235+ 'delivered': _('is delivered.'),
236 'draft':_('is in draft state.'),
237 }
238 state_list = self._hook_state_list(cr, uid, state_list=state_list, msg=msg)
239@@ -1794,8 +1797,23 @@
240 self.infolog(cr, uid, message)
241 return True
242
243+ def set_delivered(self, cr, uid, ids, context=None):
244+ '''
245+ Set the picking and its moves to delivered
246+ '''
247+ if context is None:
248+ context = {}
249+ if isinstance(ids, (int, long)):
250+ ids = [ids]
251+
252+ self.write(cr, uid, ids, {'state': 'delivered'}, context=context)
253+
254+ return True
255+
256+
257 stock_picking()
258
259+
260 class stock_production_lot(osv.osv):
261
262 def name_get(self, cr, uid, ids, context=None):
263
264=== modified file 'bin/addons/stock/stock_view.xml'
265--- bin/addons/stock/stock_view.xml 2019-05-24 14:05:06 +0000
266+++ bin/addons/stock/stock_view.xml 2019-06-18 12:13:56 +0000
267@@ -849,7 +849,7 @@
268 <button name="action_assign" states="confirmed" string="Check Availability" type="object" icon="gtk-find"/>
269 <button name="force_assign" states="confirmed" string="Force Availability" type="object" icon="gtk-jump-to"/>
270 <button name="action_process" states="assigned" string="Process" groups="stock.group_stock_user" type="object" icon="gtk-go-forward"/>
271- <button name="%(action_stock_invoice_onshipping)d" string="Create Invoice" attrs="{'invisible': ['|','|',('state','&lt;&gt;','done'),('invoice_state','=','invoiced'),('invoice_state','=','none')]}" type="action" icon="terp-gtk-go-back-rtl" />
272+ <button name="%(action_stock_invoice_onshipping)d" string="Create Invoice" attrs="{'invisible': ['|','|',('state','!=', 'done'),('invoice_state','=','invoiced'),('invoice_state','=','none')]}" type="action" icon="terp-gtk-go-back-rtl" />
273 </group>
274 </page>
275 <page string="Additional info" groups="base.group_extended,base.group_multi_company">
276@@ -913,7 +913,7 @@
277 <field name="type">tree</field>
278 <field name="priority">21</field>
279 <field name="arch" type="xml">
280- <tree colors="blue:state in ('draft');grey:state in ('cancel');red:state not in ('cancel', 'done') and date &lt; current_date" string="Delivery Orders">
281+ <tree colors="blue:state in ('draft');grey:state in ('cancel');red:state not in ('cancel', 'done', 'delivered') and date &lt; current_date" string="Delivery Orders">
282 <field name="name"/>
283 <field name="partner_id"/>
284 <field name="destinations_list"/>
285@@ -1045,7 +1045,7 @@
286 <button name="force_assign" states="confirmed" string="Force Availability" type="object" icon="gtk-jump-to"/>
287 <button name="action_process" states="assigned" string="Process" type="object" icon="gtk-go-forward"/>
288 <button name="%(act_stock_return_picking)d" string="Return Products" states="done" type="action" icon="gtk-execute"/>
289- <button name="%(action_stock_invoice_onshipping)d" string="Create Invoice" attrs="{'invisible': ['|','|',('state','&lt;&gt;','done'),('invoice_state','=','invoiced'),('invoice_state','=','none')]}" type="action" icon="terp-gtk-go-back-rtl"/>
290+ <button name="%(action_stock_invoice_onshipping)d" string="Create Invoice" attrs="{'invisible': ['|','|',('state','not in',['done','delivered']),('invoice_state','=','invoiced'),('invoice_state','=','none')]}" type="action" icon="terp-gtk-go-back-rtl"/>
291 </group>
292 </page>
293 <page string="Additional info" groups="base.group_extended,base.group_multi_company">
294@@ -1271,7 +1271,7 @@
295 <group colspan="1" states="done">
296 <button name="%(act_stock_return_picking)d" string="Return Products" states="done" type="action" icon="gtk-execute"/>
297 </group>
298- <button states="done" name="%(action_stock_invoice_onshipping)d" string="Create Invoice" attrs="{'invisible': ['|','|',('state','&lt;&gt;','done'),('invoice_state','=','invoiced'),('invoice_state','=','none')]}" type="action" icon="terp-gtk-go-back-rtl" />
299+ <button states="done,delivered" name="%(action_stock_invoice_onshipping)d" string="Create Invoice" attrs="{'invisible': ['|','|',('state','!=','done'),('invoice_state','=','invoiced'),('invoice_state','=','none')]}" type="action" icon="terp-gtk-go-back-rtl" />
300 </group>
301 </page>
302 <page string="Additional Info" groups="base.group_extended,base.group_multi_company">
303
304=== modified file 'bin/addons/stock_override/stock.py'
305--- bin/addons/stock_override/stock.py 2019-05-10 14:31:04 +0000
306+++ bin/addons/stock_override/stock.py 2019-06-18 12:13:56 +0000
307@@ -305,6 +305,7 @@
308 ('shipped', 'Available Shipped'), # UF-1617: new state of IN for partial shipment
309 ('updated', 'Available Updated'),
310 ('done', 'Closed'),
311+ ('delivered', 'Delivered'),
312 ('cancel', 'Cancelled'),
313 ('import', 'Import in progress'),
314 ], 'State', readonly=True, select=True,
315@@ -313,7 +314,8 @@
316 "* Available: products reserved, simply waiting for confirmation.\n"\
317 "* Available Shipped: products already shipped at supplier, simply waiting for arrival confirmation.\n"\
318 "* Waiting: waiting for another move to proceed before it becomes automatically available (e.g. in Make-To-Order flows)\n"\
319- "* Closed: has been processed, can't be modified or cancelled anymore\n"\
320+ "* Closed: has been processed, can't be modified or cancelled anymore. Can still be processed to Delivered if the document is an OUT\n"
321+ "* Delivered: has been delivered, only for a closed OUT\n"\
322 "* Cancelled: has been cancelled, can't be confirmed anymore"),
323 'address_id': fields.many2one('res.partner.address', 'Delivery address', help="Address of partner", readonly=False, states={'done': [('readonly', True)], 'cancel': [('readonly', True)]}, domain="[('partner_id', '=', partner_id)]"),
324 'partner_id2': fields.many2one('res.partner', 'Partner', required=False),
325
326=== modified file 'bin/addons/stock_override/stock_view.xml'
327--- bin/addons/stock_override/stock_view.xml 2019-05-07 09:15:36 +0000
328+++ bin/addons/stock_override/stock_view.xml 2019-06-18 12:13:56 +0000
329@@ -381,7 +381,7 @@
330 <field name="inactive_error" attrs="{'invisible': [('inactive_product', '=', False)]}" />
331 <button name="call_cancel_wizard" icon="gtk-del" string="Cancel &amp; Resource" type="object"
332 confirm="Do you really want to delete selected record ?"
333- attrs="{'invisible': ['|', ('from_wkf', '=', False), ('fake_state', 'in', ('cancel', 'done'))]}"
334+ attrs="{'invisible': ['|', ('from_wkf', '=', False), ('fake_state', 'in', ('cancel', 'done'))]}"
335 context="{'from_int': 1, 'from_button': True}"/>
336 </tree>
337
338@@ -489,7 +489,7 @@
339 <button name="action_process" states="assigned" string="Process" type="object" icon="gtk-go-forward" context="{'from_button': True}"/>
340 <field name="certificate_donation" invisible="1"/>
341 <button name="print_certificate" string="Print certificate" type="object" icon="gtk-print" attrs="{'invisible': [('certificate_donation', '=', False)]}"/>
342- <button name="%(stock.action_stock_invoice_onshipping)d" string="Create Invoice" attrs="{'invisible': ['|','|',('state','&lt;&gt;','done'),('invoice_state','=','invoiced'),('invoice_state','=','none')]}" type="action" icon="terp-gtk-go-back-rtl"/>
343+ <button name="%(stock.action_stock_invoice_onshipping)d" string="Create Invoice" attrs="{'invisible': ['|','|',('state','!=','done'),('invoice_state','=','invoiced'),('invoice_state','=','none')]}" type="action" icon="terp-gtk-go-back-rtl"/>
344 </group>
345 </page>
346 <page string="Additional info">
347@@ -759,7 +759,7 @@
348 <group colspan="1" states="done">
349 <button name="%(stock.act_stock_return_picking)d" string="Return Products" states="done" type="action" icon="gtk-execute"/>
350 </group>
351- <button states="done" name="%(stock.action_stock_invoice_onshipping)d" string="Create Invoice" attrs="{'invisible': ['|','|',('state','&lt;&gt;','done'),('invoice_state','=','invoiced'),('invoice_state','=','none')]}" type="action" icon="terp-gtk-go-back-rtl"/>
352+ <button states="done" name="%(stock.action_stock_invoice_onshipping)d" string="Create Invoice" attrs="{'invisible': ['|','|',('state','!=','done'),('invoice_state','=','invoiced'),('invoice_state','=','none')]}" type="action" icon="terp-gtk-go-back-rtl"/>
353 </group>
354 </page>
355 <page string="Additional Info">
356@@ -880,7 +880,7 @@
357 </group>
358 <group colspan="2" col="2">
359 <field name="date" attrs="{'readonly': [('state', 'not in', ['draft', 'auto', 'assigned', 'confirmed'])]}"/>
360- <field name="min_date" string="Expected Shipped Date" attrs="{'readonly': [('state', 'in', ['done', 'cancel'])]}"
361+ <field name="min_date" string="Expected Shipped Date" attrs="{'readonly': [('state', 'in', ['done', 'cancel', 'delivered'])]}"
362 on_change="change_min_date()" required="1" />
363 <field name="min_date_manually" invisible="1" />
364 <field name="warehouse_id"
365@@ -1021,16 +1021,15 @@
366 </field>
367 <group col="12" colspan="4">
368 <field name="state" invisible="True"/>
369- <field name="delivered" invisible="True"/>
370 <field name="state_hidden"/>
371 <field name="is_company" invisible="1" />
372 <button name="set_delivered"
373 icon="gtk-apply"
374 type="object"
375 string="Confirm Delivery"
376- attrs="{'invisible': ['|', '|', '|', '|', '|',
377+ attrs="{'invisible': ['|', '|', '|', '|',
378 ('type', '!=', 'out'), ('subtype', '!=', 'standard'),
379- ('state', '!=', 'done'), ('delivered', '=', True),
380+ ('state', '!=', 'done'),
381 ('partner_type', 'not in', ['internal', 'intermission', 'section']),
382 ('is_company', '=', True),
383 ]}"
384@@ -1040,9 +1039,9 @@
385 icon="gtk-apply"
386 type="object"
387 string="Confirm Delivery"
388- attrs="{'invisible': ['|', '|', '|', '|',
389+ attrs="{'invisible': ['|', '|', '|',
390 ('type', '!=', 'out'), ('subtype', '!=', 'standard'),
391- ('state', '!=', 'done'), ('delivered', '=', True),
392+ ('state', '!=', 'done'),
393 '&amp;',
394 ('partner_type', 'in', ['internal', 'intermission', 'section']),
395 ('is_company', '=', False),
396@@ -1058,7 +1057,7 @@
397 <field name="certificate_donation" invisible="1"/>
398 <button name="print_certificate" string="Print certificate" type="object" icon="gtk-print" attrs="{'invisible': [('certificate_donation', '=', False)]}"/>
399 <button name="%(stock.act_stock_return_picking)d" string="Return Products" states="done" type="action" icon="gtk-execute"/>
400- <button name="%(stock.action_stock_invoice_onshipping)d" string="Create Invoice" attrs="{'invisible': ['|','|',('state','&lt;&gt;','done'),('invoice_state','=','invoiced'),('invoice_state','=','none')]}" type="action" icon="terp-gtk-go-back-rtl"/>
401+ <button name="%(stock.action_stock_invoice_onshipping)d" string="Create Invoice" attrs="{'invisible': ['|','|',('state','not in',['done','delivered']),('invoice_state','=','invoiced'),('invoice_state','=','none')]}" type="action" icon="terp-gtk-go-back-rtl"/>
402 </group>
403 </page>
404 <page string="Additional info">
405
406=== modified file 'bin/addons/sync_so/picking.py'
407--- bin/addons/sync_so/picking.py 2018-06-08 14:22:21 +0000
408+++ bin/addons/sync_so/picking.py 2019-06-18 12:13:56 +0000
409@@ -741,15 +741,15 @@
410 return "Recovery: the reference to " + in_name + " at " + source + " will be set to void."
411
412 elif 'OUT' in out_doc_name:
413- ship_ids = self.search(cr, uid, [('name', '=', out_doc_name), ('state', '=', 'done')], context=context)
414- if ship_ids:
415+ out_ids = self.search(cr, uid, [('name', '=', out_doc_name), ('state', '=', 'done')], context=context)
416+ if out_ids:
417 # set the Shipment to become delivered
418 context['InShipOut'] = "OUT" # asking OUT object to be logged (model stock.picking)
419- self.set_delivered(cr, uid, ship_ids, context=context)
420+ self.set_delivered(cr, uid, out_ids, context=context)
421 message = "The OUTcoming " + out_doc_name + " has been well delivered to its partner " + source + ": " + out_info.name
422 else:
423- ship_ids = self.search(cr, uid, [('name', '=', out_doc_name), ('state', '=', 'delivered')], context=context)
424- if ship_ids:
425+ out_ids = self.search(cr, uid, [('name', '=', out_doc_name), ('state', '=', 'delivered')], context=context)
426+ if out_ids:
427 message = "The OUTcoming " + out_doc_name + " has been MANUALLY confirmed as delivered."
428 elif context.get('restore_flag'):
429 # UF-1830: Create a message to remove the invalid reference to the inexistent document

Subscribers

People subscribed via source and target branches