Merge lp:~unifield-team/unifield-server/qt-fix-210616 into lp:unifield-server

Proposed by jftempo
Status: Rejected
Rejected by: jftempo
Proposed branch: lp:~unifield-team/unifield-server/qt-fix-210616
Merge into: lp:unifield-server
Diff against target: 235 lines (+48/-18)
9 files modified
bin/addons/analytic_distribution_supply/purchase.py (+0/-6)
bin/addons/consumption_calculation/consumption_calculation.py (+2/-2)
bin/addons/consumption_calculation/consumption_view.xml (+1/-1)
bin/addons/msf_button_access_rights/res_log.py (+1/-1)
bin/addons/order_nomenclature/order_nomenclature.py (+6/-0)
bin/addons/procurement_request/procurement_request.py (+5/-0)
bin/addons/purchase_override/purchase.py (+4/-2)
bin/addons/sale_override/sale.py (+6/-2)
bin/addons/specific_rules/specific_rules.py (+23/-4)
To merge this branch: bzr merge lp:~unifield-team/unifield-server/qt-fix-210616
Reviewer Review Type Date Requested Status
UniField Reviewer Team Pending
Review via email: mp+300709@code.launchpad.net
To post a comment you must log in.

Unmerged revisions

3836. By Quentin THEURET @Amaris

US-1066 [FIX] Fix bad statement

3835. By Quentin THEURET @Amaris

US-1066 [FIX] Fix bad statement

3834. By Quentin THEURET @Amaris

US-1066 [FIX] Don't display the res.log message for Short shelf life product if the order is not an non-split FO

3833. By Quentin THEURET @Amaris

US-1066 [MERGE] Merge latest modifications on US-1066

3832. By Quentin THEURET @Amaris

US-633 [FIX]Fix not run messages at coordo

3831. By Quentin THEURET @Amaris

US-633 [MERGE] Merge lp:~unifield-team/unifield-server/us-633

3830. By Quentin THEURET @Amaris

US-768 [MERGE] Merge lp:~unifield-team/unifield-server/us-768

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'bin/addons/analytic_distribution_supply/purchase.py'
2--- bin/addons/analytic_distribution_supply/purchase.py 2016-03-02 15:57:47 +0000
3+++ bin/addons/analytic_distribution_supply/purchase.py 2016-07-21 08:22:24 +0000
4@@ -444,12 +444,6 @@
5 if isinstance(ids, (int, long)):
6 ids = [ids]
7
8- if not context.get('partner_type'):
9- raise osv.except_osv(
10- _('Error'),
11- _('You need to select a partner before add the analytic distribution'),
12- )
13-
14 # Prepare some values
15 purchase_line = self.browse(cr, uid, ids[0], context=context)
16 amount = purchase_line.price_subtotal or 0.0
17
18=== modified file 'bin/addons/consumption_calculation/consumption_calculation.py'
19--- bin/addons/consumption_calculation/consumption_calculation.py 2016-06-16 12:40:01 +0000
20+++ bin/addons/consumption_calculation/consumption_calculation.py 2016-07-21 08:22:24 +0000
21@@ -775,14 +775,14 @@
22 'date_mandatory': fields.boolean(string='DM'),
23 'asset_id': fields.integer(string='Asset'),
24 'asset_mandatory': fields.boolean('AM'),
25- 'remark': fields.char(size=256, string='Remark'),
26+ 'remark': fields.char(size=256, string='Comment'),
27 'move_id': fields.many2one('stock.move', string='Move'),
28 'rac_id': fields.many2one('real.average.consumption', string='RAC', ondelete='cascade'),
29 'text_error': fields.text('Errors', readonly=True),
30 'to_correct_ok': fields.function(_get_checks_all, method=True, type="boolean", string="To correct", store=False, readonly=True, multi="m"),
31 'just_info_ok': fields.boolean(string='Just for info'),
32 'inactive_product': fields.function(_get_inactive_product, method=True, type='boolean', string='Product is inactive', store=False, multi='inactive'),
33- 'inactive_error': fields.function(_get_inactive_product, method=True, type='char', string='Comment', store=False, multi='inactive'),
34+ 'inactive_error': fields.function(_get_inactive_product, method=True, type='char', string='System message', store=False, multi='inactive'),
35 }
36
37 _defaults = {
38
39=== modified file 'bin/addons/consumption_calculation/consumption_view.xml'
40--- bin/addons/consumption_calculation/consumption_view.xml 2015-12-09 11:34:08 +0000
41+++ bin/addons/consumption_calculation/consumption_view.xml 2016-07-21 08:22:24 +0000
42@@ -58,7 +58,7 @@
43 <field name="consumed_qty" on_change="change_qty(consumed_qty, product_id, prodlot_id, parent.cons_location_id, uom_id)"/>
44 <field name="move_id" invisible="1" />
45 <button string="Duplicate line" icon="terp-stock_effects-object-colorize" name="copy" type="object" attrs="{'invisible': [('move_id', '!=', False)]}" />
46- <field name="remark" invisible="1" />
47+ <field name="remark" />
48 <field name="batch_mandatory" invisible="0" string="B.Num" readonly="1" />
49 <field name="date_mandatory" invisible="0" string="Exp" readonly="1" />
50 <field name="asset_mandatory" invisible="0" string="Asset" readonly="1" />
51
52=== modified file 'bin/addons/msf_button_access_rights/res_log.py'
53--- bin/addons/msf_button_access_rights/res_log.py 2015-12-10 16:03:40 +0000
54+++ bin/addons/msf_button_access_rights/res_log.py 2016-07-21 08:22:24 +0000
55@@ -150,7 +150,7 @@
56
57 for r in res:
58 r['read_ok'] = self._check_read_rights(cr, uid, r['res_model'], read_rights, context=context)
59- t = (r['res_model'], r['res_id'])
60+ t = (r['name'], r['res_model'], r['res_id'])
61 if t not in res_dict:
62 res_dict[t] = True
63 result.insert(0,r)
64
65=== modified file 'bin/addons/order_nomenclature/order_nomenclature.py'
66--- bin/addons/order_nomenclature/order_nomenclature.py 2014-03-25 13:21:26 +0000
67+++ bin/addons/order_nomenclature/order_nomenclature.py 2016-07-21 08:22:24 +0000
68@@ -137,6 +137,9 @@
69 partner_id, date_order, fiscal_position, date_planned,
70 name, price_unit, notes, state, old_unit_price,nomen_manda_0,comment,context=prod_context)
71
72+ if result.get('warning') and result['warning'].get('title') == 'Short Shelf Life product':
73+ del result['warning']
74+
75 # drop modification to name attribute
76 if 'name' in result['value']:
77 del result['value']['name']
78@@ -375,6 +378,9 @@
79 uom, qty_uos, uos, name, partner_id,
80 lang, update_tax, date_order, packaging, fiscal_position, flag)
81
82+ if result.get('warning') and result['warning'].get('title') == 'Short Shelf Life product':
83+ del result['warning']
84+
85 # drop modification to name attribute
86 if 'name' in result['value']:
87 del result['value']['name']
88
89=== modified file 'bin/addons/procurement_request/procurement_request.py'
90--- bin/addons/procurement_request/procurement_request.py 2016-05-31 08:51:54 +0000
91+++ bin/addons/procurement_request/procurement_request.py 2016-07-21 08:22:24 +0000
92@@ -397,6 +397,9 @@
93 '''
94 Update date_planned of lines
95 '''
96+ if isinstance(ids, (int, long)):
97+ ids = [ids]
98+
99 res = True
100 for req in self.browse(cr, uid, ids, context=context):
101 # Only in case of Internal request
102@@ -546,6 +549,8 @@
103 line_obj.write(cr, uid, reset_soq, {'soq_updated': False,}, context=context)
104 self.write(cr, uid, ids, {'state': 'validated'}, context=context)
105
106+ self.ssl_products_in_line(cr, uid, ids, context=context)
107+
108 return True
109
110 def confirm_procurement(self, cr, uid, ids, context=None):
111
112=== modified file 'bin/addons/purchase_override/purchase.py'
113--- bin/addons/purchase_override/purchase.py 2016-06-01 08:29:43 +0000
114+++ bin/addons/purchase_override/purchase.py 2016-07-21 08:22:24 +0000
115@@ -1118,6 +1118,7 @@
116 'validator' : uid,
117 'date_confirm': strftime('%Y-%m-%d')}, context=context)
118
119+ self.ssl_products_in_line(cr, uid, ids, context=context)
120 self.check_analytic_distribution(cr, uid, ids, context=context)
121
122 return True
123@@ -1320,8 +1321,9 @@
124 if exp_sol.po_id and exp_sol.po_id.id not in all_po_ids:
125 all_po_ids.append(exp_sol.po_id.id)
126 list_po_name = ', '.join([linked_po.name for linked_po in self.browse(cr, uid, all_po_ids, context) if linked_po.id != ids[0]])
127- self.log(cr, uid, ids[0], _("The order %s is in confirmed (waiting) state and will be confirmed once the related orders [%s] would have been confirmed"
128- ) % (self.read(cr, uid, ids, ['name'])[0]['name'], list_po_name))
129+ if list_po_name:
130+ self.log(cr, uid, ids[0], _("The order %s is in confirmed (waiting) state and will be confirmed once the related orders [%s] would have been confirmed"
131+ ) % (self.read(cr, uid, ids, ['name'])[0]['name'], list_po_name))
132 # sale order lines with modified state
133 if sol_ids:
134 sol_obj.write(cr, uid, sol_ids, {'state': 'confirmed'}, context=context)
135
136=== modified file 'bin/addons/sale_override/sale.py'
137--- bin/addons/sale_override/sale.py 2016-05-27 12:38:18 +0000
138+++ bin/addons/sale_override/sale.py 2016-07-21 08:22:24 +0000
139@@ -1326,13 +1326,17 @@
140 'validated_date': time.strftime('%Y-%m-%d %H:%M:%S'),
141 }, context=context)
142
143+ self.ssl_products_in_line(cr, uid, ids, context=context)
144+
145 # Display validation message to the user
146 for order in order_brw_list:
147 if not order.procurement_request:
148- self.log(cr, uid, order.id, 'The Field order \'%s\' has been validated (nb lines: %s).' % (order.name, len(order.order_line)), context=context)
149+ if order.split_type_sale_order == 'original_sale_order':
150+ self.log(cr, uid, order.id, 'The Field order \'%s\' has been validated (nb lines: %s).' % (order.name, len(order.order_line)), context=context)
151 self.infolog(cr, uid, "The Field order id:%s (%s) has been validated." % (order.id, order.name))
152 else:
153- self.log(cr, uid, order.id, 'The Internal Request \'%s\' has been validated (nb lines: %s).' % (order.name, len(order.order_line)), context=context)
154+ if order.split_type_sale_order == 'original_sale_order':
155+ self.log(cr, uid, order.id, 'The Internal Request \'%s\' has been validated (nb lines: %s).' % (order.name, len(order.order_line)), context=context)
156 self.infolog(cr, uid, "The Internal request id:%s (%s) has been validated." % (order.id, order.name))
157
158 return True
159
160=== modified file 'bin/addons/specific_rules/specific_rules.py'
161--- bin/addons/specific_rules/specific_rules.py 2016-05-26 15:56:48 +0000
162+++ bin/addons/specific_rules/specific_rules.py 2016-07-21 08:22:24 +0000
163@@ -88,6 +88,15 @@
164
165 return result
166
167+ def requested_product_id_change(self, cr, uid, ids, product_id, comment=False, context=None):
168+ result = super(sale_order_line, self).requested_product_id_change(cr, uid, ids, product_id, comment, context)
169+ if product_id:
170+ prod_obj = self.pool.get('product.product')
171+ if prod_obj.browse(cr, uid, product_id).is_ssl:
172+ warning = {'title': 'Short Shelf Life product', 'message': _(SHORT_SHELF_LIFE_MESS)}
173+ result.update(warning=warning)
174+ return result
175+
176 sale_order_line()
177
178
179@@ -97,21 +106,26 @@
180 '''
181 _inherit = 'sale.order'
182
183- def write(self, cr, uid, ids, vals, context=None):
184+ def ssl_products_in_line(self, cr, uid, ids, context=None):
185 '''
186 display message if contains short shelf life
187 '''
188 if isinstance(ids, (int, long)):
189 ids = [ids]
190
191+ can_break = False
192 for obj in self.browse(cr, uid, ids, context=context):
193+ if obj.split_type_sale_order != 'original_sale_order' or can_break:
194+ break
195 for line in obj.order_line:
196 # log the message
197 if line.product_id.is_ssl:
198 # log the message
199 self.log(cr, uid, obj.id, _(SHORT_SHELF_LIFE_MESS))
200+ can_break = True
201+ break
202
203- return super(sale_order, self).write(cr, uid, ids, vals, context=context)
204+ return True
205
206 sale_order()
207
208@@ -178,21 +192,26 @@
209 '''
210 _inherit = 'purchase.order'
211
212- def write(self, cr, uid, ids, vals, context=None):
213+ def ssl_products_in_line(self, cr, uid, ids, context=None):
214 '''
215 display message if contains short shelf life
216 '''
217 if isinstance(ids, (int, long)):
218 ids = [ids]
219
220+ can_break = False
221 for obj in self.browse(cr, uid, ids, context=context):
222+ if can_break:
223+ break
224 for line in obj.order_line:
225 # log the message
226 if line.product_id.is_ssl:
227 # log the message
228 self.log(cr, uid, obj.id, _(SHORT_SHELF_LIFE_MESS))
229+ can_break = True
230+ break
231
232- return super(purchase_order, self).write(cr, uid, ids, vals, context=context)
233+ return True
234
235 purchase_order()
236

Subscribers

People subscribed via source and target branches

to all changes: