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

Proposed by jftempo
Status: Merged
Merged at revision: 5909
Proposed branch: lp:~jfb-tempo-consulting/unifield-server/US-5037
Merge into: lp:unifield-server
Diff against target: 201 lines (+66/-11)
6 files modified
bin/addons/msf_profile/i18n/fr_MF.po (+3/-1)
bin/addons/procurement_request/procurement_request_view.xml (+1/-1)
bin/addons/purchase/purchase_workflow.py (+1/-0)
bin/addons/sale/sale_order.py (+31/-8)
bin/addons/sale/sale_view.xml (+29/-1)
bin/addons/sale/sale_workflow.py (+1/-0)
To merge this branch: bzr merge lp:~jfb-tempo-consulting/unifield-server/US-5037
Reviewer Review Type Date Requested Status
UniField Reviewer Team Pending
Review via email: mp+395322@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
=== modified file 'bin/addons/msf_profile/i18n/fr_MF.po'
--- bin/addons/msf_profile/i18n/fr_MF.po 2020-11-12 16:19:32 +0000
+++ bin/addons/msf_profile/i18n/fr_MF.po 2020-12-14 17:29:06 +0000
@@ -71409,10 +71409,12 @@
71409msgid "No catalogue found !"71409msgid "No catalogue found !"
71410msgstr "Catalogue pas trouvé !"71410msgstr "Catalogue pas trouvé !"
7141171411
71412#. module: purchase, purchase_override, msf_doc_import71412#. modules: purchase, purchase_override, msf_doc_import, sale
71413#: field:purchase.order.merged.line,instance_sync_order_ref:071413#: field:purchase.order.merged.line,instance_sync_order_ref:0
71414#: field:purchase.order.line,instance_sync_order_ref:071414#: field:purchase.order.line,instance_sync_order_ref:0
71415#: field:wizard.import.po.simulation.screen.line,imp_sync_order_ref:071415#: field:wizard.import.po.simulation.screen.line,imp_sync_order_ref:0
71416#: field:sale.order.line,instance_sync_order_ref:0
71417#: view:sync.order.label:0
71416msgid "Order in sync. instance"71418msgid "Order in sync. instance"
71417msgstr "Commande en instance sync."71419msgstr "Commande en instance sync."
7141871420
7141971421
=== modified file 'bin/addons/procurement_request/procurement_request_view.xml'
--- bin/addons/procurement_request/procurement_request_view.xml 2020-11-02 08:28:49 +0000
+++ bin/addons/procurement_request/procurement_request_view.xml 2020-12-14 17:29:06 +0000
@@ -81,7 +81,7 @@
81 <field name="product_uom_qty" on_change="onchange_uom(product_id, product_uom, product_uom_qty)" />81 <field name="product_uom_qty" on_change="onchange_uom(product_id, product_uom, product_uom_qty)" />
82 <field name="original_changed" readonly="1"/>82 <field name="original_changed" readonly="1"/>
83 <button name="button_view_changed" string="View Current/Original" type="object" icon="terp-stock_zoom"83 <button name="button_view_changed" string="View Current/Original" type="object" icon="terp-stock_zoom"
84 attrs="{'invisible': [('original_qty', '=', False), ('modification_comment', '=', False)]}"/>84 attrs="{'invisible': [('original_qty', '=', False), ('modification_comment', '=', False), ('original_changed', '=', False)]}"/>
85 <field name="price_unit"/>85 <field name="price_unit"/>
86 <field name="notes" />86 <field name="notes" />
87 <field name="display_resourced_orig_line" />87 <field name="display_resourced_orig_line" />
8888
=== modified file 'bin/addons/purchase/purchase_workflow.py'
--- bin/addons/purchase/purchase_workflow.py 2020-10-13 16:37:22 +0000
+++ bin/addons/purchase/purchase_workflow.py 2020-12-14 17:29:06 +0000
@@ -347,6 +347,7 @@
347 'date_planned': pol.date_planned or (datetime.now() + relativedelta(days=+2)).strftime('%Y-%m-%d'),347 'date_planned': pol.date_planned or (datetime.now() + relativedelta(days=+2)).strftime('%Y-%m-%d'),
348 'sync_sourced_origin': pol.instance_sync_order_ref and pol.instance_sync_order_ref.name or False,348 'sync_sourced_origin': pol.instance_sync_order_ref and pol.instance_sync_order_ref.name or False,
349 'set_as_sourced_n': True,349 'set_as_sourced_n': True,
350 'created_by_sync': True,
350 }351 }
351352
352 if pol.resourced_original_line:353 if pol.resourced_original_line:
353354
=== modified file 'bin/addons/sale/sale_order.py'
--- bin/addons/sale/sale_order.py 2020-11-02 09:31:38 +0000
+++ bin/addons/sale/sale_order.py 2020-12-14 17:29:06 +0000
@@ -2133,6 +2133,7 @@
2133 'ir_name_from_sync': fields.char(size=64, string='IR name to put on PO line after sync', invisible=True),2133 'ir_name_from_sync': fields.char(size=64, string='IR name to put on PO line after sync', invisible=True),
2134 'counterpart_po_line_id': fields.many2one('purchase.order.line', 'PO line counterpart'),2134 'counterpart_po_line_id': fields.many2one('purchase.order.line', 'PO line counterpart'),
2135 'pol_external_ref': fields.function(_get_pol_external_ref, method=True, type='char', size=256, string="Linked PO line's External Ref.", store=False),2135 'pol_external_ref': fields.function(_get_pol_external_ref, method=True, type='char', size=256, string="Linked PO line's External Ref.", store=False),
2136 'instance_sync_order_ref': fields.many2one('sync.order.label', string='Order in sync. instance'),
2136 }2137 }
2137 _order = 'sequence, id desc'2138 _order = 'sequence, id desc'
2138 _defaults = {2139 _defaults = {
@@ -2284,13 +2285,10 @@
2284 'cancelled_by_sync': False,2285 'cancelled_by_sync': False,
2285 })2286 })
22862287
2287 if 'ir_name_from_sync' not in default:2288 reset_if_not_set = ['ir_name_from_sync', 'in_name_goods_return', 'counterpart_po_line_id', 'instance_sync_order_ref']
2288 default['ir_name_from_sync'] = False2289 for to_reset in reset_if_not_set:
2289 if 'in_name_goods_return' not in default:2290 if to_reset not in default:
2290 default['in_name_goods_return'] = False2291 default[to_reset] = False
2291
2292 if 'counterpart_po_line_id' not in default:
2293 default['counterpart_po_line_id'] = False
22942292
2295 return super(sale_order_line, self).copy(cr, uid, id, default, context)2293 return super(sale_order_line, self).copy(cr, uid, id, default, context)
22962294
@@ -2331,7 +2329,12 @@
2331 if context.get('from_button') and 'is_line_split' not in default:2329 if context.get('from_button') and 'is_line_split' not in default:
2332 default['is_line_split'] = False2330 default['is_line_split'] = False
23332331
2334 for x in ['modification_comment', 'original_product', 'original_qty', 'original_price', 'original_uom', 'sync_linked_pol', 'resourced_original_line', 'ir_name_from_sync', 'in_name_goods_return', 'counterpart_po_line_id', 'from_cancel_out']:2332 for x in [
2333 'modification_comment', 'original_product', 'original_qty', 'original_price',
2334 'original_uom', 'sync_linked_pol', 'resourced_original_line', 'ir_name_from_sync',
2335 'in_name_goods_return', 'counterpart_po_line_id', 'from_cancel_out',
2336 'instance_sync_order_ref', 'sync_sourced_origin'
2337 ]:
2335 if x not in default:2338 if x not in default:
2336 default[x] = False2339 default[x] = False
23372340
@@ -3044,6 +3047,9 @@
3044 '''3047 '''
3045 Add the database ID of the SO line to the value sync_order_line_db_id3048 Add the database ID of the SO line to the value sync_order_line_db_id
3046 '''3049 '''
3050 if vals.get('instance_sync_order_ref'):
3051 vals['sync_sourced_origin'] = self.pool.get('sync.order.label').read(cr, uid, vals['instance_sync_order_ref'], ['name'])['name']
3052
3047 so_line_ids = super(sale_order_line, self).create(cr, uid, vals, context=context)3053 so_line_ids = super(sale_order_line, self).create(cr, uid, vals, context=context)
3048 if not vals.get('sync_order_line_db_id', False): # 'sync_order_line_db_id' not in vals or vals:3054 if not vals.get('sync_order_line_db_id', False): # 'sync_order_line_db_id' not in vals or vals:
3049 if vals.get('order_id', False):3055 if vals.get('order_id', False):
@@ -3071,6 +3077,9 @@
3071 if context is None:3077 if context is None:
3072 context = {}3078 context = {}
30733079
3080 if isinstance(ids, (int, long)):
3081 ids = [ids]
3082
3074 # UTP-392: fixed from the previous code: check if the sale order line contains the product, and not only from vals!3083 # UTP-392: fixed from the previous code: check if the sale order line contains the product, and not only from vals!
3075 product_id = vals.get('product_id')3084 product_id = vals.get('product_id')
3076 if context.get('sale_id', False):3085 if context.get('sale_id', False):
@@ -3090,6 +3099,10 @@
3090 if not 'soq_updated' in vals:3099 if not 'soq_updated' in vals:
3091 vals['soq_updated'] = False3100 vals['soq_updated'] = False
30923101
3102 if vals.get('instance_sync_order_ref'):
3103 if self.search_exists(cr, uid, [('id', 'in', ids), ('state', '=', 'draft'), ('sync_sourced_origin', '=', False)], context=context):
3104 vals['sync_sourced_origin'] = self.pool.get('sync.order.label').read(cr, uid, vals['instance_sync_order_ref'], ['name'])['name']
3105
3093 res = super(sale_order_line, self).write(cr, uid, ids, vals, context=context)3106 res = super(sale_order_line, self).write(cr, uid, ids, vals, context=context)
30943107
3095 if vals.get('stock_take_date'):3108 if vals.get('stock_take_date'):
@@ -3097,6 +3110,16 @@
30973110
3098 return res3111 return res
30993112
3113 def on_change_instance_sync_order_ref(self, cr, uid, ids, instance_sync_order_ref, context=None):
3114 if instance_sync_order_ref:
3115 return {'warning':
3116 {
3117 'title': _('Warning'),
3118 'message': _("Please ensure that you selected the correct Source document because once the line is saved you will not be able to edit this field anymore. In case of mistake, the only option will be to Cancel the line and Create a new one with the correct Source document."),
3119 }
3120 }
3121 return {}
3122
3100sale_order_line()3123sale_order_line()
31013124
31023125
31033126
=== modified file 'bin/addons/sale/sale_view.xml'
--- bin/addons/sale/sale_view.xml 2020-11-02 08:28:49 +0000
+++ bin/addons/sale/sale_view.xml 2020-12-14 17:29:06 +0000
@@ -9,6 +9,29 @@
9 <menuitem id="base.menu_product" name="Products" parent="base.menu_base_partner" sequence="9"/>9 <menuitem id="base.menu_product" name="Products" parent="base.menu_base_partner" sequence="9"/>
10 <menuitem action="product.product_normal_action" id="product.menu_products" parent="base.menu_product" sequence="1"/>10 <menuitem action="product.product_normal_action" id="product.menu_products" parent="base.menu_product" sequence="1"/>
1111
12
13 <record id="sync_order_label_tree" model="ir.ui.view">
14 <field name="name">sync.order.label.tree</field>
15 <field name="model">sync.order.label</field>
16 <field name="type">tree</field>
17 <field name="arch" type="xml">
18 <tree string="Order in sync. instance" hide_new_button="True" hide_delete_button="True">
19 <field name="name"/>
20 </tree>
21 </field>
22 </record>
23
24 <record id="sync_order_label_search" model="ir.ui.view">
25 <field name="name">sync.order.label.search</field>
26 <field name="model">sync.order.label</field>
27 <field name="type">search</field>
28 <field name="arch" type="xml">
29 <search>
30 <field name="name"/>
31 </search>
32 </field>
33 </record>
34
12 <record id="view_shop_form" model="ir.ui.view">35 <record id="view_shop_form" model="ir.ui.view">
13 <field name="name">sale.shop</field>36 <field name="name">sale.shop</field>
14 <field name="model">sale.shop</field>37 <field name="model">sale.shop</field>
@@ -189,7 +212,7 @@
189 <button name="add_multiple_lines" string="Add multiple lines" icon="gtk-add" colspan="4" type="object"/>212 <button name="add_multiple_lines" string="Add multiple lines" icon="gtk-add" colspan="4" type="object"/>
190 </group>213 </group>
191 <field name="order_line" colspan="4" mode="tree,form,graph" nolabel="1" widget="one2many_list"214 <field name="order_line" colspan="4" mode="tree,form,graph" nolabel="1" widget="one2many_list"
192 context="{'sale_id': active_id, 'pricelist_id': pricelist_id, 'categ': categ, 'partner_id': partner_id}"215 context="{'sale_id': active_id, 'pricelist_id': pricelist_id, 'categ': categ, 'partner_id': partner_id, 'fo_created_by_po_sync': fo_created_by_po_sync}"
193 on_change="order_line_change(order_line)"216 on_change="order_line_change(order_line)"
194 filter_selector="[('Show all', []), ('Hide closed', [('state', 'not in', ['done', 'cancel', 'cancel_r'])]), ('Show closed only', [('state', '=', 'done')]), ('Hide cancelled', [('state', 'not in', ['cancel', 'cancel_r'])]), ('Show cancelled only', [('state', 'in', ['cancel', 'cancel_r'])])]"217 filter_selector="[('Show all', []), ('Hide closed', [('state', 'not in', ['done', 'cancel', 'cancel_r'])]), ('Show closed only', [('state', '=', 'done')]), ('Hide cancelled', [('state', 'not in', ['cancel', 'cancel_r'])]), ('Show cancelled only', [('state', 'in', ['cancel', 'cancel_r'])])]"
195 default_selector="'3'" o2m_selectable="2"218 default_selector="'3'" o2m_selectable="2"
@@ -218,6 +241,11 @@
218 <field name="confirmed_delivery_date" attrs="{'readonly': [('so_state_stored', 'in', ('cancel','done'))]}"/>241 <field name="confirmed_delivery_date" attrs="{'readonly': [('so_state_stored', 'in', ('cancel','done'))]}"/>
219 <field name="stock_take_date"/>242 <field name="stock_take_date"/>
220 <field name="display_resourced_orig_line"/>243 <field name="display_resourced_orig_line"/>
244 <field name="sync_linked_pol" invisible="True"/>
245 <field name="sync_sourced_origin" invisible="True"/>
246 <group invisible="not context.get('fo_created_by_po_sync')" colspan="2">
247 <field name="instance_sync_order_ref" domain="[('order_id', '=', context.get('sale_id', 0))]" attrs="{'invisible': [('sync_linked_pol', '!=', False)], 'readonly': ['|', ('state', '!=', 'draft'), ('sync_sourced_origin', '!=', False)]}" on_change="on_change_instance_sync_order_ref(instance_sync_order_ref)"/>
248 </group>
221 <separator colspan="4" string="Changes"/>249 <separator colspan="4" string="Changes"/>
222 <group colspan="4">250 <group colspan="4">
223 <group colspan="2">251 <group colspan="2">
224252
=== modified file 'bin/addons/sale/sale_workflow.py'
--- bin/addons/sale/sale_workflow.py 2020-09-24 14:14:45 +0000
+++ bin/addons/sale/sale_workflow.py 2020-12-14 17:29:06 +0000
@@ -188,6 +188,7 @@
188 'is_line_split': False,188 'is_line_split': False,
189 'analytic_distribution_id': sol.analytic_distribution_id.id or False,189 'analytic_distribution_id': sol.analytic_distribution_id.id or False,
190 'ir_name_from_sync': sol.ir_name_from_sync or False,190 'ir_name_from_sync': sol.ir_name_from_sync or False,
191 'sync_sourced_origin': sol.sync_sourced_origin,
191 }192 }
192 new_sol_id = self.copy(cr, uid, sol.id, sol_vals, context=context)193 new_sol_id = self.copy(cr, uid, sol.id, sol_vals, context=context)
193 wf_service.trg_validate(uid, 'sale.order.line', new_sol_id, 'validated', cr)194 wf_service.trg_validate(uid, 'sale.order.line', new_sol_id, 'validated', cr)

Subscribers

People subscribed via source and target branches