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

Proposed by jftempo
Status: Merged
Merged at revision: 5803
Proposed branch: lp:~jfb-tempo-consulting/unifield-server/US-7815
Merge into: lp:unifield-server
Diff against target: 105 lines (+31/-23)
3 files modified
bin/addons/msf_doc_import/wizard/wiz_common_import.py (+28/-20)
bin/addons/msf_doc_import/wizard/wizard_import_fo_line.py (+1/-1)
bin/addons/msf_doc_import/wizard/wizard_import_fo_line.xml (+2/-2)
To merge this branch: bzr merge lp:~jfb-tempo-consulting/unifield-server/US-7815
Reviewer Review Type Date Requested Status
UniField Reviewer Team Pending
Review via email: mp+389798@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_doc_import/wizard/wiz_common_import.py'
2--- bin/addons/msf_doc_import/wizard/wiz_common_import.py 2020-02-10 17:16:32 +0000
3+++ bin/addons/msf_doc_import/wizard/wiz_common_import.py 2020-08-25 15:55:46 +0000
4@@ -389,23 +389,28 @@
5 'product_qty': p_data['import_product_qty'],
6 'old_price_unit': p_data['standard_price'],}
7
8- values.update(self.product_id_on_change(cr, uid, False,
9- po_data['pricelist_id'][0], # Pricelist
10- values['product_id'], # Product
11- p_data['import_product_qty'], # Product Qty - Use 1.00 to compute the price according to supplier catalogue
12- values['product_uom'], # UoM
13- po_data['partner_id'][0], # Supplier
14- po_data['date_order'], # Date order
15- po_data['fiscal_position'], # Fiscal position
16- po_data['date_order'], # Date planned
17- '', # Name
18- values['price_unit'], # Price unit
19- '', # Notes
20- po_data['state'], # State
21- values['old_price_unit'], # Old price unit
22- False, # Nomen_manda_0
23- '', # Comment
24- context=context).get('value', {}))
25+ product_id_on_change = self.product_id_on_change(cr, uid, False,
26+ po_data['pricelist_id'][0], # Pricelist
27+ values['product_id'], # Product
28+ p_data['import_product_qty'], # Product Qty - Use 1.00 to compute the price according to supplier catalogue
29+ values['product_uom'], # UoM
30+ po_data['partner_id'][0], # Supplier
31+ po_data['date_order'], # Date order
32+ po_data['fiscal_position'], # Fiscal position
33+ po_data['date_order'], # Date planned
34+ '', # Name
35+ values['price_unit'], # Price unit
36+ '', # Notes
37+ po_data['state'], # State
38+ values['old_price_unit'], # Old price unit
39+ False, # Nomen_manda_0
40+ '', # Comment
41+ context=context)
42+ if product_id_on_change.get('warning', {}).get('message') and 'product_id' in product_id_on_change.get('value', {}) and not product_id_on_change['value']['product_id']:
43+ # warning is raised and product_id is removed
44+ raise osv.except_osv(_('Warning'), product_id_on_change['warning']['message'])
45+
46+ values.update(product_id_on_change.get('value', {}))
47 # Set the quantity to 0.00
48 values.update({'product_qty': p_data['import_product_qty']})
49
50@@ -532,9 +537,11 @@
51 'product_uom': p_data['uom_id'][0]}
52
53 if order_data['procurement_request']:
54- values.update(self.requested_product_id_change(cr, uid, False,
55- p_data['id'],
56- '').get('value', {}))
57+ product_id_change = self.requested_product_id_change(cr, uid, False, p_data['id'], '')
58+ if product_id_change.get('warning', {}).get('message') and 'product_id' in product_id_change.get('value', {}) and not product_id_change['value']['product_id']:
59+ # warning is raised and product_id is removed
60+ raise osv.except_osv(_('Warning'), product_id_change['warning']['message'])
61+ values.update(product_id_change.get('value', {}))
62 else:
63 values.update(self.product_id_on_change(cr, uid, False, order_data['pricelist_id'][0],
64 p_data['id'],
65@@ -596,6 +603,7 @@
66 'pricelist': order.pricelist_id.id,
67 'warehouse': order.warehouse_id.id,
68 'categ': order.categ,
69+ 'sale_id': order.id,
70 }
71 context.update(context_update)
72
73
74=== modified file 'bin/addons/msf_doc_import/wizard/wizard_import_fo_line.py'
75--- bin/addons/msf_doc_import/wizard/wizard_import_fo_line.py 2019-12-05 09:11:26 +0000
76+++ bin/addons/msf_doc_import/wizard/wizard_import_fo_line.py 2020-08-25 15:55:46 +0000
77@@ -260,7 +260,7 @@
78
79 # Check product restrictions
80 if p_value.get('default_code') and fo_browse.partner_id:
81- product_obj._get_restriction_error(cr, uid, [p_value['default_code']], {'partner_id': fo_browse.partner_id.id}, context=dict(context, noraise=False))
82+ product_obj._get_restriction_error(cr, uid, [p_value['default_code']], {'partner_id': fo_browse.partner_id.id, 'obj_type': 'sale.order'}, context=dict(context, noraise=False))
83
84 # write order line on FO
85 vals['order_line'].append((0, 0, to_write))
86
87=== modified file 'bin/addons/msf_doc_import/wizard/wizard_import_fo_line.xml'
88--- bin/addons/msf_doc_import/wizard/wizard_import_fo_line.xml 2013-03-13 16:24:00 +0000
89+++ bin/addons/msf_doc_import/wizard/wizard_import_fo_line.xml 2020-08-25 15:55:46 +0000
90@@ -17,7 +17,7 @@
91 attrs="{'invisible':[('import_error_ok', '!=', False), ('state', '!=', 'done')]}"/>
92
93 <separator colspan="12" string="Information" />
94- <field name="message" colspan="4" nolabel="1" />
95+ <field name="message" colspan="4" nolabel="1" widget="full_text"/>
96 <group name="buttons" string="" colspan="24" col="6">
97 <button name="cancel" string="Cancel" icon="gtk-cancel" type="object"
98 attrs="{'invisible':[('state', '!=', 'draft')]}"/>
99@@ -35,4 +35,4 @@
100 </record>
101
102 </data>
103-</openerp>
104\ No newline at end of file
105+</openerp>

Subscribers

People subscribed via source and target branches