Merge lp:~unifield-team/unifield-wm/qt-us-first-pack into lp:unifield-wm
- qt-us-first-pack
- Merge into trunk
Proposed by
jftempo
Status: | Needs review |
---|---|
Proposed branch: | lp:~unifield-team/unifield-wm/qt-us-first-pack |
Merge into: | lp:unifield-wm |
Diff against target: |
733 lines (+224/-102) 11 files modified
msf_partner/partner.py (+20/-0) msf_supply_doc_export/msf_supply_doc_export.py (+19/-4) msf_supply_doc_export/report/report_po_follow_up_xls.mako (+14/-10) sale_override/sale.py (+10/-0) sourcing/sale_order_line.py (+11/-26) sourcing/wizard/multiple_sourcing.py (+11/-11) sourcing/wizard/multiple_sourcing_view.xml (+7/-18) stock_override/report/internal_move.rml (+34/-11) unifield_tests/master_data/070_products.yml (+10/-10) unifield_tests/tests/test_fo.py (+76/-0) unifield_tests/tests/test_uftp_324.py (+12/-12) |
To merge this branch: | bzr merge lp:~unifield-team/unifield-wm/qt-us-first-pack |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
UniField Reviewer Team | Pending | ||
Review via email: mp+252713@code.launchpad.net |
Commit message
Description of the change
To post a comment you must log in.
Unmerged revisions
- 2409. By Quentin THEURET @Amaris
-
US-31 [FIX] On multiple line OST, the supplier can not be choosen
- 2408. By Quentin THEURET @Amaris
-
US-16 [FIX] Fix overlapping of origin value
- 2407. By Quentin THEURET @Amaris
-
US-34 [FIX] Put the modification on all reported lines
- 2406. By Quentin THEURET @Amaris
-
US-31 [MERGE] Merge code of US-31 - lp:~unifield-team/unifield-wm/us-31
- 2405. By Quentin THEURET @Amaris
-
US-16 [MERGE] Merge code of US-16 - lp:~unifield-team/unifield-wm/us-16
- 2404. By Quentin THEURET @Amaris
-
US-34 [MERGE] Merge code of US-34 - lp:~unifield-team/unifield-wm/us-34
- 2403. By Quentin THEURET @Amaris
-
US-66 [MERGE] Merge code of US-66 - lp:~unifield-team/unifield-wm/us-66
- 2402. By Quentin THEURET @Amaris
-
US-77 [MERGE] Merge code of US-77 - lp:~unifield-team/unifield-wm/us-77
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file 'msf_partner/partner.py' | |||
2 | --- msf_partner/partner.py 2015-02-06 11:07:42 +0000 | |||
3 | +++ msf_partner/partner.py 2015-03-12 10:44:53 +0000 | |||
4 | @@ -215,6 +215,26 @@ | |||
5 | 215 | view_load=True, | 215 | view_load=True, |
6 | 216 | required=True, | 216 | required=True, |
7 | 217 | help="This currency will be used, instead of the default one, for field orders to the current partner"), | 217 | help="This currency will be used, instead of the default one, for field orders to the current partner"), |
8 | 218 | 'property_stock_customer': fields.property( | ||
9 | 219 | 'stock.location', | ||
10 | 220 | type='many2one', | ||
11 | 221 | relation='stock.location', | ||
12 | 222 | string='Customer Location', | ||
13 | 223 | method=True, | ||
14 | 224 | view_load=True, | ||
15 | 225 | required=True, | ||
16 | 226 | help="This stock location will be used, instead of the default one, as the destination location for goods you send to this partner.", | ||
17 | 227 | ), | ||
18 | 228 | 'property_stock_supplier': fields.property( | ||
19 | 229 | 'stock.location', | ||
20 | 230 | type='many2one', | ||
21 | 231 | relation='stock.location', | ||
22 | 232 | string='Supplier Location', | ||
23 | 233 | method=True, | ||
24 | 234 | view_load=True, | ||
25 | 235 | required=True, | ||
26 | 236 | help="This stock location will be used, instead of the default one, as the source location for goods you receive from the current partner.", | ||
27 | 237 | ), | ||
28 | 218 | 'price_unit': fields.function(_get_price_info, method=True, type='float', string='Unit price', multi='info'), | 238 | 'price_unit': fields.function(_get_price_info, method=True, type='float', string='Unit price', multi='info'), |
29 | 219 | 'valide_until_date' : fields.function(_get_price_info, method=True, type='char', string='Valid until date', multi='info'), | 239 | 'valide_until_date' : fields.function(_get_price_info, method=True, type='char', string='Valid until date', multi='info'), |
30 | 220 | 'price_currency': fields.function(_get_price_info, method=True, type='many2one', relation='res.currency', string='Currency', multi='info'), | 240 | 'price_currency': fields.function(_get_price_info, method=True, type='many2one', relation='res.currency', string='Currency', multi='info'), |
31 | 221 | 241 | ||
32 | === modified file 'msf_supply_doc_export/msf_supply_doc_export.py' | |||
33 | --- msf_supply_doc_export/msf_supply_doc_export.py 2014-11-14 10:45:42 +0000 | |||
34 | +++ msf_supply_doc_export/msf_supply_doc_export.py 2015-03-12 10:44:53 +0000 | |||
35 | @@ -383,9 +383,6 @@ | |||
36 | 383 | def getRunParmsRML(self,key): | 383 | def getRunParmsRML(self,key): |
37 | 384 | return self.datas['report_parms'][key] | 384 | return self.datas['report_parms'][key] |
38 | 385 | 385 | ||
39 | 386 | def getPOLineHeaders(self): | ||
40 | 387 | return ['Item','Code','Description','Qty ordered','UoM','Qty received','IN','Qty backorder','Unit Price','IN unit price','Destination','Cost Center'] | ||
41 | 388 | |||
42 | 389 | def printAnalyticLines(self, analytic_lines): | 386 | def printAnalyticLines(self, analytic_lines): |
43 | 390 | res = [] | 387 | res = [] |
44 | 391 | # if additional analytic lines print them here. | 388 | # if additional analytic lines print them here. |
45 | @@ -412,12 +409,14 @@ | |||
46 | 412 | # TODO the multiplier is the value populated for no change in stock_move.price_unit | 409 | # TODO the multiplier is the value populated for no change in stock_move.price_unit |
47 | 413 | # TODO it probably should be 1 | 410 | # TODO it probably should be 1 |
48 | 414 | multiplier = 1.0000100000000001 | 411 | multiplier = 1.0000100000000001 |
49 | 412 | po_obj = self.pool.get('purchase.order') | ||
50 | 415 | pol_obj = self.pool.get('purchase.order.line') | 413 | pol_obj = self.pool.get('purchase.order.line') |
51 | 416 | prod_obj = self.pool.get('product.product') | 414 | prod_obj = self.pool.get('product.product') |
52 | 417 | uom_obj = self.pool.get('product.uom') | 415 | uom_obj = self.pool.get('product.uom') |
53 | 418 | po_line_ids = pol_obj.search(self.cr, self.uid, [('order_id','=',po_id)], order='line_number') | 416 | po_line_ids = pol_obj.search(self.cr, self.uid, [('order_id','=',po_id)], order='line_number') |
54 | 419 | po_lines = pol_obj.browse(self.cr, self.uid, po_line_ids) | 417 | po_lines = pol_obj.browse(self.cr, self.uid, po_line_ids) |
55 | 420 | report_lines = [] | 418 | report_lines = [] |
56 | 419 | order = po_obj.browse(self.cr, self.uid, po_id) | ||
57 | 421 | for line in po_lines: | 420 | for line in po_lines: |
58 | 422 | in_lines = self.getAllLineIN(line.id) | 421 | in_lines = self.getAllLineIN(line.id) |
59 | 423 | analytic_lines = self.getAnalyticLines(line) | 422 | analytic_lines = self.getAnalyticLines(line) |
60 | @@ -438,6 +437,10 @@ | |||
61 | 438 | # Display information of the initial reception | 437 | # Display information of the initial reception |
62 | 439 | if not same_product_same_uom: | 438 | if not same_product_same_uom: |
63 | 440 | report_line = { | 439 | report_line = { |
64 | 440 | 'order_ref': order.name or '', | ||
65 | 441 | 'order_created': order.date_order or '', | ||
66 | 442 | 'order_confirmed_date': order.delivery_confirmed_date or '', | ||
67 | 443 | 'order_status': self._get_states().get(order.state, ''), | ||
68 | 441 | 'item': line.line_number or '', | 444 | 'item': line.line_number or '', |
69 | 442 | 'code': line.product_id.default_code or '', | 445 | 'code': line.product_id.default_code or '', |
70 | 443 | 'description': line.product_id.name or '', | 446 | 'description': line.product_id.name or '', |
71 | @@ -457,6 +460,10 @@ | |||
72 | 457 | 460 | ||
73 | 458 | for spsul in same_product_same_uom: | 461 | for spsul in same_product_same_uom: |
74 | 459 | report_line = { | 462 | report_line = { |
75 | 463 | 'order_ref': order.name or '', | ||
76 | 464 | 'order_created': order.date_order or '', | ||
77 | 465 | 'order_confirmed_date': order.delivery_confirmed_date or '', | ||
78 | 466 | 'order_status': self._get_states().get(order.state, ''), | ||
79 | 460 | 'item': first_line and line.line_number or '', | 467 | 'item': first_line and line.line_number or '', |
80 | 461 | 'code': first_line and line.product_id.default_code or '', | 468 | 'code': first_line and line.product_id.default_code or '', |
81 | 462 | 'description': first_line and line.product_id.name or '', | 469 | 'description': first_line and line.product_id.name or '', |
82 | @@ -481,6 +488,10 @@ | |||
83 | 481 | 488 | ||
84 | 482 | for spl in same_product: | 489 | for spl in same_product: |
85 | 483 | report_line = { | 490 | report_line = { |
86 | 491 | 'order_ref': order.name or '', | ||
87 | 492 | 'order_created': order.date_order or '', | ||
88 | 493 | 'order_confirmed_date': order.delivery_confirmed_date or '', | ||
89 | 494 | 'order_status': self._get_states().get(order.state, ''), | ||
90 | 484 | 'item': first_line and line.line_number or '', | 495 | 'item': first_line and line.line_number or '', |
91 | 485 | 'code': first_line and line.product_id.default_code or '', | 496 | 'code': first_line and line.product_id.default_code or '', |
92 | 486 | 'description': first_line and line.product_id.name or '', | 497 | 'description': first_line and line.product_id.name or '', |
93 | @@ -505,6 +516,10 @@ | |||
94 | 505 | for ol in other_product: | 516 | for ol in other_product: |
95 | 506 | prod_brw = prod_obj.browse(self.cr, self.uid, ol.get('product_id')) | 517 | prod_brw = prod_obj.browse(self.cr, self.uid, ol.get('product_id')) |
96 | 507 | report_line = { | 518 | report_line = { |
97 | 519 | 'order_ref': order.name or '', | ||
98 | 520 | 'order_created': order.date_order or '', | ||
99 | 521 | 'order_confirmed_date': order.delivery_confirmed_date or '', | ||
100 | 522 | 'order_status': self._get_states().get(order.state, ''), | ||
101 | 508 | 'item': line.line_number or '', | 523 | 'item': line.line_number or '', |
102 | 509 | 'code': prod_brw.default_code or '', | 524 | 'code': prod_brw.default_code or '', |
103 | 510 | 'description': prod_brw.name or '', | 525 | 'description': prod_brw.name or '', |
104 | @@ -560,7 +575,7 @@ | |||
105 | 560 | return self.datas.get('report_header')[1] | 575 | return self.datas.get('report_header')[1] |
106 | 561 | 576 | ||
107 | 562 | def getPOLineHeaders(self): | 577 | def getPOLineHeaders(self): |
109 | 563 | return ['Item','Code','Description','Qty ordered','UoM','Qty received','IN','Qty backorder','Unit Price','IN unit price','Destination','Cost Center'] | 578 | return ['Order Ref', 'Item','Code','Description','Qty ordered','UoM','Qty received','IN','Qty backorder','Unit Price','IN unit price', 'Created', 'Confirmed Delivery', 'Status', 'Destination','Cost Center'] |
110 | 564 | 579 | ||
111 | 565 | 580 | ||
112 | 566 | 581 | ||
113 | 567 | 582 | ||
114 | === modified file 'msf_supply_doc_export/report/report_po_follow_up_xls.mako' | |||
115 | --- msf_supply_doc_export/report/report_po_follow_up_xls.mako 2014-11-07 10:52:52 +0000 | |||
116 | +++ msf_supply_doc_export/report/report_po_follow_up_xls.mako 2015-03-12 10:44:53 +0000 | |||
117 | @@ -81,6 +81,8 @@ | |||
118 | 81 | ## definition of the columns' size | 81 | ## definition of the columns' size |
119 | 82 | <% nb_of_columns = 12 %> | 82 | <% nb_of_columns = 12 %> |
120 | 83 | <Table x:FullColumns="1" x:FullRows="1"> | 83 | <Table x:FullColumns="1" x:FullRows="1"> |
121 | 84 | # Order name | ||
122 | 85 | <Column ss:AutoFitWidth="1" ss:Width="65" /> | ||
123 | 84 | # Item | 86 | # Item |
124 | 85 | <Column ss:AutoFitWidth="1" ss:Width="40" /> | 87 | <Column ss:AutoFitWidth="1" ss:Width="40" /> |
125 | 86 | # Code | 88 | # Code |
126 | @@ -101,6 +103,12 @@ | |||
127 | 101 | <Column ss:AutoFitWidth="1" ss:Width="95" /> | 103 | <Column ss:AutoFitWidth="1" ss:Width="95" /> |
128 | 102 | # IN Unit Price | 104 | # IN Unit Price |
129 | 103 | <Column ss:AutoFitWidth="1" ss:Width="95" /> | 105 | <Column ss:AutoFitWidth="1" ss:Width="95" /> |
130 | 106 | # Created (order) | ||
131 | 107 | <Columns ss:AutoFitWidth="1" ss:Width="95" /> | ||
132 | 108 | # Delivery Confirmed (order) | ||
133 | 109 | <Columns ss:AutoFitWidth="1" ss:Width="95" /> | ||
134 | 110 | # Status (order) | ||
135 | 111 | <Columns ss:AutoFitWidth="1" ss:Width="95" /> | ||
136 | 104 | # Destination | 112 | # Destination |
137 | 105 | <Column ss:AutoFitWidth="1" ss:Width="95" /> | 113 | <Column ss:AutoFitWidth="1" ss:Width="95" /> |
138 | 106 | # Cost Center | 114 | # Cost Center |
139 | @@ -116,16 +124,6 @@ | |||
140 | 116 | <Cell ss:MergeAcross="1" ss:StyleID="mainheader"><Data ss:Type="String">Supplier: ${getRunParms()['supplier'] or '' |x}</Data></Cell> | 124 | <Cell ss:MergeAcross="1" ss:StyleID="mainheader"><Data ss:Type="String">Supplier: ${getRunParms()['supplier'] or '' |x}</Data></Cell> |
141 | 117 | <Cell ss:MergeAcross="2" ss:StyleID="mainheader"><Data ss:Type="String">PO State: ${getRunParms()['state'] or '' | x}</Data></Cell> | 125 | <Cell ss:MergeAcross="2" ss:StyleID="mainheader"><Data ss:Type="String">PO State: ${getRunParms()['state'] or '' | x}</Data></Cell> |
142 | 118 | </Row> | 126 | </Row> |
143 | 119 | <Row></Row> | ||
144 | 120 | <Row></Row> | ||
145 | 121 | |||
146 | 122 | % for o in objects: | ||
147 | 123 | |||
148 | 124 | <Row ss:AutoFitHeight="0" ss:Height="36"> | ||
149 | 125 | % for header in getHeaderLine(o): | ||
150 | 126 | <Cell ss:MergeAcross="1" ss:StyleID="poheader"><Data ss:Type="String">${header |x}</Data></Cell> | ||
151 | 127 | % endfor | ||
152 | 128 | </Row> | ||
153 | 129 | 127 | ||
154 | 130 | <Row ss:AutoFitHeight="1" > | 128 | <Row ss:AutoFitHeight="1" > |
155 | 131 | % for header in getPOLineHeaders(): | 129 | % for header in getPOLineHeaders(): |
156 | @@ -133,8 +131,11 @@ | |||
157 | 133 | % endfor | 131 | % endfor |
158 | 134 | </Row> | 132 | </Row> |
159 | 135 | 133 | ||
160 | 134 | % for o in objects: | ||
161 | 135 | |||
162 | 136 | % for line in getPOLines(o.id): | 136 | % for line in getPOLines(o.id): |
163 | 137 | <Row ss:AutoFitHeight="1"> | 137 | <Row ss:AutoFitHeight="1"> |
164 | 138 | <Cell ss:StyleID="line"><Data ss:Type="String">${(line['order_ref'])|x}</Data></Cell> | ||
165 | 138 | <Cell ss:StyleID="line"><Data ss:Type="Number">${(line['item'])|x}</Data></Cell> | 139 | <Cell ss:StyleID="line"><Data ss:Type="Number">${(line['item'])|x}</Data></Cell> |
166 | 139 | <Cell ss:StyleID="line"><Data ss:Type="String">${(line['code'])|x}</Data></Cell> | 140 | <Cell ss:StyleID="line"><Data ss:Type="String">${(line['code'])|x}</Data></Cell> |
167 | 140 | <Cell ss:StyleID="line"><Data ss:Type="String">${(line['description'])|x}</Data></Cell> | 141 | <Cell ss:StyleID="line"><Data ss:Type="String">${(line['description'])|x}</Data></Cell> |
168 | @@ -145,6 +146,9 @@ | |||
169 | 145 | <Cell ss:StyleID="line"><Data ss:Type="Number">${(line['qty_backordered'])|x}</Data></Cell> | 146 | <Cell ss:StyleID="line"><Data ss:Type="Number">${(line['qty_backordered'])|x}</Data></Cell> |
170 | 146 | <Cell ss:StyleID="line"><Data ss:Type="Number">${(line['unit_price'])|x}</Data></Cell> | 147 | <Cell ss:StyleID="line"><Data ss:Type="Number">${(line['unit_price'])|x}</Data></Cell> |
171 | 147 | <Cell ss:StyleID="line"><Data ss:Type="Number">${(line['in_unit_price'])|x}</Data></Cell> | 148 | <Cell ss:StyleID="line"><Data ss:Type="Number">${(line['in_unit_price'])|x}</Data></Cell> |
172 | 149 | <Cell ss:StyleID="line"><Data ss:Type="String">${(line['order_created'])|x}</Data></Cell> | ||
173 | 150 | <Cell ss:StyleID="line"><Data ss:Type="String">${(line['order_confirmed_date'])|x}</Data></Cell> | ||
174 | 151 | <Cell ss:StyleID="line"><Data ss:Type="String">${(line['order_status'])|x}</Data></Cell> | ||
175 | 148 | <Cell ss:StyleID="line"><Data ss:Type="String">${(line['destination'])|x}</Data></Cell> | 152 | <Cell ss:StyleID="line"><Data ss:Type="String">${(line['destination'])|x}</Data></Cell> |
176 | 149 | <Cell ss:StyleID="line"><Data ss:Type="String">${(line['cost_centre'])|x}</Data></Cell> | 153 | <Cell ss:StyleID="line"><Data ss:Type="String">${(line['cost_centre'])|x}</Data></Cell> |
177 | 150 | </Row> | 154 | </Row> |
178 | 151 | 155 | ||
179 | === modified file 'sale_override/sale.py' | |||
180 | --- sale_override/sale.py 2015-01-28 17:26:00 +0000 | |||
181 | +++ sale_override/sale.py 2015-03-12 10:44:53 +0000 | |||
182 | @@ -855,6 +855,16 @@ | |||
183 | 855 | # 1/ Check validity of analytic distribution | 855 | # 1/ Check validity of analytic distribution |
184 | 856 | self.analytic_distribution_checks(cr, uid, order_brw_list) | 856 | self.analytic_distribution_checks(cr, uid, order_brw_list) |
185 | 857 | 857 | ||
186 | 858 | no_price_lines = line_obj.search(cr, uid, [ | ||
187 | 859 | ('order_id', '=', ids), | ||
188 | 860 | ('price_unit', '=', 0.00), | ||
189 | 861 | ]) | ||
190 | 862 | if no_price_lines: | ||
191 | 863 | raise osv.except_osv( | ||
192 | 864 | _('Warning'), | ||
193 | 865 | _('FO cannot be validated as line cannot have unit price of zero.'), | ||
194 | 866 | ) | ||
195 | 867 | |||
196 | 858 | for order in order_brw_list: | 868 | for order in order_brw_list: |
197 | 859 | # 2/ Check if there is lines in order | 869 | # 2/ Check if there is lines in order |
198 | 860 | if len(order.order_line) < 1: | 870 | if len(order.order_line) < 1: |
199 | 861 | 871 | ||
200 | === modified file 'sourcing/sale_order_line.py' | |||
201 | --- sourcing/sale_order_line.py 2014-10-22 08:44:42 +0000 | |||
202 | +++ sourcing/sale_order_line.py 2015-03-12 10:44:53 +0000 | |||
203 | @@ -48,32 +48,6 @@ | |||
204 | 48 | _inherit = 'sale.order.line' | 48 | _inherit = 'sale.order.line' |
205 | 49 | _description = 'Sales Order Line' | 49 | _description = 'Sales Order Line' |
206 | 50 | 50 | ||
207 | 51 | def fields_view_get(self, cr, uid, view_id=None, view_type='form', context=None, toolbar=False, submenu=False): | ||
208 | 52 | if context is None: | ||
209 | 53 | context = {} | ||
210 | 54 | |||
211 | 55 | ''' | ||
212 | 56 | !!!!! ATTENTION ATTENTION!!!!!! | ||
213 | 57 | UTP-1021: This solution is NOT stable and could be dangerous!!!! | ||
214 | 58 | need to have a proper fix for this, | ||
215 | 59 | currently we have only 3 tree views for sale.order.line | ||
216 | 60 | so I use the value in the context to identify that it is not the | ||
217 | 61 | view of wizard, but this assumption could be totally WRONG! | ||
218 | 62 | But in this current version, it works! | ||
219 | 63 | ''' | ||
220 | 64 | if not context.get('search_default_need_sourcing', False) and \ | ||
221 | 65 | view_type == 'tree': | ||
222 | 66 | if '_terp_view_name' in context: | ||
223 | 67 | ''' | ||
224 | 68 | UFTP-346: HACK ON HACK UTP-1021 | ||
225 | 69 | '_terp_view_name' not set if grouping | ||
226 | 70 | and we do not want special view when grouping | ||
227 | 71 | ''' | ||
228 | 72 | view_id = self.pool.get('ir.model.data').get_object_reference( | ||
229 | 73 | cr, uid, 'sourcing', 'sourcing_line_special_tree_view')[1] | ||
230 | 74 | return super(sale_order_line, self).fields_view_get(cr, uid, view_id, | ||
231 | 75 | view_type, context, toolbar, submenu) | ||
232 | 76 | |||
233 | 77 | """ | 51 | """ |
234 | 78 | Other methods | 52 | Other methods |
235 | 79 | """ | 53 | """ |
236 | @@ -1047,6 +1021,17 @@ | |||
237 | 1047 | _('A location must be chosen before sourcing the line.'), | 1021 | _('A location must be chosen before sourcing the line.'), |
238 | 1048 | ) | 1022 | ) |
239 | 1049 | 1023 | ||
240 | 1024 | no_price = self.search(cr, uid, [ | ||
241 | 1025 | ('id', 'in', ids), | ||
242 | 1026 | ('price_unit', '=', 0.00), | ||
243 | 1027 | ('order_id.procurement_request', '=', False), | ||
244 | 1028 | ], count=True, context=context) | ||
245 | 1029 | if no_price: | ||
246 | 1030 | raise osv.except_osv( | ||
247 | 1031 | _('Warning'), | ||
248 | 1032 | _('You cannot confirm the sourcing of a line with unit price as zero.'), | ||
249 | 1033 | ) | ||
250 | 1034 | |||
251 | 1050 | order_to_check = {} | 1035 | order_to_check = {} |
252 | 1051 | for line in self.read(cr, uid, ids, ['order_id', 'estimated_delivery_date'], context=context): | 1036 | for line in self.read(cr, uid, ids, ['order_id', 'estimated_delivery_date'], context=context): |
253 | 1052 | order_proc = order_obj.read(cr, uid, line['order_id'][0], ['procurement_request'], context=context)['procurement_request'] | 1037 | order_proc = order_obj.read(cr, uid, line['order_id'][0], ['procurement_request'], context=context)['procurement_request'] |
254 | 1053 | 1038 | ||
255 | === modified file 'sourcing/wizard/multiple_sourcing.py' | |||
256 | --- sourcing/wizard/multiple_sourcing.py 2014-10-10 12:26:59 +0000 | |||
257 | +++ sourcing/wizard/multiple_sourcing.py 2015-03-12 10:44:53 +0000 | |||
258 | @@ -53,7 +53,7 @@ | |||
259 | 53 | 'stock.location', | 53 | 'stock.location', |
260 | 54 | string='Location', | 54 | string='Location', |
261 | 55 | ), | 55 | ), |
263 | 56 | 'supplier': fields.many2one( | 56 | 'supplier_id': fields.many2one( |
264 | 57 | 'res.partner', | 57 | 'res.partner', |
265 | 58 | string='Supplier', | 58 | string='Supplier', |
266 | 59 | help="If you have choose lines coming from Field Orders, only External/ESC suppliers will be available.", | 59 | help="If you have choose lines coming from Field Orders, only External/ESC suppliers will be available.", |
267 | @@ -124,7 +124,7 @@ | |||
268 | 124 | if loc != -1: | 124 | if loc != -1: |
269 | 125 | res['location_id'] = loc | 125 | res['location_id'] = loc |
270 | 126 | if supplier != -1: | 126 | if supplier != -1: |
272 | 127 | res['supplier'] = supplier | 127 | res['supplier_id'] = supplier |
273 | 128 | 128 | ||
274 | 129 | if not res['line_ids']: | 129 | if not res['line_ids']: |
275 | 130 | raise osv.except_osv(_('Error'), _('No non-sourced lines are selected. Please select non-sourced lines')) | 130 | raise osv.except_osv(_('Error'), _('No non-sourced lines are selected. Please select non-sourced lines')) |
276 | @@ -146,7 +146,7 @@ | |||
277 | 146 | if wiz.type == 'make_to_order': | 146 | if wiz.type == 'make_to_order': |
278 | 147 | if not wiz.po_cft: | 147 | if not wiz.po_cft: |
279 | 148 | raise osv.except_osv(_('Error'), _('The Procurement method should be filled !')) | 148 | raise osv.except_osv(_('Error'), _('The Procurement method should be filled !')) |
281 | 149 | elif wiz.po_cft != 'cft' and not wiz.supplier: | 149 | elif wiz.po_cft != 'cft' and not wiz.supplier_id: |
282 | 150 | raise osv.except_osv(_('Error'), _('You should select a supplier !')) | 150 | raise osv.except_osv(_('Error'), _('You should select a supplier !')) |
283 | 151 | 151 | ||
284 | 152 | errors = {} | 152 | errors = {} |
285 | @@ -159,7 +159,7 @@ | |||
286 | 159 | try: | 159 | try: |
287 | 160 | line_obj.write(cr, uid, [line.id], {'type': wiz.type, | 160 | line_obj.write(cr, uid, [line.id], {'type': wiz.type, |
288 | 161 | 'po_cft': wiz.po_cft, | 161 | 'po_cft': wiz.po_cft, |
290 | 162 | 'supplier': wiz.supplier and wiz.supplier.id or False, | 162 | 'supplier': wiz.supplier_id and wiz.supplier_id.id or False, |
291 | 163 | 'location_id': wiz.location_id.id and wiz.location_id.id or False}, | 163 | 'location_id': wiz.location_id.id and wiz.location_id.id or False}, |
292 | 164 | context=context) | 164 | context=context) |
293 | 165 | except osv.except_osv, e: | 165 | except osv.except_osv, e: |
294 | @@ -227,7 +227,7 @@ | |||
295 | 227 | if l_type == 'make_to_order': | 227 | if l_type == 'make_to_order': |
296 | 228 | return {'value': {'location_id': False}} | 228 | return {'value': {'location_id': False}} |
297 | 229 | 229 | ||
299 | 230 | res = {'value': {'po_cft': False, 'supplier': False}} | 230 | res = {'value': {'po_cft': False, 'supplier_id': False}} |
300 | 231 | if not context or not context[0] or not context[0][2]: | 231 | if not context or not context[0] or not context[0][2]: |
301 | 232 | return res | 232 | return res |
302 | 233 | 233 | ||
303 | @@ -248,15 +248,15 @@ | |||
304 | 248 | all_line_empty = False | 248 | all_line_empty = False |
305 | 249 | 249 | ||
306 | 250 | if all_line_empty: # by default, and if all lines has no location, then set by default Stock | 250 | if all_line_empty: # by default, and if all lines has no location, then set by default Stock |
309 | 251 | return {'value': {'po_cft': False, 'supplier': False, 'location_id': stock_loc}} | 251 | return {'value': {'po_cft': False, 'supplier_id': False, 'location_id': stock_loc}} |
310 | 252 | return {'value': {'po_cft': False, 'supplier': False}} | 252 | return {'value': {'po_cft': False, 'supplier_id': False}} |
311 | 253 | 253 | ||
312 | 254 | def change_po_cft(self, cr, uid, ids, po_cft, context=None): | 254 | def change_po_cft(self, cr, uid, ids, po_cft, context=None): |
313 | 255 | ''' | 255 | ''' |
314 | 256 | Unset the supplier if tender is choosen | 256 | Unset the supplier if tender is choosen |
315 | 257 | ''' | 257 | ''' |
316 | 258 | if po_cft == 'cft': | 258 | if po_cft == 'cft': |
318 | 259 | return {'value': {'supplier': False}} | 259 | return {'value': {'supplier_id': False}} |
319 | 260 | 260 | ||
320 | 261 | return {} | 261 | return {} |
321 | 262 | 262 | ||
322 | @@ -278,16 +278,16 @@ | |||
323 | 278 | } | 278 | } |
324 | 279 | return result | 279 | return result |
325 | 280 | 280 | ||
327 | 281 | def change_location(self, cr, uid, ids, location_id, context=None): | 281 | def change_location(self, cr, uid, ids, location_id, line_ids, context=None): |
328 | 282 | res = {'value': {}} | 282 | res = {'value': {}} |
329 | 283 | if not location_id: | 283 | if not location_id: |
330 | 284 | return res | 284 | return res |
331 | 285 | 285 | ||
333 | 286 | if not context or not context[0] or not context[0][2]: | 286 | if not line_ids or not line_ids[0] or not line_ids[0][2]: |
334 | 287 | return res | 287 | return res |
335 | 288 | 288 | ||
336 | 289 | line_obj = self.pool.get('sale.order.line') | 289 | line_obj = self.pool.get('sale.order.line') |
338 | 290 | active_ids = context[0][2] | 290 | active_ids = line_ids[0][2] |
339 | 291 | 291 | ||
340 | 292 | context = {} | 292 | context = {} |
341 | 293 | context.update({'from_multiple_line_sourcing': False}) | 293 | context.update({'from_multiple_line_sourcing': False}) |
342 | 294 | 294 | ||
343 | === modified file 'sourcing/wizard/multiple_sourcing_view.xml' | |||
344 | --- sourcing/wizard/multiple_sourcing_view.xml 2014-10-09 13:19:51 +0000 | |||
345 | +++ sourcing/wizard/multiple_sourcing_view.xml 2015-03-12 10:44:53 +0000 | |||
346 | @@ -15,35 +15,24 @@ | |||
347 | 15 | </group> | 15 | </group> |
348 | 16 | <group colspan="4" col="4"> | 16 | <group colspan="4" col="4"> |
349 | 17 | <separator colspan="4" string="Selected lines to source" /> | 17 | <separator colspan="4" string="Selected lines to source" /> |
362 | 18 | <field name="line_ids" nolabel="1" colspan="4"> | 18 | <field name="line_ids" nolabel="1" colspan="4" /> |
351 | 19 | <tree string="Lines to source" hide_new_button="True" noteditable="True"> | ||
352 | 20 | <field name="order_id" string="Order reference" /> | ||
353 | 21 | <field name="line_number" /> | ||
354 | 22 | <field name="product_id" /> | ||
355 | 23 | <field name="product_uom_qty" /> | ||
356 | 24 | <field name="product_uom" /> | ||
357 | 25 | <field name="real_stock" /> | ||
358 | 26 | <field name="available_stock" /> | ||
359 | 27 | <field name="virtual_stock" /> | ||
360 | 28 | </tree> | ||
361 | 29 | </field> | ||
363 | 30 | <separator colspan="4" string="Procurement method" /> | 19 | <separator colspan="4" string="Procurement method" /> |
364 | 31 | <field name="type" | 20 | <field name="type" |
366 | 32 | on_change="change_type(type, line_ids)"/> | 21 | on_change="change_type(type)"/> |
367 | 33 | <field name="po_cft" attrs="{'readonly': [('type', '=', 'make_to_stock')]}" | 22 | <field name="po_cft" attrs="{'readonly': [('type', '=', 'make_to_stock')]}" |
368 | 34 | on_change="change_po_cft(po_cft)"/> | 23 | on_change="change_po_cft(po_cft)"/> |
369 | 35 | <separator colspan="4" string="Supplier selection" /> | 24 | <separator colspan="4" string="Supplier selection" /> |
371 | 36 | <field name="supplier" | 25 | <field name="supplier_id" |
372 | 37 | domain="[('id', '!=', company_id), ('available_for_dpo', '=', po_cft), ('line_contains_fo', '=', line_ids)]" | 26 | domain="[('id', '!=', company_id), ('available_for_dpo', '=', po_cft), ('line_contains_fo', '=', line_ids)]" |
373 | 38 | attrs="{'readonly': ['|', ('po_cft', '=', 'cft'), ('type', '=', 'make_to_stock')]}" | 27 | attrs="{'readonly': ['|', ('po_cft', '=', 'cft'), ('type', '=', 'make_to_stock')]}" |
375 | 39 | on_change="change_supplier(supplier)" | 28 | on_change="change_supplier(supplier_id)" |
376 | 40 | /> | 29 | /> |
377 | 41 | 30 | ||
378 | 42 | 31 | ||
379 | 43 | <field name="location_id" domain="[('usage', '=', 'internal'), ('quarantine_location', '=', False), | 32 | <field name="location_id" domain="[('usage', '=', 'internal'), ('quarantine_location', '=', False), |
380 | 44 | ('scrap_location', '=', False), ('destruction_location', '=', False), | 33 | ('scrap_location', '=', False), ('destruction_location', '=', False), |
381 | 45 | ('output_ok', '=', False), ('input_ok', '=', False)]" | 34 | ('output_ok', '=', False), ('input_ok', '=', False)]" |
383 | 46 | attrs="{'readonly': [('type', '!=', 'make_to_stock')]}" | 35 | attrs="{'readonly': [('type', '!=', 'make_to_stock')]}" |
384 | 47 | on_change="change_location(location_id, line_ids)" /> | 36 | on_change="change_location(location_id, line_ids)" /> |
385 | 48 | 37 | ||
386 | 49 | </group> | 38 | </group> |
387 | @@ -59,8 +48,8 @@ | |||
388 | 59 | <record id="sourcing_line_special_tree_view" model="ir.ui.view"> | 48 | <record id="sourcing_line_special_tree_view" model="ir.ui.view"> |
389 | 60 | <field name="name">sourcing.line.special.tree.view</field> | 49 | <field name="name">sourcing.line.special.tree.view</field> |
390 | 61 | <field name="model">sale.order.line</field> | 50 | <field name="model">sale.order.line</field> |
393 | 62 | <field name="type">form</field> | 51 | <field name="type">tree</field> |
394 | 63 | <field name="priority" eval="5000" /> | 52 | <field name="priority" eval="10" /> |
395 | 64 | <field name="arch" type="xml"> | 53 | <field name="arch" type="xml"> |
396 | 65 | <tree string="Lines to source" hide_new_button="True" noteditable="True"> | 54 | <tree string="Lines to source" hide_new_button="True" noteditable="True"> |
397 | 66 | <field name="order_id" string="Order reference" /> | 55 | <field name="order_id" string="Order reference" /> |
398 | 67 | 56 | ||
399 | === modified file 'stock_override/report/internal_move.rml' | |||
400 | --- stock_override/report/internal_move.rml 2014-04-08 12:14:42 +0000 | |||
401 | +++ stock_override/report/internal_move.rml 2015-03-12 10:44:53 +0000 | |||
402 | @@ -9,7 +9,7 @@ | |||
403 | 9 | </pageGraphics> | 9 | </pageGraphics> |
404 | 10 | </pageTemplate>--> | 10 | </pageTemplate>--> |
405 | 11 | 11 | ||
407 | 12 | <pageTemplate> | 12 | <pageTemplate id="first"> |
408 | 13 | <frame id="first" x1="28.0" y1="28.0" width="786" height="525"/> | 13 | <frame id="first" x1="28.0" y1="28.0" width="786" height="525"/> |
409 | 14 | <pageGraphics> | 14 | <pageGraphics> |
410 | 15 | <image x="28.0" y="510" height="35.0" >[[ company.logo or removeParentNode('image') ]]</image> | 15 | <image x="28.0" y="510" height="35.0" >[[ company.logo or removeParentNode('image') ]]</image> |
411 | @@ -23,6 +23,19 @@ | |||
412 | 23 | <lines>25 550 818 550</lines> | 23 | <lines>25 550 818 550</lines> |
413 | 24 | </pageGraphics> | 24 | </pageGraphics> |
414 | 25 | </pageTemplate> | 25 | </pageTemplate> |
415 | 26 | <pageTemplate id="second"> | ||
416 | 27 | <frame id="second" x1="28.0" y1="28.0" width="786" height="525"/> | ||
417 | 28 | <pageGraphics> | ||
418 | 29 | <fill color="black"/> | ||
419 | 30 | <stroke color="black"/> | ||
420 | 31 | <setFont name="DejaVu Sans" size="8"/> | ||
421 | 32 | <drawString x="25" y="555"> [[ formatLang(time.strftime("%Y-%m-%d"), date=True) ]] [[ time.strftime("%H:%M") ]]</drawString> | ||
422 | 33 | <setFont name="DejaVu Sans Bold" size="10"/> | ||
423 | 34 | <drawString x="382" y="555">[[ company.partner_id.name ]]</drawString> | ||
424 | 35 | <stroke color="#000000"/> | ||
425 | 36 | <lines>25 550 818 550</lines> | ||
426 | 37 | </pageGraphics> | ||
427 | 38 | </pageTemplate> | ||
428 | 26 | 39 | ||
429 | 27 | </template> | 40 | </template> |
430 | 28 | 41 | ||
431 | @@ -36,6 +49,7 @@ | |||
432 | 36 | <blockTableStyle id="HeaderInfo"> | 49 | <blockTableStyle id="HeaderInfo"> |
433 | 37 | <blockValign value="MIDDLE" /> | 50 | <blockValign value="MIDDLE" /> |
434 | 38 | <lineStyle kind="GRID" colorName="#f2f2f2" /> | 51 | <lineStyle kind="GRID" colorName="#f2f2f2" /> |
435 | 52 | <blockSpan start="1,-1" stop="-1,-1" /> | ||
436 | 39 | </blockTableStyle> | 53 | </blockTableStyle> |
437 | 40 | 54 | ||
438 | 41 | <blockTableStyle id="LineHeader"> | 55 | <blockTableStyle id="LineHeader"> |
439 | @@ -88,7 +102,7 @@ | |||
440 | 88 | </para> | 102 | </para> |
441 | 89 | 103 | ||
442 | 90 | <!-- Header Information --> | 104 | <!-- Header Information --> |
444 | 91 | <blockTable colWidths="120.0,120.0,120.0,120.0,120.0,120.0" style="HeaderInfo"> | 105 | <blockTable colWidths="100.0,100.0,100.0,200.0,120.0,100.0" style="HeaderInfo"> |
445 | 92 | <tr> | 106 | <tr> |
446 | 93 | <td> | 107 | <td> |
447 | 94 | <para style="HeaderRight">Reference :</para> | 108 | <para style="HeaderRight">Reference :</para> |
448 | @@ -97,10 +111,10 @@ | |||
449 | 97 | <para style="Header">[[ picking.name ]]</para> | 111 | <para style="Header">[[ picking.name ]]</para> |
450 | 98 | </td> | 112 | </td> |
451 | 99 | <td> | 113 | <td> |
453 | 100 | <para style="HeaderRight">Origin :</para> | 114 | <para style="HeaderRight">Order Category :</para> |
454 | 101 | </td> | 115 | </td> |
455 | 102 | <td> | 116 | <td> |
457 | 103 | <para style="Header">[[ picking.origin ]]</para> | 117 | <para style="Header">[[ get_selec(picking, 'order_category') ]]</para> |
458 | 104 | </td> | 118 | </td> |
459 | 105 | <td> | 119 | <td> |
460 | 106 | <para style="HeaderRight">Actual Receipt Date :</para> | 120 | <para style="HeaderRight">Actual Receipt Date :</para> |
461 | @@ -131,12 +145,6 @@ | |||
462 | 131 | </tr> | 145 | </tr> |
463 | 132 | <tr> | 146 | <tr> |
464 | 133 | <td> | 147 | <td> |
465 | 134 | <para style="HeaderRight">Order Category :</para> | ||
466 | 135 | </td> | ||
467 | 136 | <td> | ||
468 | 137 | <para style="Header">[[ get_selec(picking, 'order_category') ]]</para> | ||
469 | 138 | </td> | ||
470 | 139 | <td> | ||
471 | 140 | <para style="HeaderRight">State :</para> | 148 | <para style="HeaderRight">State :</para> |
472 | 141 | </td> | 149 | </td> |
473 | 142 | <td> | 150 | <td> |
474 | @@ -148,6 +156,20 @@ | |||
475 | 148 | <td> | 156 | <td> |
476 | 149 | <para style="Header"> </para> | 157 | <para style="Header"> </para> |
477 | 150 | </td> | 158 | </td> |
478 | 159 | <td> | ||
479 | 160 | <para style="HeaderRight"> </para> | ||
480 | 161 | </td> | ||
481 | 162 | <td> | ||
482 | 163 | <para style="Header"> </para> | ||
483 | 164 | </td> | ||
484 | 165 | </tr> | ||
485 | 166 | <tr> | ||
486 | 167 | <td> | ||
487 | 168 | <para style="HeaderRight">Origin :</para> | ||
488 | 169 | </td> | ||
489 | 170 | <td> | ||
490 | 171 | <para style="Header">[[ picking.origin ]]</para> | ||
491 | 172 | </td> | ||
492 | 151 | </tr> | 173 | </tr> |
493 | 152 | </blockTable> | 174 | </blockTable> |
494 | 153 | 175 | ||
495 | @@ -155,6 +177,7 @@ | |||
496 | 155 | <font color="white"> </font> | 177 | <font color="white"> </font> |
497 | 156 | </para> | 178 | </para> |
498 | 157 | 179 | ||
499 | 180 | <setNextTemplate name="second" /> | ||
500 | 158 | 181 | ||
501 | 159 | <section> | 182 | <section> |
502 | 160 | <blockTable colWidths="25.0,70.0,120.0,60.0,45.0,40.0,70.0,70.0,70.0,80.0,80.0,80.0" style="LineHeader" repeatRows="1"> | 183 | <blockTable colWidths="25.0,70.0,120.0,60.0,45.0,40.0,70.0,70.0,70.0,80.0,80.0,80.0" style="LineHeader" repeatRows="1"> |
503 | @@ -242,7 +265,7 @@ | |||
504 | 242 | <para style="Header"> | 265 | <para style="Header"> |
505 | 243 | <font color="white"> </font> | 266 | <font color="white"> </font> |
506 | 244 | </para> | 267 | </para> |
508 | 245 | 268 | ||
509 | 246 | <blockTable colWidths="44.0,169.0,169.0,169.0,169.0" style="FooterInfo" keepWithNext="1"> | 269 | <blockTable colWidths="44.0,169.0,169.0,169.0,169.0" style="FooterInfo" keepWithNext="1"> |
510 | 247 | <tr> | 270 | <tr> |
511 | 248 | <td> | 271 | <td> |
512 | 249 | 272 | ||
513 | === modified file 'unifield_tests/master_data/070_products.yml' | |||
514 | --- unifield_tests/master_data/070_products.yml 2014-10-09 06:56:59 +0000 | |||
515 | +++ unifield_tests/master_data/070_products.yml 2015-03-12 10:44:53 +0000 | |||
516 | @@ -4,7 +4,7 @@ | |||
517 | 4 | Create Product PL1 | 4 | Create Product PL1 |
518 | 5 | - | 5 | - |
519 | 6 | !record {model: product.product, id: prod_log_1}: | 6 | !record {model: product.product, id: prod_log_1}: |
521 | 7 | code: PL1 (Test) | 7 | default_code: PL1 (Test) |
522 | 8 | name: PL1 (Test) | 8 | name: PL1 (Test) |
523 | 9 | supply_method: buy | 9 | supply_method: buy |
524 | 10 | type: product | 10 | type: product |
525 | @@ -18,7 +18,7 @@ | |||
526 | 18 | Create Product PL2 | 18 | Create Product PL2 |
527 | 19 | - | 19 | - |
528 | 20 | !record {model: product.product, id: prod_log_2}: | 20 | !record {model: product.product, id: prod_log_2}: |
530 | 21 | code: PL2 (Test) | 21 | default_code: PL2 (Test) |
531 | 22 | name: PL2 (Test) | 22 | name: PL2 (Test) |
532 | 23 | supply_method: buy | 23 | supply_method: buy |
533 | 24 | type: product | 24 | type: product |
534 | @@ -32,7 +32,7 @@ | |||
535 | 32 | Create Product PL3 | 32 | Create Product PL3 |
536 | 33 | - | 33 | - |
537 | 34 | !record {model: product.product, id: prod_log_3}: | 34 | !record {model: product.product, id: prod_log_3}: |
539 | 35 | code: PL3 (Test) | 35 | default_code: PL3 (Test) |
540 | 36 | name: PL3 (Test) | 36 | name: PL3 (Test) |
541 | 37 | supply_method: buy | 37 | supply_method: buy |
542 | 38 | type: product | 38 | type: product |
543 | @@ -46,7 +46,7 @@ | |||
544 | 46 | Create Product PL4 | 46 | Create Product PL4 |
545 | 47 | - | 47 | - |
546 | 48 | !record {model: product.product, id: prod_log_4}: | 48 | !record {model: product.product, id: prod_log_4}: |
548 | 49 | code: PL4 (Test) | 49 | default_code: PL4 (Test) |
549 | 50 | name: PL4 (Test) | 50 | name: PL4 (Test) |
550 | 51 | supply_method: buy | 51 | supply_method: buy |
551 | 52 | type: product | 52 | type: product |
552 | @@ -60,7 +60,7 @@ | |||
553 | 60 | Create Product PL5 | 60 | Create Product PL5 |
554 | 61 | - | 61 | - |
555 | 62 | !record {model: product.product, id: prod_log_5}: | 62 | !record {model: product.product, id: prod_log_5}: |
557 | 63 | code: PL5 (Test) | 63 | default_code: PL5 (Test) |
558 | 64 | name: PL5 (Test) | 64 | name: PL5 (Test) |
559 | 65 | supply_method: buy | 65 | supply_method: buy |
560 | 66 | type: product | 66 | type: product |
561 | @@ -76,7 +76,7 @@ | |||
562 | 76 | Create Product PM1 | 76 | Create Product PM1 |
563 | 77 | - | 77 | - |
564 | 78 | !record {model: product.product, id: prod_med_1}: | 78 | !record {model: product.product, id: prod_med_1}: |
566 | 79 | code: PM1 (Test) | 79 | default_code: PM1 (Test) |
567 | 80 | name: PM1 (Test) | 80 | name: PM1 (Test) |
568 | 81 | supply_method: buy | 81 | supply_method: buy |
569 | 82 | type: product | 82 | type: product |
570 | @@ -90,7 +90,7 @@ | |||
571 | 90 | Create Product PM | 90 | Create Product PM |
572 | 91 | - | 91 | - |
573 | 92 | !record {model: product.product, id: prod_med_2}: | 92 | !record {model: product.product, id: prod_med_2}: |
575 | 93 | code: PM2 (Test) | 93 | default_code: PM2 (Test) |
576 | 94 | name: PM2 (Test) | 94 | name: PM2 (Test) |
577 | 95 | supply_method: buy | 95 | supply_method: buy |
578 | 96 | type: product | 96 | type: product |
579 | @@ -104,7 +104,7 @@ | |||
580 | 104 | Create Product PM3 | 104 | Create Product PM3 |
581 | 105 | - | 105 | - |
582 | 106 | !record {model: product.product, id: prod_med_3}: | 106 | !record {model: product.product, id: prod_med_3}: |
584 | 107 | code: PM3 (Test) | 107 | default_code: PM3 (Test) |
585 | 108 | name: PM3 (Test) | 108 | name: PM3 (Test) |
586 | 109 | supply_method: buy | 109 | supply_method: buy |
587 | 110 | type: product | 110 | type: product |
588 | @@ -118,7 +118,7 @@ | |||
589 | 118 | Create Product PM4 | 118 | Create Product PM4 |
590 | 119 | - | 119 | - |
591 | 120 | !record {model: product.product, id: prod_med_4}: | 120 | !record {model: product.product, id: prod_med_4}: |
593 | 121 | code: PM4 (Test) | 121 | default_code: PM4 (Test) |
594 | 122 | name: PM4 (Test) | 122 | name: PM4 (Test) |
595 | 123 | supply_method: buy | 123 | supply_method: buy |
596 | 124 | type: product | 124 | type: product |
597 | @@ -132,7 +132,7 @@ | |||
598 | 132 | Create Product PM5 | 132 | Create Product PM5 |
599 | 133 | - | 133 | - |
600 | 134 | !record {model: product.product, id: prod_med_5}: | 134 | !record {model: product.product, id: prod_med_5}: |
602 | 135 | code: PM5 (Test) | 135 | default_code: PM5 (Test) |
603 | 136 | name: PM5 (Test) | 136 | name: PM5 (Test) |
604 | 137 | supply_method: buy | 137 | supply_method: buy |
605 | 138 | type: product | 138 | type: product |
606 | 139 | 139 | ||
607 | === added file 'unifield_tests/tests/test_fo.py' | |||
608 | --- unifield_tests/tests/test_fo.py 1970-01-01 00:00:00 +0000 | |||
609 | +++ unifield_tests/tests/test_fo.py 2015-03-12 10:44:53 +0000 | |||
610 | @@ -0,0 +1,76 @@ | |||
611 | 1 | #!/usr/bin/env python | ||
612 | 2 | # -*- coding: utf-8 -*- | ||
613 | 3 | from __future__ import print_function | ||
614 | 4 | from unifield_test import UnifieldTest | ||
615 | 5 | from oerplib.error import RPCError | ||
616 | 6 | |||
617 | 7 | import time | ||
618 | 8 | |||
619 | 9 | |||
620 | 10 | class FOTest(UnifieldTest): | ||
621 | 11 | |||
622 | 12 | def setUp(self): | ||
623 | 13 | self.used_db = self.c1 | ||
624 | 14 | db = self.used_db | ||
625 | 15 | self.fo_obj = db.get('sale.order') | ||
626 | 16 | self.fol_obj = db.get('sale.order.line') | ||
627 | 17 | |||
628 | 18 | def test_validation_no_price_unit(self): | ||
629 | 19 | """ | ||
630 | 20 | Create a FO with two lines. One of these lines have no price unit. | ||
631 | 21 | Expected result: An error must be raised | ||
632 | 22 | """ | ||
633 | 23 | partner_id = self.get_record(self.used_db, 'ext_customer_1') | ||
634 | 24 | order_type = 'regular' | ||
635 | 25 | |||
636 | 26 | # Get the analytic distribution | ||
637 | 27 | distrib_id = self.get_record(self.used_db, 'distrib_1') | ||
638 | 28 | |||
639 | 29 | order_values = self.fo_obj.\ | ||
640 | 30 | onchange_partner_id(None, partner_id, order_type).get('value', {}) | ||
641 | 31 | order_values.update({ | ||
642 | 32 | 'order_type': order_type, | ||
643 | 33 | 'procurement_request': False, | ||
644 | 34 | 'partner_id': partner_id, | ||
645 | 35 | 'ready_to_ship_date': time.strftime('%Y-%m-%d'), | ||
646 | 36 | 'analytic_distribution_id': distrib_id, | ||
647 | 37 | }) | ||
648 | 38 | order_id = self.fo_obj.create(order_values) | ||
649 | 39 | |||
650 | 40 | # Create order lines | ||
651 | 41 | prod_log1_id = self.get_record(self.used_db, 'prod_log_1') | ||
652 | 42 | prod_log2_id = self.get_record(self.used_db, 'prod_log_2') | ||
653 | 43 | uom_pce_id = self.get_record( | ||
654 | 44 | self.used_db, | ||
655 | 45 | 'product_uom_unit', | ||
656 | 46 | module='product' | ||
657 | 47 | ) | ||
658 | 48 | |||
659 | 49 | line_values = { | ||
660 | 50 | 'order_id': order_id, | ||
661 | 51 | 'product_id': prod_log1_id, | ||
662 | 52 | 'product_uom': uom_pce_id, | ||
663 | 53 | 'product_uom_qty': 10.0, | ||
664 | 54 | 'type': 'make_to_order', | ||
665 | 55 | 'price_unit': 10.0, | ||
666 | 56 | } | ||
667 | 57 | self.fol_obj.create(line_values) | ||
668 | 58 | |||
669 | 59 | line_values.update({ | ||
670 | 60 | 'product_id': prod_log2_id, | ||
671 | 61 | 'price_unit': 0.0, | ||
672 | 62 | }) | ||
673 | 63 | self.fol_obj.create(line_values) | ||
674 | 64 | |||
675 | 65 | try: | ||
676 | 66 | self.c1.exec_workflow('sale.order', 'order_validated', order_id) | ||
677 | 67 | self.assert_( | ||
678 | 68 | False, | ||
679 | 69 | 'No error message at FO validation with line with no price.', | ||
680 | 70 | ) | ||
681 | 71 | except RPCError as e: | ||
682 | 72 | return True | ||
683 | 73 | |||
684 | 74 | |||
685 | 75 | def get_test_class(): | ||
686 | 76 | return FOTest | ||
687 | 0 | 77 | ||
688 | === modified file 'unifield_tests/tests/test_uftp_324.py' | |||
689 | --- unifield_tests/tests/test_uftp_324.py 2014-10-17 14:14:49 +0000 | |||
690 | +++ unifield_tests/tests/test_uftp_324.py 2015-03-12 10:44:53 +0000 | |||
691 | @@ -112,6 +112,17 @@ | |||
692 | 112 | # Validate the sale order | 112 | # Validate the sale order |
693 | 113 | self.c1.exec_workflow('sale.order', 'order_validated', self.c_so_id) | 113 | self.c1.exec_workflow('sale.order', 'order_validated', self.c_so_id) |
694 | 114 | 114 | ||
695 | 115 | def test_utp_324(self): | ||
696 | 116 | """ | ||
697 | 117 | Cancel the PO at coordo side, synchronize and check the state of the PO at | ||
698 | 118 | project side. | ||
699 | 119 | :return: | ||
700 | 120 | """ | ||
701 | 121 | wiz_model = 'purchase.order.cancel.wizard' | ||
702 | 122 | c_wiz_obj = self.c1.get(wiz_model) | ||
703 | 123 | c_lc_wiz_obj = self.c1.get('sale.order.leave.close') | ||
704 | 124 | c_cancel_so_wiz_obj = self.c1.get('sale.order.cancelation.wizard') | ||
705 | 125 | |||
706 | 115 | # Source all lines on a Purchase Order to ext_supplier_1 | 126 | # Source all lines on a Purchase Order to ext_supplier_1 |
707 | 116 | line_ids = self.c_sol_obj.search([('order_id', '=', self.c_so_id)]) | 127 | line_ids = self.c_sol_obj.search([('order_id', '=', self.c_so_id)]) |
708 | 117 | self.c_sol_obj.write(line_ids, { | 128 | self.c_sol_obj.write(line_ids, { |
709 | @@ -147,17 +158,6 @@ | |||
710 | 147 | 158 | ||
711 | 148 | self.c_po_id = po_line['order_id'][0] | 159 | self.c_po_id = po_line['order_id'][0] |
712 | 149 | 160 | ||
713 | 150 | def test_utp_324(self): | ||
714 | 151 | """ | ||
715 | 152 | Cancel the PO at coordo side, synchronize and check the state of the PO at | ||
716 | 153 | project side. | ||
717 | 154 | :return: | ||
718 | 155 | """ | ||
719 | 156 | wiz_model = 'purchase.order.cancel.wizard' | ||
720 | 157 | c_wiz_obj = self.c1.get(wiz_model) | ||
721 | 158 | c_lc_wiz_obj = self.c1.get('sale.order.leave.close') | ||
722 | 159 | c_cancel_so_wiz_obj = self.c1.get('sale.order.cancelation.wizard') | ||
723 | 160 | |||
724 | 161 | # Cancel PO at coordo side | 161 | # Cancel PO at coordo side |
725 | 162 | c_res = self.c_po_obj.purchase_cancel(self.c_po_id) | 162 | c_res = self.c_po_obj.purchase_cancel(self.c_po_id) |
726 | 163 | # Validate cancellation | 163 | # Validate cancellation |
727 | @@ -192,4 +192,4 @@ | |||
728 | 192 | ) | 192 | ) |
729 | 193 | 193 | ||
730 | 194 | def get_test_class(): | 194 | def get_test_class(): |
731 | 195 | return UFTP324Test | ||
732 | 196 | \ No newline at end of file | 195 | \ No newline at end of file |
733 | 196 | return UFTP324Test |