Merge lp:~jfb-tempo-consulting/unifield-server/US-8310 into lp:unifield-server

Proposed by jftempo
Status: Needs review
Proposed branch: lp:~jfb-tempo-consulting/unifield-server/US-8310
Merge into: lp:unifield-server
Diff against target: 83 lines (+25/-14)
2 files modified
bin/addons/msf_profile/i18n/fr_MF.po (+8/-3)
bin/addons/purchase/purchase_workflow.py (+17/-11)
To merge this branch: bzr merge lp:~jfb-tempo-consulting/unifield-server/US-8310
Reviewer Review Type Date Requested Status
UniField Reviewer Team Pending
Review via email: mp+398456@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 2021-02-05 16:30:31 +0000
3+++ bin/addons/msf_profile/i18n/fr_MF.po 2021-02-22 14:05:02 +0000
4@@ -15957,8 +15957,8 @@
5 #. module: purchase
6 #: code:addons/purchase/purchase_workflow.py:677
7 #, python-format
8-msgid "Line %s: Please choose a product before confirming the line"
9-msgstr "Ligne %s: Veuillez choisir un produit avant de confirmer la ligne"
10+msgid "Line #%s: Please choose a product before confirming the line."
11+msgstr "Ligne #%s: Veuillez choisir un produit avant de confirmer la ligne."
12
13 #. module: base_setup
14 #: view:base.setup.installer:0
15@@ -39401,11 +39401,16 @@
16
17 #. module: purchase
18 #: code:addons/purchase/purchase_order_line.py:1654
19-#: code:addons/purchase/purchase_workflow.py:673
20 #, python-format
21 msgid "Delivery Confirmed Date is a mandatory field."
22 msgstr "La Date de Livraison Confirmée est un champ obligatoire."
23
24+#. module: purchase
25+#: code:addons/purchase/purchase_workflow.py:673
26+#, python-format
27+msgid "Line #%s: Delivery Confirmed Date is a mandatory field."
28+msgstr "Ligne #%s: La Date de Livraison Confirmée est un champ obligatoire."
29+
30 #. module: stock_schedule
31 #: selection:stock.frequence,recurrence_type:0
32 msgid "Week(s)"
33
34=== modified file 'bin/addons/purchase/purchase_workflow.py'
35--- bin/addons/purchase/purchase_workflow.py 2021-02-15 08:43:34 +0000
36+++ bin/addons/purchase/purchase_workflow.py 2021-02-22 14:05:02 +0000
37@@ -744,11 +744,10 @@
38
39 for pol in self.browse(cr, uid, ids):
40 if not pol.confirmed_delivery_date:
41- raise osv.except_osv(_('Error'), _('Delivery Confirmed Date is a mandatory field.'))
42+ raise osv.except_osv(_('Error'), _('Line #%s: Delivery Confirmed Date is a mandatory field.') % pol.line_number)
43
44- if not pol.product_id and pol.linked_sol_id and not pol.linked_sol_id.order_id.procurement_request:
45- # PO nomen (PROJ) => FO (nomen COO)
46- raise osv.except_osv(_('Error'), _('Line %s: Please choose a product before confirming the line') % pol.line_number)
47+ if not pol.product_id:
48+ raise osv.except_osv(_('Error'), _('Line #%s: Please choose a product before confirming the line.') % pol.line_number)
49
50 sourced_on_dpo = pol.from_dpo_line_id
51
52@@ -958,18 +957,25 @@
53 if isinstance(ids, (int, long)):
54 ids = [ids]
55
56+ pol_obj = self.pool.get('purchase.order.line')
57 for po in self.browse(cr, uid, ids, context=context):
58- pol_ids_to_confirm = []
59+ # raise asap
60 if po.partner_type == 'esc':
61- pol_ids = self.pool.get('purchase.order.line').search(cr, uid, [('order_id', '=', po.id), ('state', 'in', ['validated', 'validated_p']), ('stock_take_date', '=', False)], context=context)
62+ pol_ids = pol_obj.search(cr, uid, [('order_id', '=', po.id), ('state', 'in', ['validated', 'validated_n']), ('stock_take_date', '=', False)], context=context)
63 if pol_ids:
64- pol_line = self.pool.get('purchase.order.line').read(cr, uid, pol_ids, ['line_number'], context=context)
65+ pol_line = pol_obj.read(cr, uid, pol_ids, ['line_number'], context=context)
66 raise osv.except_osv(_('Error'), _('Line %s: Date of Stock Take is required for PO to ESC') % ', '.join(['#%s'%x['line_number'] for x in pol_line]))
67
68- for pol in po.order_line:
69- if pol.state not in ('cancel', 'cancel_r') and not pol.confirmed_delivery_date:
70- raise osv.except_osv(_('Error'), _('Line #%s: Delivery Confirmed Date is a mandatory field.') % pol.line_number)
71- pol_ids_to_confirm.append(pol.id)
72+ pol_ids_to_confirm = pol_obj.search(cr, uid, [('order_id', '=', po.id), ('state', 'not in', ['cancel', 'cancel_r'])], context=context)
73+ missing_cdd = pol_obj.search(cr, uid, [('confirmed_delivery_date', '=', False), ('id', 'in', pol_ids_to_confirm)], limit=1, context=context)
74+ if missing_cdd:
75+ pol_line = pol_obj.read(cr, uid, missing_cdd, ['line_number'], context=context)
76+ raise osv.except_osv(_('Error'), _('Line #%s: Delivery Confirmed Date is a mandatory field.') % pol_line[0]['line_number'])
77+
78+ missing_prod = pol_obj.search(cr, uid, [('product_id', '=', False), ('id', 'in', pol_ids_to_confirm)], limit=1, context=context)
79+ if missing_prod:
80+ pol_line = pol_obj.read(cr, uid, missing_prod, ['line_number'], context=context)
81+ raise osv.except_osv(_('Error'), _('Line #%s: Please choose a product before confirming the line.') % pol_line[0]['line_number'])
82
83 return self.pool.get('purchase.order.line').button_confirmed(cr, uid, pol_ids_to_confirm, context=context)
84

Subscribers

People subscribed via source and target branches