Merge lp:~dorian-kemps/unifield-server/US-7816 into lp:unifield-server
- US-7816
- Merge into trunk
Proposed by
jftempo
Status: | Merged |
---|---|
Merged at revision: | 5989 |
Proposed branch: | lp:~dorian-kemps/unifield-server/US-7816 |
Merge into: | lp:unifield-server |
Diff against target: |
221 lines (+72/-7) 6 files modified
bin/addons/msf_profile/i18n/fr_MF.po (+17/-1) bin/addons/sale/sale_order.py (+3/-0) bin/addons/sales_followup/sale_followup.py (+1/-1) bin/addons/sourcing/sale_order_line.py (+31/-3) bin/addons/sourcing/wizard/multiple_sourcing.py (+19/-1) bin/addons/sourcing/wizard/multiple_sourcing_view.xml (+1/-1) |
To merge this branch: | bzr merge lp:~dorian-kemps/unifield-server/US-7816 |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
UniField Reviewer Team | Pending | ||
Review via email: mp+400177@code.launchpad.net |
Commit message
Description of the change
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_profile/i18n/fr_MF.po' | |||
2 | --- bin/addons/msf_profile/i18n/fr_MF.po 2021-02-24 09:28:37 +0000 | |||
3 | +++ bin/addons/msf_profile/i18n/fr_MF.po 2021-03-25 11:03:52 +0000 | |||
4 | @@ -52354,7 +52354,7 @@ | |||
5 | 52354 | msgid "A line must a have a quantity larger than 0.00" | 52354 | msgid "A line must a have a quantity larger than 0.00" |
6 | 52355 | msgstr "A line must a have a quantity larger than 0.00" | 52355 | msgstr "A line must a have a quantity larger than 0.00" |
7 | 52356 | 52356 | ||
9 | 52357 | #. modules: sales_followup, tender_flow, purchase, stock_override, stock_forecast, purchase_allocation_report, purchase_followup, order_types, stock, msf_supply_doc_export | 52357 | #. modules: sales_followup, tender_flow, purchase, stock_override, stock_forecast, purchase_allocation_report, purchase_followup, order_types, stock, msf_supply_doc_export, sourcing, purchase_override |
10 | 52358 | #: selection:stock.move,order_type:0 | 52358 | #: selection:stock.move,order_type:0 |
11 | 52359 | #: view:purchase.order:0 | 52359 | #: view:purchase.order:0 |
12 | 52360 | #: selection:purchase.order,order_type:0 | 52360 | #: selection:purchase.order,order_type:0 |
13 | @@ -52373,6 +52373,9 @@ | |||
14 | 52373 | #: field:supplier.performance.wizard,po_type_purchase_list:0 | 52373 | #: field:supplier.performance.wizard,po_type_purchase_list:0 |
15 | 52374 | #: code:addons/stock_override/report/report_stock_move.py:32 | 52374 | #: code:addons/stock_override/report/report_stock_move.py:32 |
16 | 52375 | #: selection:purchase.order.line,po_order_type:0 | 52375 | #: selection:purchase.order.line,po_order_type:0 |
17 | 52376 | #: selection:purchase.order.merged.line,po_order_type:0 | ||
18 | 52377 | #: selection:multiple.sourcing.wizard,po_cft:0 | ||
19 | 52378 | #: selection:sale.order.line,po_cft:0 | ||
20 | 52376 | #, python-format | 52379 | #, python-format |
21 | 52377 | msgid "Purchase List" | 52380 | msgid "Purchase List" |
22 | 52378 | msgstr "Liste d'Achats" | 52381 | msgstr "Liste d'Achats" |
23 | @@ -111894,3 +111897,16 @@ | |||
24 | 111894 | #, python-format | 111897 | #, python-format |
25 | 111895 | msgid "You must have at least one line to create the Internal Move" | 111898 | msgid "You must have at least one line to create the Internal Move" |
26 | 111896 | msgstr "Vous devez avoir au moins une ligne pour pouvoir créer le Mouvement Interne" | 111899 | msgstr "Vous devez avoir au moins une ligne pour pouvoir créer le Mouvement Interne" |
27 | 111900 | |||
28 | 111901 | #. module: sourcing | ||
29 | 111902 | #: code:addons/sourcing/sale_order_line.py:905 | ||
30 | 111903 | #, python-format | ||
31 | 111904 | msgid "You can't source with 'Purchase List' to a non-external partner." | ||
32 | 111905 | msgstr "Vous ne pouvez pas sourcer avec 'Liste d'Achats' vers un partenaire non-externe." | ||
33 | 111906 | |||
34 | 111907 | #. module: sourcing | ||
35 | 111908 | #: code:addons/sourcing/sale_order_line.py:2144 | ||
36 | 111909 | #: code:addons/sourcing/wizard/multiple_sourcing.py:461 | ||
37 | 111910 | #, python-format | ||
38 | 111911 | msgid "'Purchase List' is not allowed with a non-external partner." | ||
39 | 111912 | msgstr "'Liste d'Achats' n'est pas autorisé avec un partenaire non-externe." | ||
40 | 111897 | 111913 | ||
41 | === modified file 'bin/addons/sale/sale_order.py' | |||
42 | --- bin/addons/sale/sale_order.py 2021-01-27 17:04:50 +0000 | |||
43 | +++ bin/addons/sale/sale_order.py 2021-03-25 11:03:52 +0000 | |||
44 | @@ -3008,6 +3008,9 @@ | |||
45 | 3008 | qty = float(qty) | 3008 | qty = float(qty) |
46 | 3009 | vals.update({'product_uos_qty' : qty * product_obj.read(cr, uid, product_id, ['uos_coeff'])['uos_coeff']}) | 3009 | vals.update({'product_uos_qty' : qty * product_obj.read(cr, uid, product_id, ['uos_coeff'])['uos_coeff']}) |
47 | 3010 | 3010 | ||
48 | 3011 | if vals.get('po_cft', False) == 'pli': | ||
49 | 3012 | vals.update({'po_cft': 'po'}) | ||
50 | 3013 | |||
51 | 3011 | pricelist = False | 3014 | pricelist = False |
52 | 3012 | order_id = vals.get('order_id', False) | 3015 | order_id = vals.get('order_id', False) |
53 | 3013 | order_data = False | 3016 | order_data = False |
54 | 3014 | 3017 | ||
55 | === modified file 'bin/addons/sales_followup/sale_followup.py' | |||
56 | --- bin/addons/sales_followup/sale_followup.py 2019-09-18 14:06:52 +0000 | |||
57 | +++ bin/addons/sales_followup/sale_followup.py 2021-03-25 11:03:52 +0000 | |||
58 | @@ -737,7 +737,7 @@ | |||
59 | 737 | 'original_order_id': fields.many2one('sale.order', string='Orig. line', readonly=True), | 737 | 'original_order_id': fields.many2one('sale.order', string='Orig. line', readonly=True), |
60 | 738 | 'first_line': fields.boolean(string='First line'), | 738 | 'first_line': fields.boolean(string='First line'), |
61 | 739 | 'procure_method': fields.related('line_id', 'type', type='selection', selection=[('make_to_stock','From stock'), ('make_to_order','On order')], readonly=True, string='Proc. Method'), | 739 | 'procure_method': fields.related('line_id', 'type', type='selection', selection=[('make_to_stock','From stock'), ('make_to_order','On order')], readonly=True, string='Proc. Method'), |
63 | 740 | 'po_cft': fields.related('line_id', 'po_cft', type='selection', selection=[('po','PO'), ('dpo', 'DPO'), ('cft','CFT')], readonly=True, string='PO/CFT'), | 740 | 'po_cft': fields.related('line_id', 'po_cft', type='selection', selection=[('po','PO'), ('dpo', 'DPO'), ('cft','CFT'), ('pli', 'PLI')], readonly=True, string='PO/CFT'), |
64 | 741 | 'line_number': fields.related('line_id', 'line_number', string='Order line', readonly=True, type='integer'), | 741 | 'line_number': fields.related('line_id', 'line_number', string='Order line', readonly=True, type='integer'), |
65 | 742 | 'product_id': fields.related('line_id', 'product_id', string='Product Code', readondy=True, | 742 | 'product_id': fields.related('line_id', 'product_id', string='Product Code', readondy=True, |
66 | 743 | type='many2one', relation='product.product'), | 743 | type='many2one', relation='product.product'), |
67 | 744 | 744 | ||
68 | === modified file 'bin/addons/sourcing/sale_order_line.py' | |||
69 | --- bin/addons/sourcing/sale_order_line.py 2021-02-02 10:20:51 +0000 | |||
70 | +++ bin/addons/sourcing/sale_order_line.py 2021-03-25 11:03:52 +0000 | |||
71 | @@ -43,6 +43,7 @@ | |||
72 | 43 | ('dpo', 'Direct Purchase Order'), | 43 | ('dpo', 'Direct Purchase Order'), |
73 | 44 | ('cft', 'Tender'), | 44 | ('cft', 'Tender'), |
74 | 45 | ('rfq', 'Request for Quotation'), | 45 | ('rfq', 'Request for Quotation'), |
75 | 46 | ('pli', 'Purchase List'), | ||
76 | 46 | ] | 47 | ] |
77 | 47 | 48 | ||
78 | 48 | 49 | ||
79 | @@ -898,6 +899,12 @@ | |||
80 | 898 | _("""You can't source with 'Request for Quotation' to an internal/inter-section/intermission partner."""), | 899 | _("""You can't source with 'Request for Quotation' to an internal/inter-section/intermission partner."""), |
81 | 899 | ) | 900 | ) |
82 | 900 | 901 | ||
83 | 902 | if line.product_id and line.po_cft == 'pli' and line.supplier.partner_type != 'external': | ||
84 | 903 | raise osv.except_osv( | ||
85 | 904 | _('Warning'), | ||
86 | 905 | _("""You can't source with 'Purchase List' to a non-external partner."""), | ||
87 | 906 | ) | ||
88 | 907 | |||
89 | 901 | if line.order_id.state == 'validated' and line.order_id.order_type in ( | 908 | if line.order_id.state == 'validated' and line.order_id.order_type in ( |
90 | 902 | 'donation_st', 'donation_exp') and line.type != 'make_to_stock': | 909 | 'donation_st', 'donation_exp') and line.type != 'make_to_stock': |
91 | 903 | raise osv.except_osv( | 910 | raise osv.except_osv( |
92 | @@ -1255,6 +1262,8 @@ | |||
93 | 1255 | elif sourcing_line.po_cft == 'dpo': | 1262 | elif sourcing_line.po_cft == 'dpo': |
94 | 1256 | domain.append(('order_type', '=', 'direct')) | 1263 | domain.append(('order_type', '=', 'direct')) |
95 | 1257 | domain.append(('dest_address_id', '=', sourcing_line.order_id.partner_shipping_id.id)) | 1264 | domain.append(('dest_address_id', '=', sourcing_line.order_id.partner_shipping_id.id)) |
96 | 1265 | elif sourcing_line.po_cft == 'pli': | ||
97 | 1266 | domain.append(('order_type', '=', 'purchase_list')) | ||
98 | 1258 | 1267 | ||
99 | 1259 | # supplier's order creation mode: | 1268 | # supplier's order creation mode: |
100 | 1260 | if sourcing_line.supplier.po_by_project in ('project', 'category_project') or (sourcing_line.po_cft == 'dpo' and sourcing_line.supplier.po_by_project == 'all'): | 1269 | if sourcing_line.supplier.po_by_project in ('project', 'category_project') or (sourcing_line.po_cft == 'dpo' and sourcing_line.supplier.po_by_project == 'all'): |
101 | @@ -1360,11 +1369,11 @@ | |||
102 | 1360 | 'related_sourcing_id': sourcing_line.related_sourcing_id.id or False, | 1369 | 'related_sourcing_id': sourcing_line.related_sourcing_id.id or False, |
103 | 1361 | 'unique_fo_id': sourcing_line.order_id.id if sourcing_line.supplier.po_by_project == 'isolated' else False, | 1370 | 'unique_fo_id': sourcing_line.order_id.id if sourcing_line.supplier.po_by_project == 'isolated' else False, |
104 | 1362 | } | 1371 | } |
106 | 1363 | if sourcing_line.po_cft == 'po': # Purchase Order | 1372 | if sourcing_line.po_cft == 'po': # Purchase Order |
107 | 1364 | po_values.update({ | 1373 | po_values.update({ |
108 | 1365 | 'order_type': 'regular', | 1374 | 'order_type': 'regular', |
109 | 1366 | }) | 1375 | }) |
111 | 1367 | elif sourcing_line.po_cft == 'dpo': # Direct Purchase Order | 1376 | elif sourcing_line.po_cft == 'dpo': # Direct Purchase Order |
112 | 1368 | po_values.update({ | 1377 | po_values.update({ |
113 | 1369 | 'order_type': 'direct', | 1378 | 'order_type': 'direct', |
114 | 1370 | 'dest_partner_id': sourcing_line.order_id.partner_id.id, | 1379 | 'dest_partner_id': sourcing_line.order_id.partner_id.id, |
115 | @@ -1372,6 +1381,8 @@ | |||
116 | 1372 | }) | 1381 | }) |
117 | 1373 | #if sourcing_line.order_id.partner_id.partner_type in ('esc', 'external'): | 1382 | #if sourcing_line.order_id.partner_id.partner_type in ('esc', 'external'): |
118 | 1374 | # po_values['po_version'] = 2 # TODO NEEDED ? | 1383 | # po_values['po_version'] = 2 # TODO NEEDED ? |
119 | 1384 | elif sourcing_line.po_cft == 'pli': # Purchase List | ||
120 | 1385 | po_values.update({'order_type': 'purchase_list',}) | ||
121 | 1375 | 1386 | ||
122 | 1376 | return self.pool.get('purchase.order').create(cr, uid, po_values, context=context) | 1387 | return self.pool.get('purchase.order').create(cr, uid, po_values, context=context) |
123 | 1377 | 1388 | ||
124 | @@ -1589,7 +1600,7 @@ | |||
125 | 1589 | wf_service.trg_validate(uid, 'sale.order.line', sourcing_line.id, 'confirmed', cr) # confirmation create pick/out or INT | 1600 | wf_service.trg_validate(uid, 'sale.order.line', sourcing_line.id, 'confirmed', cr) # confirmation create pick/out or INT |
126 | 1590 | 1601 | ||
127 | 1591 | elif sourcing_line.type == 'make_to_order': | 1602 | elif sourcing_line.type == 'make_to_order': |
129 | 1592 | if sourcing_line.po_cft in ('po', 'dpo'): | 1603 | if sourcing_line.po_cft in ('po', 'dpo', 'pli'): |
130 | 1593 | po_to_use = self.get_existing_po(cr, uid, sourcing_line.id, context=context) | 1604 | po_to_use = self.get_existing_po(cr, uid, sourcing_line.id, context=context) |
131 | 1594 | if not po_to_use: # then create new PO: | 1605 | if not po_to_use: # then create new PO: |
132 | 1595 | po_to_use = self.create_po_from_sourcing_line(cr, uid, sourcing_line.id, context=context) | 1606 | po_to_use = self.create_po_from_sourcing_line(cr, uid, sourcing_line.id, context=context) |
133 | @@ -2124,6 +2135,16 @@ | |||
134 | 2124 | res['value'].update({'po_cft': 'dpo'}) | 2135 | res['value'].update({'po_cft': 'dpo'}) |
135 | 2125 | 2136 | ||
136 | 2126 | partner_id = 'supplier' in value and value['supplier'] or partner_id | 2137 | partner_id = 'supplier' in value and value['supplier'] or partner_id |
137 | 2138 | |||
138 | 2139 | if partner_id: | ||
139 | 2140 | p_type = self.pool.get('res.partner').read(cr, uid, partner_id, ['partner_type'], context=context)['partner_type'] | ||
140 | 2141 | if po_cft == 'pli' and p_type != 'external': | ||
141 | 2142 | res['warning'] = { | ||
142 | 2143 | 'title': _('Warning'), | ||
143 | 2144 | 'message': _("""'Purchase List' is not allowed with a non-external partner."""), | ||
144 | 2145 | } | ||
145 | 2146 | res['value'].update({'po_cft': 'po'}) | ||
146 | 2147 | |||
147 | 2127 | if line_id and partner_id and line.product_id: | 2148 | if line_id and partner_id and line.product_id: |
148 | 2128 | check_fnct = product_obj._on_change_restriction_error | 2149 | check_fnct = product_obj._on_change_restriction_error |
149 | 2129 | res, error = self._check_product_constraints( | 2150 | res, error = self._check_product_constraints( |
150 | @@ -2280,6 +2301,13 @@ | |||
151 | 2280 | 'message': _('The chosen partner has no address. Please define an address before continuing.'), | 2301 | 'message': _('The chosen partner has no address. Please define an address before continuing.'), |
152 | 2281 | } | 2302 | } |
153 | 2282 | 2303 | ||
154 | 2304 | # Search the local market partner id | ||
155 | 2305 | data_obj = self.pool.get('ir.model.data') | ||
156 | 2306 | data_id = data_obj.search(cr, uid, [('module', '=', 'order_types'), ('model', '=', 'res.partner'), | ||
157 | 2307 | ('name', '=', 'res_partner_local_market')], limit=1, order='NO_ORDER') | ||
158 | 2308 | if data_id and partner.id == data_obj.read(cr, uid, data_id, ['res_id'])[0]['res_id']: | ||
159 | 2309 | result['value'].update({'po_cft': 'pli'}) | ||
160 | 2310 | |||
161 | 2283 | # If the selected partner belongs to product->suppliers, we take that delay (from supplierinfo) | 2311 | # If the selected partner belongs to product->suppliers, we take that delay (from supplierinfo) |
162 | 2284 | line = self.browse(cr, uid, line_id, context=context) | 2312 | line = self.browse(cr, uid, line_id, context=context) |
163 | 2285 | delay = self.check_supplierinfo(line, partner, context=context) | 2313 | delay = self.check_supplierinfo(line, partner, context=context) |
164 | 2286 | 2314 | ||
165 | === modified file 'bin/addons/sourcing/wizard/multiple_sourcing.py' | |||
166 | --- bin/addons/sourcing/wizard/multiple_sourcing.py 2019-07-30 09:41:15 +0000 | |||
167 | +++ bin/addons/sourcing/wizard/multiple_sourcing.py 2021-03-25 11:03:52 +0000 | |||
168 | @@ -438,7 +438,7 @@ | |||
169 | 438 | }, | 438 | }, |
170 | 439 | } | 439 | } |
171 | 440 | 440 | ||
173 | 441 | def change_po_cft(self, cr, uid, ids, po_cft, context=None): | 441 | def change_po_cft(self, cr, uid, ids, po_cft, supplier_id, context=None): |
174 | 442 | """ | 442 | """ |
175 | 443 | Unset the supplier if tender is choose | 443 | Unset the supplier if tender is choose |
176 | 444 | :param cr: Cursor to the database | 444 | :param cr: Cursor to the database |
177 | @@ -451,6 +451,17 @@ | |||
178 | 451 | if po_cft == 'cft': | 451 | if po_cft == 'cft': |
179 | 452 | return {'value': {'supplier_id': False}} | 452 | return {'value': {'supplier_id': False}} |
180 | 453 | 453 | ||
181 | 454 | if supplier_id: | ||
182 | 455 | suppl_type = self.pool.get('res.partner').read(cr, uid, supplier_id, ['partner_type'], context=context)['partner_type'] | ||
183 | 456 | if po_cft == 'pli' and suppl_type != 'external': | ||
184 | 457 | return { | ||
185 | 458 | 'value': {'po_cft': False}, | ||
186 | 459 | 'warning': { | ||
187 | 460 | 'title': _('Warning'), | ||
188 | 461 | 'message': _("""You can't source with 'Purchase List' to a non-external partner."""), | ||
189 | 462 | }, | ||
190 | 463 | } | ||
191 | 464 | |||
192 | 454 | return {} | 465 | return {} |
193 | 455 | 466 | ||
194 | 456 | def change_supplier(self, cr, uid, ids, supplier, l_type, context=None): | 467 | def change_supplier(self, cr, uid, ids, supplier, l_type, context=None): |
195 | @@ -486,6 +497,13 @@ | |||
196 | 486 | 'supplier_type': partner and partner.partner_type or False, | 497 | 'supplier_type': partner and partner.partner_type or False, |
197 | 487 | 'supplier_split_po': partner and partner.split_po or False, | 498 | 'supplier_split_po': partner and partner.split_po or False, |
198 | 488 | }) | 499 | }) |
199 | 500 | |||
200 | 501 | # Search the local market partner id | ||
201 | 502 | data_obj = self.pool.get('ir.model.data') | ||
202 | 503 | data_id = data_obj.search(cr, uid, [('module', '=', 'order_types'), ('model', '=', 'res.partner'), | ||
203 | 504 | ('name', '=', 'res_partner_local_market')], limit=1, order='NO_ORDER') | ||
204 | 505 | if data_id and partner.id == data_obj.read(cr, uid, data_id, ['res_id'])[0]['res_id']: | ||
205 | 506 | result['value'].update({'po_cft': 'pli'}) | ||
206 | 489 | else: | 507 | else: |
207 | 490 | result['value'].update({ | 508 | result['value'].update({ |
208 | 491 | 'supplier_type': False, | 509 | 'supplier_type': False, |
209 | 492 | 510 | ||
210 | === modified file 'bin/addons/sourcing/wizard/multiple_sourcing_view.xml' | |||
211 | --- bin/addons/sourcing/wizard/multiple_sourcing_view.xml 2019-06-07 12:15:15 +0000 | |||
212 | +++ bin/addons/sourcing/wizard/multiple_sourcing_view.xml 2021-03-25 11:03:52 +0000 | |||
213 | @@ -20,7 +20,7 @@ | |||
214 | 20 | <field name="type" | 20 | <field name="type" |
215 | 21 | on_change="change_type(line_ids, type, supplier)"/> | 21 | on_change="change_type(line_ids, type, supplier)"/> |
216 | 22 | <field name="po_cft" attrs="{'readonly': [('type', '=', 'make_to_stock')]}" | 22 | <field name="po_cft" attrs="{'readonly': [('type', '=', 'make_to_stock')]}" |
218 | 23 | on_change="change_po_cft(po_cft)"/> | 23 | on_change="change_po_cft(po_cft, supplier_id)"/> |
219 | 24 | <field name="run_scheduler" /> | 24 | <field name="run_scheduler" /> |
220 | 25 | <separator colspan="4" string="Supplier selection" /> | 25 | <separator colspan="4" string="Supplier selection" /> |
221 | 26 | <field name="supplier_id" | 26 | <field name="supplier_id" |