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
=== modified file 'bin/addons/analytic_distribution_supply/purchase.py'
--- bin/addons/analytic_distribution_supply/purchase.py 2016-03-02 15:57:47 +0000
+++ bin/addons/analytic_distribution_supply/purchase.py 2016-07-21 08:22:24 +0000
@@ -444,12 +444,6 @@
444 if isinstance(ids, (int, long)):444 if isinstance(ids, (int, long)):
445 ids = [ids]445 ids = [ids]
446446
447 if not context.get('partner_type'):
448 raise osv.except_osv(
449 _('Error'),
450 _('You need to select a partner before add the analytic distribution'),
451 )
452
453 # Prepare some values447 # Prepare some values
454 purchase_line = self.browse(cr, uid, ids[0], context=context)448 purchase_line = self.browse(cr, uid, ids[0], context=context)
455 amount = purchase_line.price_subtotal or 0.0449 amount = purchase_line.price_subtotal or 0.0
456450
=== modified file 'bin/addons/consumption_calculation/consumption_calculation.py'
--- bin/addons/consumption_calculation/consumption_calculation.py 2016-06-16 12:40:01 +0000
+++ bin/addons/consumption_calculation/consumption_calculation.py 2016-07-21 08:22:24 +0000
@@ -775,14 +775,14 @@
775 'date_mandatory': fields.boolean(string='DM'),775 'date_mandatory': fields.boolean(string='DM'),
776 'asset_id': fields.integer(string='Asset'),776 'asset_id': fields.integer(string='Asset'),
777 'asset_mandatory': fields.boolean('AM'),777 'asset_mandatory': fields.boolean('AM'),
778 'remark': fields.char(size=256, string='Remark'),778 'remark': fields.char(size=256, string='Comment'),
779 'move_id': fields.many2one('stock.move', string='Move'),779 'move_id': fields.many2one('stock.move', string='Move'),
780 'rac_id': fields.many2one('real.average.consumption', string='RAC', ondelete='cascade'),780 'rac_id': fields.many2one('real.average.consumption', string='RAC', ondelete='cascade'),
781 'text_error': fields.text('Errors', readonly=True),781 'text_error': fields.text('Errors', readonly=True),
782 'to_correct_ok': fields.function(_get_checks_all, method=True, type="boolean", string="To correct", store=False, readonly=True, multi="m"),782 'to_correct_ok': fields.function(_get_checks_all, method=True, type="boolean", string="To correct", store=False, readonly=True, multi="m"),
783 'just_info_ok': fields.boolean(string='Just for info'),783 'just_info_ok': fields.boolean(string='Just for info'),
784 'inactive_product': fields.function(_get_inactive_product, method=True, type='boolean', string='Product is inactive', store=False, multi='inactive'),784 'inactive_product': fields.function(_get_inactive_product, method=True, type='boolean', string='Product is inactive', store=False, multi='inactive'),
785 'inactive_error': fields.function(_get_inactive_product, method=True, type='char', string='Comment', store=False, multi='inactive'),785 'inactive_error': fields.function(_get_inactive_product, method=True, type='char', string='System message', store=False, multi='inactive'),
786 }786 }
787787
788 _defaults = {788 _defaults = {
789789
=== modified file 'bin/addons/consumption_calculation/consumption_view.xml'
--- bin/addons/consumption_calculation/consumption_view.xml 2015-12-09 11:34:08 +0000
+++ bin/addons/consumption_calculation/consumption_view.xml 2016-07-21 08:22:24 +0000
@@ -58,7 +58,7 @@
58 <field name="consumed_qty" on_change="change_qty(consumed_qty, product_id, prodlot_id, parent.cons_location_id, uom_id)"/>58 <field name="consumed_qty" on_change="change_qty(consumed_qty, product_id, prodlot_id, parent.cons_location_id, uom_id)"/>
59 <field name="move_id" invisible="1" />59 <field name="move_id" invisible="1" />
60 <button string="Duplicate line" icon="terp-stock_effects-object-colorize" name="copy" type="object" attrs="{'invisible': [('move_id', '!=', False)]}" />60 <button string="Duplicate line" icon="terp-stock_effects-object-colorize" name="copy" type="object" attrs="{'invisible': [('move_id', '!=', False)]}" />
61 <field name="remark" invisible="1" />61 <field name="remark" />
62 <field name="batch_mandatory" invisible="0" string="B.Num" readonly="1" />62 <field name="batch_mandatory" invisible="0" string="B.Num" readonly="1" />
63 <field name="date_mandatory" invisible="0" string="Exp" readonly="1" />63 <field name="date_mandatory" invisible="0" string="Exp" readonly="1" />
64 <field name="asset_mandatory" invisible="0" string="Asset" readonly="1" />64 <field name="asset_mandatory" invisible="0" string="Asset" readonly="1" />
6565
=== modified file 'bin/addons/msf_button_access_rights/res_log.py'
--- bin/addons/msf_button_access_rights/res_log.py 2015-12-10 16:03:40 +0000
+++ bin/addons/msf_button_access_rights/res_log.py 2016-07-21 08:22:24 +0000
@@ -150,7 +150,7 @@
150150
151 for r in res:151 for r in res:
152 r['read_ok'] = self._check_read_rights(cr, uid, r['res_model'], read_rights, context=context)152 r['read_ok'] = self._check_read_rights(cr, uid, r['res_model'], read_rights, context=context)
153 t = (r['res_model'], r['res_id'])153 t = (r['name'], r['res_model'], r['res_id'])
154 if t not in res_dict:154 if t not in res_dict:
155 res_dict[t] = True155 res_dict[t] = True
156 result.insert(0,r)156 result.insert(0,r)
157157
=== modified file 'bin/addons/order_nomenclature/order_nomenclature.py'
--- bin/addons/order_nomenclature/order_nomenclature.py 2014-03-25 13:21:26 +0000
+++ bin/addons/order_nomenclature/order_nomenclature.py 2016-07-21 08:22:24 +0000
@@ -137,6 +137,9 @@
137 partner_id, date_order, fiscal_position, date_planned,137 partner_id, date_order, fiscal_position, date_planned,
138 name, price_unit, notes, state, old_unit_price,nomen_manda_0,comment,context=prod_context)138 name, price_unit, notes, state, old_unit_price,nomen_manda_0,comment,context=prod_context)
139139
140 if result.get('warning') and result['warning'].get('title') == 'Short Shelf Life product':
141 del result['warning']
142
140 # drop modification to name attribute143 # drop modification to name attribute
141 if 'name' in result['value']:144 if 'name' in result['value']:
142 del result['value']['name']145 del result['value']['name']
@@ -375,6 +378,9 @@
375 uom, qty_uos, uos, name, partner_id,378 uom, qty_uos, uos, name, partner_id,
376 lang, update_tax, date_order, packaging, fiscal_position, flag)379 lang, update_tax, date_order, packaging, fiscal_position, flag)
377380
381 if result.get('warning') and result['warning'].get('title') == 'Short Shelf Life product':
382 del result['warning']
383
378 # drop modification to name attribute384 # drop modification to name attribute
379 if 'name' in result['value']:385 if 'name' in result['value']:
380 del result['value']['name']386 del result['value']['name']
381387
=== modified file 'bin/addons/procurement_request/procurement_request.py'
--- bin/addons/procurement_request/procurement_request.py 2016-05-31 08:51:54 +0000
+++ bin/addons/procurement_request/procurement_request.py 2016-07-21 08:22:24 +0000
@@ -397,6 +397,9 @@
397 '''397 '''
398 Update date_planned of lines398 Update date_planned of lines
399 '''399 '''
400 if isinstance(ids, (int, long)):
401 ids = [ids]
402
400 res = True403 res = True
401 for req in self.browse(cr, uid, ids, context=context):404 for req in self.browse(cr, uid, ids, context=context):
402 # Only in case of Internal request405 # Only in case of Internal request
@@ -546,6 +549,8 @@
546 line_obj.write(cr, uid, reset_soq, {'soq_updated': False,}, context=context)549 line_obj.write(cr, uid, reset_soq, {'soq_updated': False,}, context=context)
547 self.write(cr, uid, ids, {'state': 'validated'}, context=context)550 self.write(cr, uid, ids, {'state': 'validated'}, context=context)
548551
552 self.ssl_products_in_line(cr, uid, ids, context=context)
553
549 return True554 return True
550555
551 def confirm_procurement(self, cr, uid, ids, context=None):556 def confirm_procurement(self, cr, uid, ids, context=None):
552557
=== modified file 'bin/addons/purchase_override/purchase.py'
--- bin/addons/purchase_override/purchase.py 2016-06-01 08:29:43 +0000
+++ bin/addons/purchase_override/purchase.py 2016-07-21 08:22:24 +0000
@@ -1118,6 +1118,7 @@
1118 'validator' : uid,1118 'validator' : uid,
1119 'date_confirm': strftime('%Y-%m-%d')}, context=context)1119 'date_confirm': strftime('%Y-%m-%d')}, context=context)
11201120
1121 self.ssl_products_in_line(cr, uid, ids, context=context)
1121 self.check_analytic_distribution(cr, uid, ids, context=context)1122 self.check_analytic_distribution(cr, uid, ids, context=context)
11221123
1123 return True1124 return True
@@ -1320,8 +1321,9 @@
1320 if exp_sol.po_id and exp_sol.po_id.id not in all_po_ids:1321 if exp_sol.po_id and exp_sol.po_id.id not in all_po_ids:
1321 all_po_ids.append(exp_sol.po_id.id)1322 all_po_ids.append(exp_sol.po_id.id)
1322 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]])1323 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]])
1323 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"1324 if list_po_name:
1324 ) % (self.read(cr, uid, ids, ['name'])[0]['name'], list_po_name))1325 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"
1326 ) % (self.read(cr, uid, ids, ['name'])[0]['name'], list_po_name))
1325 # sale order lines with modified state1327 # sale order lines with modified state
1326 if sol_ids:1328 if sol_ids:
1327 sol_obj.write(cr, uid, sol_ids, {'state': 'confirmed'}, context=context)1329 sol_obj.write(cr, uid, sol_ids, {'state': 'confirmed'}, context=context)
13281330
=== modified file 'bin/addons/sale_override/sale.py'
--- bin/addons/sale_override/sale.py 2016-05-27 12:38:18 +0000
+++ bin/addons/sale_override/sale.py 2016-07-21 08:22:24 +0000
@@ -1326,13 +1326,17 @@
1326 'validated_date': time.strftime('%Y-%m-%d %H:%M:%S'),1326 'validated_date': time.strftime('%Y-%m-%d %H:%M:%S'),
1327 }, context=context)1327 }, context=context)
13281328
1329 self.ssl_products_in_line(cr, uid, ids, context=context)
1330
1329 # Display validation message to the user1331 # Display validation message to the user
1330 for order in order_brw_list:1332 for order in order_brw_list:
1331 if not order.procurement_request:1333 if not order.procurement_request:
1332 self.log(cr, uid, order.id, 'The Field order \'%s\' has been validated (nb lines: %s).' % (order.name, len(order.order_line)), context=context)1334 if order.split_type_sale_order == 'original_sale_order':
1335 self.log(cr, uid, order.id, 'The Field order \'%s\' has been validated (nb lines: %s).' % (order.name, len(order.order_line)), context=context)
1333 self.infolog(cr, uid, "The Field order id:%s (%s) has been validated." % (order.id, order.name))1336 self.infolog(cr, uid, "The Field order id:%s (%s) has been validated." % (order.id, order.name))
1334 else:1337 else:
1335 self.log(cr, uid, order.id, 'The Internal Request \'%s\' has been validated (nb lines: %s).' % (order.name, len(order.order_line)), context=context)1338 if order.split_type_sale_order == 'original_sale_order':
1339 self.log(cr, uid, order.id, 'The Internal Request \'%s\' has been validated (nb lines: %s).' % (order.name, len(order.order_line)), context=context)
1336 self.infolog(cr, uid, "The Internal request id:%s (%s) has been validated." % (order.id, order.name))1340 self.infolog(cr, uid, "The Internal request id:%s (%s) has been validated." % (order.id, order.name))
13371341
1338 return True1342 return True
13391343
=== modified file 'bin/addons/specific_rules/specific_rules.py'
--- bin/addons/specific_rules/specific_rules.py 2016-05-26 15:56:48 +0000
+++ bin/addons/specific_rules/specific_rules.py 2016-07-21 08:22:24 +0000
@@ -88,6 +88,15 @@
8888
89 return result89 return result
9090
91 def requested_product_id_change(self, cr, uid, ids, product_id, comment=False, context=None):
92 result = super(sale_order_line, self).requested_product_id_change(cr, uid, ids, product_id, comment, context)
93 if product_id:
94 prod_obj = self.pool.get('product.product')
95 if prod_obj.browse(cr, uid, product_id).is_ssl:
96 warning = {'title': 'Short Shelf Life product', 'message': _(SHORT_SHELF_LIFE_MESS)}
97 result.update(warning=warning)
98 return result
99
91sale_order_line()100sale_order_line()
92101
93102
@@ -97,21 +106,26 @@
97 '''106 '''
98 _inherit = 'sale.order'107 _inherit = 'sale.order'
99108
100 def write(self, cr, uid, ids, vals, context=None):109 def ssl_products_in_line(self, cr, uid, ids, context=None):
101 '''110 '''
102 display message if contains short shelf life111 display message if contains short shelf life
103 '''112 '''
104 if isinstance(ids, (int, long)):113 if isinstance(ids, (int, long)):
105 ids = [ids]114 ids = [ids]
106115
116 can_break = False
107 for obj in self.browse(cr, uid, ids, context=context):117 for obj in self.browse(cr, uid, ids, context=context):
118 if obj.split_type_sale_order != 'original_sale_order' or can_break:
119 break
108 for line in obj.order_line:120 for line in obj.order_line:
109 # log the message121 # log the message
110 if line.product_id.is_ssl:122 if line.product_id.is_ssl:
111 # log the message123 # log the message
112 self.log(cr, uid, obj.id, _(SHORT_SHELF_LIFE_MESS))124 self.log(cr, uid, obj.id, _(SHORT_SHELF_LIFE_MESS))
125 can_break = True
126 break
113127
114 return super(sale_order, self).write(cr, uid, ids, vals, context=context)128 return True
115129
116sale_order()130sale_order()
117131
@@ -178,21 +192,26 @@
178 '''192 '''
179 _inherit = 'purchase.order'193 _inherit = 'purchase.order'
180194
181 def write(self, cr, uid, ids, vals, context=None):195 def ssl_products_in_line(self, cr, uid, ids, context=None):
182 '''196 '''
183 display message if contains short shelf life197 display message if contains short shelf life
184 '''198 '''
185 if isinstance(ids, (int, long)):199 if isinstance(ids, (int, long)):
186 ids = [ids]200 ids = [ids]
187201
202 can_break = False
188 for obj in self.browse(cr, uid, ids, context=context):203 for obj in self.browse(cr, uid, ids, context=context):
204 if can_break:
205 break
189 for line in obj.order_line:206 for line in obj.order_line:
190 # log the message207 # log the message
191 if line.product_id.is_ssl:208 if line.product_id.is_ssl:
192 # log the message209 # log the message
193 self.log(cr, uid, obj.id, _(SHORT_SHELF_LIFE_MESS))210 self.log(cr, uid, obj.id, _(SHORT_SHELF_LIFE_MESS))
211 can_break = True
212 break
194213
195 return super(purchase_order, self).write(cr, uid, ids, vals, context=context)214 return True
196215
197purchase_order()216purchase_order()
198217

Subscribers

People subscribed via source and target branches

to all changes: