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

Proposed by jftempo
Status: Merged
Merged at revision: 5330
Proposed branch: lp:~dorian-kemps/unifield-server/US-4697
Merge into: lp:unifield-server
Diff against target: 253 lines (+105/-5) (has conflicts)
8 files modified
bin/addons/base/rng/view.rng (+1/-0)
bin/addons/msf_profile/i18n/fr_MF.po (+10/-0)
bin/addons/sourcing/sale_order_line.py (+27/-0)
bin/addons/sourcing/sourcing_view.xml (+4/-1)
bin/addons/sourcing/wizard/multiple_sourcing.py (+52/-3)
bin/addons/sourcing/wizard/multiple_sourcing_view.xml (+5/-1)
bin/osv/orm.py (+4/-0)
bin/tools/translate.py (+2/-0)
Text conflict in bin/addons/msf_profile/i18n/fr_MF.po
To merge this branch: bzr merge lp:~dorian-kemps/unifield-server/US-4697
Reviewer Review Type Date Requested Status
UniField Reviewer Team Pending
Review via email: mp+364817@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/base/rng/view.rng'
2--- bin/addons/base/rng/view.rng 2019-01-28 09:29:28 +0000
3+++ bin/addons/base/rng/view.rng 2019-04-30 15:43:45 +0000
4@@ -488,6 +488,7 @@
5 <rng:optional><rng:attribute name="filter_selector"/></rng:optional>
6 <rng:optional><rng:attribute name="default_selector"/></rng:optional>
7 <rng:optional><rng:attribute name="o2m_selectable"/></rng:optional>
8+ <rng:optional><rng:attribute name="required_error_msg"/></rng:optional>
9 <rng:zeroOrMore>
10 <rng:choice>
11 <rng:ref name="diagram"/>
12
13=== modified file 'bin/addons/msf_profile/i18n/fr_MF.po'
14--- bin/addons/msf_profile/i18n/fr_MF.po 2019-04-08 09:30:07 +0000
15+++ bin/addons/msf_profile/i18n/fr_MF.po 2019-04-30 15:43:45 +0000
16@@ -105336,6 +105336,7 @@
17 msgstr "\n"
18 " Attention: Les lignes suivantes ont des qté ou des montants sur plus de 15 chiffres. Veuillez vérifier la qté et le prix unitaire pour éviter des pertes d'information:\n"
19 " "
20+<<<<<<< TREE
21
22 #. module: msf_homere_interface
23 #: code:addons/msf_homere_interface/wizard/hr_payroll_import.py:580
24@@ -105388,3 +105389,12 @@
25 #, python-format
26 msgid "Product %s, BN: %s not enough stock to process quantity %s %s (stock level: %s)"
27 msgstr "Produit %s, Lot: %s, pas assez de stock pour traiter la qantité %s %s (quantité en stock: %s)"
28+=======
29+
30+#. module: sourcing
31+#: code:addons/sourcing/sale_order_line.py:1606
32+#: view:multiple.sourcing.wizard:0
33+#, python-format
34+msgid "For this Supplier you have to select a Sourcing Group"
35+msgstr "Vous devez sélectionner un Groupe de Sourcing pour ce Fournisseur"
36+>>>>>>> MERGE-SOURCE
37
38=== modified file 'bin/addons/sourcing/sale_order_line.py'
39--- bin/addons/sourcing/sale_order_line.py 2019-02-11 09:16:33 +0000
40+++ bin/addons/sourcing/sale_order_line.py 2019-04-30 15:43:45 +0000
41@@ -250,6 +250,8 @@
42 'display_confirm_button': line.state == 'validated',
43 'sale_order_in_progress': line.order_id.sourcing_trace_ok,
44 'sale_order_state': self._get_sale_order_state(cr, uid, line.order_id, context=context),
45+ 'supplier_type': line.supplier and line.supplier.partner_type or False,
46+ 'supplier_split_po': line.supplier and line.supplier.split_po or False,
47 }
48 res[line.id] = values
49
50@@ -528,6 +530,24 @@
51 store=False,
52 multi='line_info',
53 ),
54+ 'supplier_type': fields.function(
55+ _get_line_values,
56+ method=True,
57+ string='Supplier Type',
58+ type='char',
59+ readonly=True,
60+ store=False,
61+ multi='line_info',
62+ ),
63+ 'supplier_split_po': fields.function(
64+ _get_line_values,
65+ method=True,
66+ string='Supplier can Split POs',
67+ type='char',
68+ readonly=True,
69+ store=False,
70+ multi='line_info',
71+ ),
72 'stock_uom_id': fields.related(
73 'product_id',
74 'uom_id',
75@@ -1581,6 +1601,9 @@
76 company_currency_id = self.pool.get('res.users').get_company_currency_id(cr, uid)
77
78 for sourcing_line in self.browse(cr, uid, ids, context=context):
79+ if sourcing_line.supplier and sourcing_line.supplier_type == 'esc' and \
80+ sourcing_line.supplier_split_po == 'yes' and not sourcing_line.related_sourcing_id:
81+ raise osv.except_osv(_('Error'), _('For this Supplier you have to select a Sourcing Group'))
82 if sourcing_line.state in ['validated', 'validated_p']:
83 if sourcing_line.type == 'make_to_stock':
84 self.check_location_integrity(cr, uid, [sourcing_line.id], context=context)
85@@ -2293,6 +2316,8 @@
86 result['value'].update({
87 'related_sourcing_id': False,
88 'related_sourcing_ok': False,
89+ 'supplier_type': False,
90+ 'supplier_split_po': False,
91 })
92 sl = self.browse(cr, uid, line_id, context=context)
93 if not sl.product_id and sl.order_id.procurement_request and sl.type == 'make_to_order':
94@@ -2318,6 +2343,8 @@
95 result['value'].update({
96 'estimated_delivery_date': estDeliveryDate.strftime('%Y-%m-%d'),
97 'related_sourcing_ok': related_sourcing_ok,
98+ 'supplier_type': partner and partner.partner_type or False,
99+ 'supplier_split_po': partner and partner.split_po or False,
100 })
101 if not related_sourcing_ok:
102 result['value']['related_sourcing_id'] = False
103
104=== modified file 'bin/addons/sourcing/sourcing_view.xml'
105--- bin/addons/sourcing/sourcing_view.xml 2018-10-15 12:44:12 +0000
106+++ bin/addons/sourcing/sourcing_view.xml 2019-04-30 15:43:45 +0000
107@@ -52,8 +52,11 @@
108 on_change="onChangePoCft(po_cft, order_id, supplier)"
109 attrs="{'readonly': ['|', ('type', '=', 'make_to_stock'), ('state', '!=', 'validated')], 'required': [('type', '=', 'make_to_order')]}" />
110 <field name="related_sourcing_ok" invisible="1" />
111+ <field name="supplier_type" invisible="1" />
112+ <field name="supplier_split_po" invisible="1" />
113 <field name="related_sourcing_id"
114- attrs="{'readonly': ['|', '|', '|', ('supplier', '=', False), ('related_sourcing_ok', '=', False), ('state', '!=', 'validated'), ('po_cft', 'not in', ['po', 'dpo'])]}" />
115+ attrs="{'readonly': ['|', '|', '|', ('supplier', '=', False), ('related_sourcing_ok', '=', False), ('state', '!=', 'validated'), ('po_cft', 'not in', ['po', 'dpo'])],
116+ 'required': [('supplier', '!=', False), ('supplier_type', '=', 'esc'), ('supplier_split_po', '=', 'yes')]}" />
117 <field name="location_id"
118 widget="selection"
119 on_change="onChangeLocation(location_id, product_id, rts, order_id)"
120
121=== modified file 'bin/addons/sourcing/wizard/multiple_sourcing.py'
122--- bin/addons/sourcing/wizard/multiple_sourcing.py 2018-10-15 12:44:12 +0000
123+++ bin/addons/sourcing/wizard/multiple_sourcing.py 2019-04-30 15:43:45 +0000
124@@ -33,6 +33,27 @@
125 class multiple_sourcing_wizard(osv.osv_memory):
126 _name = 'multiple.sourcing.wizard'
127
128+ def _get_values(self, cr, uid, ids, field_name, args, context=None):
129+ """
130+ Get some values from the wizard.
131+ """
132+ if context is None:
133+ context = {}
134+
135+ if isinstance(ids, (int, long)):
136+ ids = [ids]
137+
138+ res = {}
139+
140+ for wizard in self.browse(cr, uid, ids, context=context):
141+ values = {
142+ 'supplier_type': wizard.supplier_id and wizard.supplier_id.partner_type or False,
143+ 'supplier_split_po': wizard.supplier_id and wizard.supplier_id.split_po or False,
144+ }
145+ res[wizard.id] = values
146+
147+ return res
148+
149 _columns = {
150 'line_ids': fields.many2many(
151 'sale.order.line',
152@@ -78,6 +99,24 @@
153 'related_sourcing_ok': fields.boolean(
154 string='Related sourcing OK',
155 ),
156+ 'supplier_type': fields.function(
157+ _get_values,
158+ method=True,
159+ string='Supplier Type',
160+ type='char',
161+ readonly=True,
162+ store=False,
163+ multi='wizard_info',
164+ ),
165+ 'supplier_split_po': fields.function(
166+ _get_values,
167+ method=True,
168+ string='Supplier can Split POs',
169+ type='char',
170+ readonly=True,
171+ store=False,
172+ multi='wizard_info',
173+ ),
174 }
175
176 def default_get(self, cr, uid, fields_list, context=None):
177@@ -430,7 +469,7 @@
178 if context is None:
179 context = {}
180
181- result = {}
182+ result = {'value': {}}
183 related_sourcing_ok = False
184 if supplier:
185 related_sourcing_ok = sol_obj._check_related_sourcing_ok(cr, uid, supplier, l_type, context=context)
186@@ -442,9 +481,19 @@
187 'message': _('The chosen partner has no address. Please define an address before continuing.'),
188 }
189
190- result['value'] = {
191+ result['value'].update({
192+ 'supplier_type': partner and partner.partner_type or False,
193+ 'supplier_split_po': partner and partner.split_po or False,
194+ })
195+ else:
196+ result['value'].update({
197+ 'supplier_type': False,
198+ 'supplier_split_po': False,
199+ })
200+
201+ result['value'].update({
202 'related_sourcing_ok': related_sourcing_ok,
203- }
204+ })
205
206 if not related_sourcing_ok:
207 result['value']['related_sourcing_id'] = False
208
209=== modified file 'bin/addons/sourcing/wizard/multiple_sourcing_view.xml'
210--- bin/addons/sourcing/wizard/multiple_sourcing_view.xml 2018-10-15 12:44:12 +0000
211+++ bin/addons/sourcing/wizard/multiple_sourcing_view.xml 2019-04-30 15:43:45 +0000
212@@ -36,8 +36,12 @@
213 attrs="{'readonly': [('type', '!=', 'make_to_stock')]}"
214 on_change="change_location(location_id, line_ids)" />
215 <field name="related_sourcing_ok" invisible="1" />
216+ <field name="supplier_type" invisible="1" />
217+ <field name="supplier_split_po" invisible="1" />
218 <field name="related_sourcing_id"
219- attrs="{'readonly': ['|', '|', '|', ('supplier_id', '=', False), ('related_sourcing_ok', '=', False), ('type', '!=', 'make_to_order'), ('po_cft', 'not in', ['po', 'dpo'])]}" />
220+ attrs="{'readonly': ['|', '|', '|', ('supplier_id', '=', False), ('related_sourcing_ok', '=', False), ('type', '!=', 'make_to_order'), ('po_cft', 'not in', ['po', 'dpo'])],
221+ 'required': [('supplier_id', '!=', False), ('supplier_type', '=', 'esc'), ('supplier_split_po', '=', 'yes')]}"
222+ required_error_msg="For this Supplier you have to select a Sourcing Group" />
223 </group>
224 <separator colspan="4" string="Actions" />
225 <button special="cancel" string="Cancel" icon="gtk-cancel" help="Close the wizard" />
226
227=== modified file 'bin/osv/orm.py'
228--- bin/osv/orm.py 2019-02-08 16:56:18 +0000
229+++ bin/osv/orm.py 2019-04-30 15:43:45 +0000
230@@ -1557,6 +1557,10 @@
231 trans = translation_obj._get_source(cr, user, self._name, 'view', context['lang'], node.get('help'))
232 if trans:
233 node.set('help', trans)
234+ if node.get('required_error_msg'):
235+ trans = translation_obj._get_source(cr, user, self._name, 'view', context['lang'], node.get('required_error_msg'))
236+ if trans:
237+ node.set('required_error_msg', trans)
238 if node.get('string'):
239 trans = translation_obj._get_source(cr, user, self._name, 'view', context['lang'], node.get('string'))
240 if trans == node.get('string') and ('base_model_name' in context):
241
242=== modified file 'bin/tools/translate.py'
243--- bin/tools/translate.py 2018-10-02 14:58:18 +0000
244+++ bin/tools/translate.py 2019-04-30 15:43:45 +0000
245@@ -562,6 +562,8 @@
246 res.append(de.get('confirm').encode("utf8"))
247 if de.get("help"):
248 res.append(de.get('help').encode("utf8"))
249+ if de.get("required_error_msg"):
250+ res.append(de.get('required_error_msg').encode("utf8"))
251 if de.get("filter_selector"):
252 try:
253 eval_filter = safe_eval(de.get('filter_selector'))

Subscribers

People subscribed via source and target branches