Merge lp:~unifield-team/unifield-server/us-635 into lp:unifield-server
- us-635
- Merge into trunk
Proposed by
Quentin THEURET @Amaris
Status: | Merged |
---|---|
Merged at revision: | 4025 |
Proposed branch: | lp:~unifield-team/unifield-server/us-635 |
Merge into: | lp:unifield-server |
Diff against target: |
370 lines (+193/-9) (has conflicts) 9 files modified
bin/addons/msf_custom_settings/view/purchase_view.xml (+2/-0) bin/addons/msf_profile/data/patches.xml (+4/-0) bin/addons/msf_profile/i18n/fr_MF.po (+33/-1) bin/addons/msf_profile/msf_profile.py (+20/-0) bin/addons/purchase_override/purchase.py (+111/-5) bin/addons/purchase_override/purchase_view.xml (+2/-0) bin/addons/purchase_override/report/purchase_order.rml (+13/-2) bin/addons/res_currency_functional/order_line_view.xml (+2/-1) bin/addons/sourcing/procurement_order.py (+6/-0) Text conflict in bin/addons/msf_profile/i18n/fr_MF.po Text conflict in bin/addons/purchase_override/purchase.py |
To merge this branch: | bzr merge lp:~unifield-team/unifield-server/us-635 |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Quentin THEURET @Amaris | Pending | ||
Review via email: mp+309025@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_custom_settings/view/purchase_view.xml' | |||
2 | --- bin/addons/msf_custom_settings/view/purchase_view.xml 2016-04-19 08:57:07 +0000 | |||
3 | +++ bin/addons/msf_custom_settings/view/purchase_view.xml 2016-10-28 15:13:29 +0000 | |||
4 | @@ -40,6 +40,8 @@ | |||
5 | 40 | <field name="partner_address_id" attrs="{'readonly': [('state', 'in', ['sourced', 'split', 'rfq_sent', 'rfq_updated', 'done', 'cancel', 'confirmed_wait', 'approved', 'except_picking', 'except_invoice'])]}"/> | 40 | <field name="partner_address_id" attrs="{'readonly': [('state', 'in', ['sourced', 'split', 'rfq_sent', 'rfq_updated', 'done', 'cancel', 'confirmed_wait', 'approved', 'except_picking', 'except_invoice'])]}"/> |
6 | 41 | <field name="origin" attrs="{'readonly': [('state', 'in', ['sourced', 'split', 'rfq_sent', 'rfq_updated', 'done', 'cancel', 'confirmed', 'confirmed_wait', 'approved', 'except_picking', 'except_invoice'])]}" widget="char"/> | 41 | <field name="origin" attrs="{'readonly': [('state', 'in', ['sourced', 'split', 'rfq_sent', 'rfq_updated', 'done', 'cancel', 'confirmed', 'confirmed_wait', 'approved', 'except_picking', 'except_invoice'])]}" widget="char"/> |
7 | 42 | <field name="internal_type" string="Zone" /> | 42 | <field name="internal_type" string="Zone" /> |
8 | 43 | <field name="customer_ref" widget="char" /> | ||
9 | 44 | <label colspan="2"></label> | ||
10 | 43 | <field name="pricelist_id" string="Currency" domain="[('type', '=', 'purchase'), ('in_search', '=', partner_type)]" | 45 | <field name="pricelist_id" string="Currency" domain="[('type', '=', 'purchase'), ('in_search', '=', partner_type)]" |
11 | 44 | colspan="3" attrs="{'readonly': [('state', 'in', ['rfq_updated', 'done', 'cancel', 'confirmed_wait', 'approved', 'except_picking', 'except_invoice'])]}"/> | 46 | colspan="3" attrs="{'readonly': [('state', 'in', ['rfq_updated', 'done', 'cancel', 'confirmed_wait', 'approved', 'except_picking', 'except_invoice'])]}"/> |
12 | 45 | </group> | 47 | </group> |
13 | 46 | 48 | ||
14 | === modified file 'bin/addons/msf_profile/data/patches.xml' | |||
15 | --- bin/addons/msf_profile/data/patches.xml 2016-10-04 12:27:11 +0000 | |||
16 | +++ bin/addons/msf_profile/data/patches.xml 2016-10-28 15:13:29 +0000 | |||
17 | @@ -110,5 +110,9 @@ | |||
18 | 110 | <record id="us_1766_fix_fxa_aji_curr" model="patch.scripts"> | 110 | <record id="us_1766_fix_fxa_aji_curr" model="patch.scripts"> |
19 | 111 | <field name="method">us_1766_fix_fxa_aji_curr</field> | 111 | <field name="method">us_1766_fix_fxa_aji_curr</field> |
20 | 112 | </record> | 112 | </record> |
21 | 113 | |||
22 | 114 | <record id="us_635_dest_partner_ids" model="patch.scripts"> | ||
23 | 115 | <field name="method">us_635_dest_partner_ids</field> | ||
24 | 116 | </record> | ||
25 | 113 | </data> | 117 | </data> |
26 | 114 | </openerp> | 118 | </openerp> |
27 | 115 | 119 | ||
28 | === modified file 'bin/addons/msf_profile/i18n/fr_MF.po' | |||
29 | --- bin/addons/msf_profile/i18n/fr_MF.po 2016-10-25 09:13:52 +0000 | |||
30 | +++ bin/addons/msf_profile/i18n/fr_MF.po 2016-10-28 15:13:29 +0000 | |||
31 | @@ -53245,8 +53245,10 @@ | |||
32 | 53245 | msgid "Child Nomenclatures" | 53245 | msgid "Child Nomenclatures" |
33 | 53246 | msgstr "Nomenclatures Enfant" | 53246 | msgstr "Nomenclatures Enfant" |
34 | 53247 | 53247 | ||
36 | 53248 | #. module: product | 53248 | #. modules: sales_followup, product, res_currency_functional |
37 | 53249 | #: field:product.product,partner_ref:0 | 53249 | #: field:product.product,partner_ref:0 |
38 | 53250 | #: view:purchase.order.line:0 | ||
39 | 53251 | #: report:addons/sales_followup/report/sale_follow_up_multi_report_xls.mako:216 | ||
40 | 53250 | msgid "Customer ref" | 53252 | msgid "Customer ref" |
41 | 53251 | msgstr "Réf. Client" | 53253 | msgstr "Réf. Client" |
42 | 53252 | 53254 | ||
43 | @@ -74617,6 +74619,7 @@ | |||
44 | 74617 | " Number of columns is not equal to %s" | 74619 | " Number of columns is not equal to %s" |
45 | 74618 | msgstr "\n" | 74620 | msgstr "\n" |
46 | 74619 | " Le nombre de colonnes n'est pas égal à %s" | 74621 | " Le nombre de colonnes n'est pas égal à %s" |
47 | 74622 | <<<<<<< TREE | ||
48 | 74620 | 74623 | ||
49 | 74621 | #. module: specific_rules | 74624 | #. module: specific_rules |
50 | 74622 | #: report:addons/specific_rules/report/report_stock_inventory_all_locations_xls.mako:143 | 74625 | #: report:addons/specific_rules/report/report_stock_inventory_all_locations_xls.mako:143 |
51 | @@ -74689,3 +74692,32 @@ | |||
52 | 74689 | msgid "You can't search on this object without using at least one exact search term (precede your search with the character '=')." | 74692 | msgid "You can't search on this object without using at least one exact search term (precede your search with the character '=')." |
53 | 74690 | msgstr "Vous ne pouvez pas exécuter de recherche sur cet objet sans utiliser au moins une recherche exacte (ajoutez le caractère = devant votre filtre)." | 74693 | msgstr "Vous ne pouvez pas exécuter de recherche sur cet objet sans utiliser au moins une recherche exacte (ajoutez le caractère = devant votre filtre)." |
54 | 74691 | 74694 | ||
55 | 74695 | ======= | ||
56 | 74696 | |||
57 | 74697 | #. module: purchase_override | ||
58 | 74698 | #: field:purchase.order.line,customer_ref:0 | ||
59 | 74699 | msgid "Customer ref." | ||
60 | 74700 | msgstr "Ref. Client" | ||
61 | 74701 | |||
62 | 74702 | #. module: purchase_override | ||
63 | 74703 | #: field:purchase.order,customer_ref:0 | ||
64 | 74704 | msgid "Customer Ref." | ||
65 | 74705 | msgstr "Ref. Client" | ||
66 | 74706 | |||
67 | 74707 | #. module: purchase_override | ||
68 | 74708 | #: field:purchase.order,line_count:0 | ||
69 | 74709 | msgid "Line count" | ||
70 | 74710 | msgstr "# de lignes" | ||
71 | 74711 | |||
72 | 74712 | #. module: purchase_override | ||
73 | 74713 | #: report:msf.purchase.order:0 | ||
74 | 74714 | msgid "Source Document :" | ||
75 | 74715 | msgstr "Document source :" | ||
76 | 74716 | |||
77 | 74717 | #. module: purchase_override | ||
78 | 74718 | #: report:msf.purchase.order:0 | ||
79 | 74719 | msgid "Customer reference :" | ||
80 | 74720 | msgstr "Référence client :" | ||
81 | 74721 | |||
82 | 74722 | |||
83 | 74723 | >>>>>>> MERGE-SOURCE | ||
84 | 74692 | 74724 | ||
85 | === modified file 'bin/addons/msf_profile/msf_profile.py' | |||
86 | --- bin/addons/msf_profile/msf_profile.py 2016-10-04 12:27:11 +0000 | |||
87 | +++ bin/addons/msf_profile/msf_profile.py 2016-10-28 15:13:29 +0000 | |||
88 | @@ -891,6 +891,26 @@ | |||
89 | 891 | currency_id != %s""", (currency_id, tuple(journal_ids), currency_id)) | 891 | currency_id != %s""", (currency_id, tuple(journal_ids), currency_id)) |
90 | 892 | 892 | ||
91 | 893 | 893 | ||
92 | 894 | def us_635_dest_partner_ids(self, cr, uid, *a, **b): | ||
93 | 895 | """ | ||
94 | 896 | Fill many2many field dest_partner_ids | ||
95 | 897 | """ | ||
96 | 898 | context = {} | ||
97 | 899 | po_obj = self.pool.get('purchase.order') | ||
98 | 900 | so_obj = self.pool.get('sale.order') | ||
99 | 901 | |||
100 | 902 | po_ids = po_obj.search(cr, uid, [], context=context) | ||
101 | 903 | for po_id in po_ids: | ||
102 | 904 | so_ids = po_obj.get_so_ids_from_po_ids(cr, uid, po_id, context=context) | ||
103 | 905 | for so in so_obj.browse(cr, uid, so_ids, context=context): | ||
104 | 906 | if not so.procurement_request: | ||
105 | 907 | po_obj.write(cr, uid, po_id, { | ||
106 | 908 | 'dest_partner_ids': [(4, so.partner_id.id)], | ||
107 | 909 | }, context=context) | ||
108 | 910 | |||
109 | 911 | return True | ||
110 | 912 | |||
111 | 913 | |||
112 | 894 | patch_scripts() | 914 | patch_scripts() |
113 | 895 | 915 | ||
114 | 896 | 916 | ||
115 | 897 | 917 | ||
116 | === modified file 'bin/addons/purchase_override/purchase.py' | |||
117 | --- bin/addons/purchase_override/purchase.py 2016-10-26 07:22:24 +0000 | |||
118 | +++ bin/addons/purchase_override/purchase.py 2016-10-28 15:13:29 +0000 | |||
119 | @@ -236,12 +236,34 @@ | |||
120 | 236 | return res | 236 | return res |
121 | 237 | 237 | ||
122 | 238 | def _get_no_line(self, cr, uid, ids, field_name, args, context=None): | 238 | def _get_no_line(self, cr, uid, ids, field_name, args, context=None): |
123 | 239 | """ | ||
124 | 240 | Compute the number of Purchase order lines in each purchase order. | ||
125 | 241 | A split line is count as one line | ||
126 | 242 | :param cr: Cursor to the database | ||
127 | 243 | :param uid: ID of the res.users that calls this method | ||
128 | 244 | :param ids: List of purchase.order ID to compute | ||
129 | 245 | :param field_name: Name of the field to compute | ||
130 | 246 | :param args: Extra parameters | ||
131 | 247 | :param context: Context of the call | ||
132 | 248 | :return: A dictionnary with the purchase.order ID as keys and the number of Purchase | ||
133 | 249 | order lines for each of them as value | ||
134 | 250 | """ | ||
135 | 251 | pol_obj = self.pool.get('sale.order.line') | ||
136 | 252 | |||
137 | 253 | if context is None: | ||
138 | 254 | context = {} | ||
139 | 255 | |||
140 | 256 | if isinstance(ids, (int, long)): | ||
141 | 257 | ids = [ids] | ||
142 | 258 | |||
143 | 239 | res = {} | 259 | res = {} |
149 | 240 | for order in self.read(cr, uid, ids, ['order_line'], context=context): | 260 | |
150 | 241 | if order['order_line']: | 261 | for order_id in ids: |
151 | 242 | res[order['id']] = False | 262 | res[order_id] = pol_obj.search_count(cr, uid, [ |
152 | 243 | else: | 263 | ('order_id', '=', order_id), |
153 | 244 | res[order['id']] = True | 264 | ('is_line_split', '=', False), |
154 | 265 | ], context=context) | ||
155 | 266 | |||
156 | 245 | return res | 267 | return res |
157 | 246 | 268 | ||
158 | 247 | def _po_from_x(self, cr, uid, ids, field_names, args, context=None): | 269 | def _po_from_x(self, cr, uid, ids, field_names, args, context=None): |
159 | @@ -336,6 +358,52 @@ | |||
160 | 336 | 358 | ||
161 | 337 | return res | 359 | return res |
162 | 338 | 360 | ||
163 | 361 | def _get_customer_ref(self, cr, uid, ids, field_name, args, context=None): | ||
164 | 362 | ''' | ||
165 | 363 | Return a concatenation of the PO's customer references from the project (case of procurement request) | ||
166 | 364 | ''' | ||
167 | 365 | if isinstance(ids, (int, long)): | ||
168 | 366 | ids = [ids] | ||
169 | 367 | |||
170 | 368 | res = {} | ||
171 | 369 | so_obj = self.pool.get('sale.order') | ||
172 | 370 | for po_id in ids: | ||
173 | 371 | res[po_id] = "" | ||
174 | 372 | |||
175 | 373 | so_ids = self.get_so_ids_from_po_ids(cr, uid, po_id, context=context) | ||
176 | 374 | for so in so_obj.read(cr, uid, so_ids, ['client_order_ref'], context=context): | ||
177 | 375 | if so['client_order_ref']: | ||
178 | 376 | if res[po_id]: | ||
179 | 377 | res[po_id] += ';' | ||
180 | 378 | res[po_id] += so['client_order_ref'] | ||
181 | 379 | |||
182 | 380 | return res | ||
183 | 381 | |||
184 | 382 | def _get_line_count(self, cr, uid, ids, field_name, args, context=None): | ||
185 | 383 | ''' | ||
186 | 384 | Return the number of line(s) for the PO | ||
187 | 385 | ''' | ||
188 | 386 | pol_obj = self.pool.get('purchase.order.line') | ||
189 | 387 | |||
190 | 388 | if isinstance(ids, (int, long)): | ||
191 | 389 | ids = [ids] | ||
192 | 390 | |||
193 | 391 | line_number_by_order = {} | ||
194 | 392 | |||
195 | 393 | lines = pol_obj.search(cr, uid, [('order_id', 'in', ids)], context=context) | ||
196 | 394 | for l in pol_obj.read(cr, uid, lines, ['order_id', 'line_number'], context=context): | ||
197 | 395 | line_number_by_order.setdefault(l['order_id'][0], set()) | ||
198 | 396 | line_number_by_order[l['order_id'][0]].add(l['line_number']) | ||
199 | 397 | |||
200 | 398 | res = {} | ||
201 | 399 | for po_id, ln in line_number_by_order.iteritems(): | ||
202 | 400 | res[po_id] = len(ln) | ||
203 | 401 | |||
204 | 402 | |||
205 | 403 | return res | ||
206 | 404 | |||
207 | 405 | |||
208 | 406 | |||
209 | 339 | _columns = { | 407 | _columns = { |
210 | 340 | 'order_type': fields.selection([('regular', 'Regular'), ('donation_exp', 'Donation before expiry'), | 408 | 'order_type': fields.selection([('regular', 'Regular'), ('donation_exp', 'Donation before expiry'), |
211 | 341 | ('donation_st', 'Standard donation'), ('loan', 'Loan'), | 409 | ('donation_st', 'Standard donation'), ('loan', 'Loan'), |
212 | @@ -416,8 +484,25 @@ | |||
213 | 416 | string='Update in progress', | 484 | string='Update in progress', |
214 | 417 | readonly=True, | 485 | readonly=True, |
215 | 418 | ), | 486 | ), |
216 | 487 | <<<<<<< TREE | ||
217 | 419 | # US-1765: register the 1st call of wkf_confirm_trigger to prevent recursion error | 488 | # US-1765: register the 1st call of wkf_confirm_trigger to prevent recursion error |
218 | 420 | 'po_confirmed': fields.boolean('PO', readonly=True), | 489 | 'po_confirmed': fields.boolean('PO', readonly=True), |
219 | 490 | ======= | ||
220 | 491 | 'customer_ref': fields.function( | ||
221 | 492 | _get_customer_ref, | ||
222 | 493 | method=True, | ||
223 | 494 | string='Customer Ref.', | ||
224 | 495 | type='text', | ||
225 | 496 | store=False, | ||
226 | 497 | ), | ||
227 | 498 | 'line_count': fields.function( | ||
228 | 499 | _get_line_count, | ||
229 | 500 | method=True, | ||
230 | 501 | type='integer', | ||
231 | 502 | string="Line count", | ||
232 | 503 | store=False, | ||
233 | 504 | ), | ||
234 | 505 | >>>>>>> MERGE-SOURCE | ||
235 | 421 | } | 506 | } |
236 | 422 | 507 | ||
237 | 423 | _defaults = { | 508 | _defaults = { |
238 | @@ -3671,6 +3756,20 @@ | |||
239 | 3671 | 3756 | ||
240 | 3672 | return res | 3757 | return res |
241 | 3673 | 3758 | ||
242 | 3759 | def _get_customer_ref(self, cr, uid, ids, field_name, args, context=None): | ||
243 | 3760 | ''' | ||
244 | 3761 | Return the customer ref from "sale.order".client_order_ref | ||
245 | 3762 | ''' | ||
246 | 3763 | if isinstance(ids, (int, long)): | ||
247 | 3764 | ids = [ids] | ||
248 | 3765 | |||
249 | 3766 | res = {} | ||
250 | 3767 | for pol in self.browse(cr, uid, ids, context=context): | ||
251 | 3768 | res[pol.id] = pol.procurement_id and pol.procurement_id.sale_id and pol.procurement_id.sale_id.client_order_ref or False | ||
252 | 3769 | |||
253 | 3770 | return res | ||
254 | 3771 | |||
255 | 3772 | |||
256 | 3674 | _columns = { | 3773 | _columns = { |
257 | 3675 | 'is_line_split': fields.boolean(string='This line is a split line?'), # UTP-972: Use boolean to indicate if the line is a split line | 3774 | 'is_line_split': fields.boolean(string='This line is a split line?'), # UTP-972: Use boolean to indicate if the line is a split line |
258 | 3676 | 'merged_id': fields.many2one('purchase.order.merged.line', string='Merged line'), | 3775 | 'merged_id': fields.many2one('purchase.order.merged.line', string='Merged line'), |
259 | @@ -3712,6 +3811,13 @@ | |||
260 | 3712 | string='SoQ updated', | 3811 | string='SoQ updated', |
261 | 3713 | readonly=True, | 3812 | readonly=True, |
262 | 3714 | ), | 3813 | ), |
263 | 3814 | 'customer_ref': fields.function( | ||
264 | 3815 | _get_customer_ref, | ||
265 | 3816 | method=True, | ||
266 | 3817 | type="text", | ||
267 | 3818 | store=False, | ||
268 | 3819 | string="Customer ref.", | ||
269 | 3820 | ), | ||
270 | 3715 | } | 3821 | } |
271 | 3716 | 3822 | ||
272 | 3717 | _defaults = { | 3823 | _defaults = { |
273 | 3718 | 3824 | ||
274 | === modified file 'bin/addons/purchase_override/purchase_view.xml' | |||
275 | --- bin/addons/purchase_override/purchase_view.xml 2016-08-03 12:08:12 +0000 | |||
276 | +++ bin/addons/purchase_override/purchase_view.xml 2016-10-28 15:13:29 +0000 | |||
277 | @@ -183,7 +183,9 @@ | |||
278 | 183 | <field name="partner_id" string="Supplier" /> | 183 | <field name="partner_id" string="Supplier" /> |
279 | 184 | <field name="delivery_requested_date" /> | 184 | <field name="delivery_requested_date" /> |
280 | 185 | <field name="origin" /> | 185 | <field name="origin" /> |
281 | 186 | <field name="customer_ref"/> | ||
282 | 186 | <field name="dest_partner_names" /> | 187 | <field name="dest_partner_names" /> |
283 | 188 | <field name="line_count" /> | ||
284 | 187 | <field name="shipped_rate" widget="progressbar" /> | 189 | <field name="shipped_rate" widget="progressbar" /> |
285 | 188 | <field name="invoiced_rate" widget="progressbar" /> | 190 | <field name="invoiced_rate" widget="progressbar" /> |
286 | 189 | <field name="amount_total" /> | 191 | <field name="amount_total" /> |
287 | 190 | 192 | ||
288 | === modified file 'bin/addons/purchase_override/report/purchase_order.rml' | |||
289 | --- bin/addons/purchase_override/report/purchase_order.rml 2016-03-21 13:31:17 +0000 | |||
290 | +++ bin/addons/purchase_override/report/purchase_order.rml 2016-10-28 15:13:29 +0000 | |||
291 | @@ -93,10 +93,10 @@ | |||
292 | 93 | 93 | ||
293 | 94 | <para style="Standard">[[ setLang(objects[0].partner_id.lang) ]]</para> | 94 | <para style="Standard">[[ setLang(objects[0].partner_id.lang) ]]</para> |
294 | 95 | 95 | ||
296 | 96 | <blockTable colWidths="72.0,600.0,100.0" style="Origin"> | 96 | <blockTable colWidths="90.0,582.0,100.0" style="Origin"> |
297 | 97 | <tr> | 97 | <tr> |
298 | 98 | <td> | 98 | <td> |
300 | 99 | <para style="TextInformation">Origin ref. :</para> | 99 | <para style="TextInformation">Source Document :</para> |
301 | 100 | </td> | 100 | </td> |
302 | 101 | <td> | 101 | <td> |
303 | 102 | <para style="TextInformation">[[ getOrigin(objects[0].origin, 5)[0] ]]</para> | 102 | <para style="TextInformation">[[ getOrigin(objects[0].origin, 5)[0] ]]</para> |
304 | @@ -106,6 +106,17 @@ | |||
305 | 106 | </td> | 106 | </td> |
306 | 107 | </tr> | 107 | </tr> |
307 | 108 | <tr> | 108 | <tr> |
308 | 109 | <td> | ||
309 | 110 | <para style="TextInformation">Customer reference :</para> | ||
310 | 111 | </td> | ||
311 | 112 | <td> | ||
312 | 113 | <para style="TextInformation">[[ objects[0].customer_ref ]]</para> | ||
313 | 114 | </td> | ||
314 | 115 | <td> | ||
315 | 116 | <para style="TextInformation"> </para> | ||
316 | 117 | </td> | ||
317 | 118 | </tr> | ||
318 | 119 | <tr> | ||
319 | 109 | [[ repeatIn(getOrigin(objects[0].origin, 5)[1:], 'orig') ]] | 120 | [[ repeatIn(getOrigin(objects[0].origin, 5)[1:], 'orig') ]] |
320 | 110 | <td> | 121 | <td> |
321 | 111 | <para style="TextInformation"> </para> | 122 | <para style="TextInformation"> </para> |
322 | 112 | 123 | ||
323 | === modified file 'bin/addons/res_currency_functional/order_line_view.xml' | |||
324 | --- bin/addons/res_currency_functional/order_line_view.xml 2014-10-10 08:22:30 +0000 | |||
325 | +++ bin/addons/res_currency_functional/order_line_view.xml 2016-10-28 15:13:29 +0000 | |||
326 | @@ -83,8 +83,9 @@ | |||
327 | 83 | <field name="from_fo" invisible="1" /> | 83 | <field name="from_fo" invisible="1" /> |
328 | 84 | <field name="tender_id" invisible="1" /> | 84 | <field name="tender_id" invisible="1" /> |
329 | 85 | <group colspan="2" col="3"> | 85 | <group colspan="2" col="3"> |
331 | 86 | <field name="origin" on_change="on_change_origin(origin, procurement_id, parent.partner_type)" attrs="{'required': [('from_fo', '=', True)], 'readonly': ['|', ('tender_id', '!=', False), ('tender_line_id', '!=', False)]}" /> | 86 | <field name="origin" on_change="on_change_origin(origin, procurement_id, parent.partner_type)" attrs="{'required': [('from_fo', '=', True)], 'readonly': ['|', ('tender_id', '!=', False), ('tender_line_id', '!=', False)]}" string="Source Document" /> |
332 | 87 | <field name="select_fo" on_change="on_change_select_fo(select_fo)" nolabel="1" domain="[('state', 'in', ['sourced', 'progress']), '|', ('split_type_sale_order', '=', parent.partner_type == 'esc' and 'esc_split_sale_order' or 'local_purchase_split_sale_order'), ('procurement_request', '=', True)]" attrs="{'invisible': ['|', ('tender_id', '!=', False), ('tender_line_id', '!=', False)]}" /> | 87 | <field name="select_fo" on_change="on_change_select_fo(select_fo)" nolabel="1" domain="[('state', 'in', ['sourced', 'progress']), '|', ('split_type_sale_order', '=', parent.partner_type == 'esc' and 'esc_split_sale_order' or 'local_purchase_split_sale_order'), ('procurement_request', '=', True)]" attrs="{'invisible': ['|', ('tender_id', '!=', False), ('tender_line_id', '!=', False)]}" /> |
333 | 88 | <field name="customer_ref" string="Customer ref" widget="char" /> | ||
334 | 88 | <field name="display_sync_ref" invisible="1" /> | 89 | <field name="display_sync_ref" invisible="1" /> |
335 | 89 | <field name="instance_sync_order_ref" attrs="{'required': [('display_sync_ref', '=', True)], 'invisible': [('display_sync_ref', '=', False)]}" domain="[('order_id.name', '=', origin)]" /> | 90 | <field name="instance_sync_order_ref" attrs="{'required': [('display_sync_ref', '=', True)], 'invisible': [('display_sync_ref', '=', False)]}" domain="[('order_id.name', '=', origin)]" /> |
336 | 90 | </group> | 91 | </group> |
337 | 91 | 92 | ||
338 | === modified file 'bin/addons/sourcing/procurement_order.py' | |||
339 | --- bin/addons/sourcing/procurement_order.py 2016-08-22 13:55:25 +0000 | |||
340 | +++ bin/addons/sourcing/procurement_order.py 2016-10-28 15:13:29 +0000 | |||
341 | @@ -226,9 +226,11 @@ | |||
342 | 226 | purchase_domain.append(('pricelist_id', '=', procurement.rfq_id.pricelist_id.id)) | 226 | purchase_domain.append(('pricelist_id', '=', procurement.rfq_id.pricelist_id.id)) |
343 | 227 | 227 | ||
344 | 228 | line = None | 228 | line = None |
345 | 229 | order_customer_id = None | ||
346 | 229 | sale_line_ids = self.pool.get('sale.order.line').search(cr, uid, [('procurement_id', '=', procurement.id)], context=context) | 230 | sale_line_ids = self.pool.get('sale.order.line').search(cr, uid, [('procurement_id', '=', procurement.id)], context=context) |
347 | 230 | if sale_line_ids: | 231 | if sale_line_ids: |
348 | 231 | line = self.pool.get('sale.order.line').browse(cr, uid, sale_line_ids[0], context=context) | 232 | line = self.pool.get('sale.order.line').browse(cr, uid, sale_line_ids[0], context=context) |
349 | 233 | order_customer_id = line.order_partner_id.id | ||
350 | 232 | if line.product_id.type in ('service', 'service_recep') and not line.order_id.procurement_request: | 234 | if line.product_id.type in ('service', 'service_recep') and not line.order_id.procurement_request: |
351 | 233 | if ('order_type', '!=', 'direct') in purchase_domain: | 235 | if ('order_type', '!=', 'direct') in purchase_domain: |
352 | 234 | purchase_domain.remove(('order_type', '!=', 'direct')) | 236 | purchase_domain.remove(('order_type', '!=', 'direct')) |
353 | @@ -334,6 +336,8 @@ | |||
354 | 334 | if values.get('priority') and values['priority'] in priority_sorted.keys() and values['priority'] != po.priority: | 336 | if values.get('priority') and values['priority'] in priority_sorted.keys() and values['priority'] != po.priority: |
355 | 335 | if priority_sorted[values['priority']] < priority_sorted[po.priority]: | 337 | if priority_sorted[values['priority']] < priority_sorted[po.priority]: |
356 | 336 | write_values['priority'] = values['priority'] | 338 | write_values['priority'] = values['priority'] |
357 | 339 | if order_customer_id: | ||
358 | 340 | write_values['dest_partner_ids'] = [(4, order_customer_id)] | ||
359 | 337 | 341 | ||
360 | 338 | self.pool.get('purchase.order').write(cr, uid, purchase_ids[0], write_values, context=dict(context, import_in_progress=True)) | 342 | self.pool.get('purchase.order').write(cr, uid, purchase_ids[0], write_values, context=dict(context, import_in_progress=True)) |
361 | 339 | 343 | ||
362 | @@ -387,6 +391,8 @@ | |||
363 | 387 | values.update({'location_id': input_id, }) | 391 | values.update({'location_id': input_id, }) |
364 | 388 | if categ: | 392 | if categ: |
365 | 389 | values.update({'categ': categ}) | 393 | values.update({'categ': categ}) |
366 | 394 | if order_customer_id: | ||
367 | 395 | values['dest_partner_ids'] = [(4, order_customer_id)] | ||
368 | 390 | purchase_id = super(procurement_order, self).create_po_hook(cr, uid, ids, context=context, *args, **kwargs) | 396 | purchase_id = super(procurement_order, self).create_po_hook(cr, uid, ids, context=context, *args, **kwargs) |
369 | 391 | 397 | ||
370 | 392 | if ir_to_link: | 398 | if ir_to_link: |