Merge lp:~unifield-team/unifield-wm/qt-us-first-pack into lp:unifield-wm

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
Reviewer Review Type Date Requested Status
UniField Reviewer Team Pending
Review via email: mp+252713@code.launchpad.net
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
=== modified file 'msf_partner/partner.py'
--- msf_partner/partner.py 2015-02-06 11:07:42 +0000
+++ msf_partner/partner.py 2015-03-12 10:44:53 +0000
@@ -215,6 +215,26 @@
215 view_load=True,215 view_load=True,
216 required=True,216 required=True,
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"),
218 'property_stock_customer': fields.property(
219 'stock.location',
220 type='many2one',
221 relation='stock.location',
222 string='Customer Location',
223 method=True,
224 view_load=True,
225 required=True,
226 help="This stock location will be used, instead of the default one, as the destination location for goods you send to this partner.",
227 ),
228 'property_stock_supplier': fields.property(
229 'stock.location',
230 type='many2one',
231 relation='stock.location',
232 string='Supplier Location',
233 method=True,
234 view_load=True,
235 required=True,
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.",
237 ),
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'),
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'),
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'),
221241
=== modified file 'msf_supply_doc_export/msf_supply_doc_export.py'
--- msf_supply_doc_export/msf_supply_doc_export.py 2014-11-14 10:45:42 +0000
+++ msf_supply_doc_export/msf_supply_doc_export.py 2015-03-12 10:44:53 +0000
@@ -383,9 +383,6 @@
383 def getRunParmsRML(self,key):383 def getRunParmsRML(self,key):
384 return self.datas['report_parms'][key]384 return self.datas['report_parms'][key]
385385
386 def getPOLineHeaders(self):
387 return ['Item','Code','Description','Qty ordered','UoM','Qty received','IN','Qty backorder','Unit Price','IN unit price','Destination','Cost Center']
388
389 def printAnalyticLines(self, analytic_lines):386 def printAnalyticLines(self, analytic_lines):
390 res = []387 res = []
391 # if additional analytic lines print them here.388 # if additional analytic lines print them here.
@@ -412,12 +409,14 @@
412 # TODO the multiplier is the value populated for no change in stock_move.price_unit409 # TODO the multiplier is the value populated for no change in stock_move.price_unit
413 # TODO it probably should be 1410 # TODO it probably should be 1
414 multiplier = 1.0000100000000001 411 multiplier = 1.0000100000000001
412 po_obj = self.pool.get('purchase.order')
415 pol_obj = self.pool.get('purchase.order.line')413 pol_obj = self.pool.get('purchase.order.line')
416 prod_obj = self.pool.get('product.product')414 prod_obj = self.pool.get('product.product')
417 uom_obj = self.pool.get('product.uom')415 uom_obj = self.pool.get('product.uom')
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')
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)
420 report_lines = []418 report_lines = []
419 order = po_obj.browse(self.cr, self.uid, po_id)
421 for line in po_lines:420 for line in po_lines:
422 in_lines = self.getAllLineIN(line.id)421 in_lines = self.getAllLineIN(line.id)
423 analytic_lines = self.getAnalyticLines(line)422 analytic_lines = self.getAnalyticLines(line)
@@ -438,6 +437,10 @@
438 # Display information of the initial reception437 # Display information of the initial reception
439 if not same_product_same_uom:438 if not same_product_same_uom:
440 report_line = {439 report_line = {
440 'order_ref': order.name or '',
441 'order_created': order.date_order or '',
442 'order_confirmed_date': order.delivery_confirmed_date or '',
443 'order_status': self._get_states().get(order.state, ''),
441 'item': line.line_number or '',444 'item': line.line_number or '',
442 'code': line.product_id.default_code or '',445 'code': line.product_id.default_code or '',
443 'description': line.product_id.name or '',446 'description': line.product_id.name or '',
@@ -457,6 +460,10 @@
457460
458 for spsul in same_product_same_uom:461 for spsul in same_product_same_uom:
459 report_line = {462 report_line = {
463 'order_ref': order.name or '',
464 'order_created': order.date_order or '',
465 'order_confirmed_date': order.delivery_confirmed_date or '',
466 'order_status': self._get_states().get(order.state, ''),
460 'item': first_line and line.line_number or '',467 'item': first_line and line.line_number or '',
461 'code': first_line and line.product_id.default_code or '',468 'code': first_line and line.product_id.default_code or '',
462 'description': first_line and line.product_id.name or '',469 'description': first_line and line.product_id.name or '',
@@ -481,6 +488,10 @@
481488
482 for spl in same_product:489 for spl in same_product:
483 report_line = {490 report_line = {
491 'order_ref': order.name or '',
492 'order_created': order.date_order or '',
493 'order_confirmed_date': order.delivery_confirmed_date or '',
494 'order_status': self._get_states().get(order.state, ''),
484 'item': first_line and line.line_number or '',495 'item': first_line and line.line_number or '',
485 'code': first_line and line.product_id.default_code or '',496 'code': first_line and line.product_id.default_code or '',
486 'description': first_line and line.product_id.name or '',497 'description': first_line and line.product_id.name or '',
@@ -505,6 +516,10 @@
505 for ol in other_product:516 for ol in other_product:
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'))
507 report_line = {518 report_line = {
519 'order_ref': order.name or '',
520 'order_created': order.date_order or '',
521 'order_confirmed_date': order.delivery_confirmed_date or '',
522 'order_status': self._get_states().get(order.state, ''),
508 'item': line.line_number or '',523 'item': line.line_number or '',
509 'code': prod_brw.default_code or '',524 'code': prod_brw.default_code or '',
510 'description': prod_brw.name or '',525 'description': prod_brw.name or '',
@@ -560,7 +575,7 @@
560 return self.datas.get('report_header')[1]575 return self.datas.get('report_header')[1]
561576
562 def getPOLineHeaders(self):577 def getPOLineHeaders(self):
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']
564 579
565580
566581
567582
=== modified file 'msf_supply_doc_export/report/report_po_follow_up_xls.mako'
--- msf_supply_doc_export/report/report_po_follow_up_xls.mako 2014-11-07 10:52:52 +0000
+++ msf_supply_doc_export/report/report_po_follow_up_xls.mako 2015-03-12 10:44:53 +0000
@@ -81,6 +81,8 @@
81## definition of the columns' size81## definition of the columns' size
82<% nb_of_columns = 12 %>82<% nb_of_columns = 12 %>
83<Table x:FullColumns="1" x:FullRows="1">83<Table x:FullColumns="1" x:FullRows="1">
84 # Order name
85 <Column ss:AutoFitWidth="1" ss:Width="65" />
84 # Item86 # Item
85 <Column ss:AutoFitWidth="1" ss:Width="40" />87 <Column ss:AutoFitWidth="1" ss:Width="40" />
86 # Code88 # Code
@@ -101,6 +103,12 @@
101 <Column ss:AutoFitWidth="1" ss:Width="95" />103 <Column ss:AutoFitWidth="1" ss:Width="95" />
102 # IN Unit Price104 # IN Unit Price
103 <Column ss:AutoFitWidth="1" ss:Width="95" />105 <Column ss:AutoFitWidth="1" ss:Width="95" />
106 # Created (order)
107 <Columns ss:AutoFitWidth="1" ss:Width="95" />
108 # Delivery Confirmed (order)
109 <Columns ss:AutoFitWidth="1" ss:Width="95" />
110 # Status (order)
111 <Columns ss:AutoFitWidth="1" ss:Width="95" />
104 # Destination112 # Destination
105 <Column ss:AutoFitWidth="1" ss:Width="95" />113 <Column ss:AutoFitWidth="1" ss:Width="95" />
106 # Cost Center114 # Cost Center
@@ -116,16 +124,6 @@
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>
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>
118</Row>126</Row>
119<Row></Row>
120<Row></Row>
121
122% for o in objects:
123
124 <Row ss:AutoFitHeight="0" ss:Height="36">
125 % for header in getHeaderLine(o):
126 <Cell ss:MergeAcross="1" ss:StyleID="poheader"><Data ss:Type="String">${header |x}</Data></Cell>
127 % endfor
128 </Row>
129127
130 <Row ss:AutoFitHeight="1" > 128 <Row ss:AutoFitHeight="1" >
131 % for header in getPOLineHeaders():129 % for header in getPOLineHeaders():
@@ -133,8 +131,11 @@
133 % endfor 131 % endfor
134 </Row>132 </Row>
135 133
134% for o in objects:
135
136 % for line in getPOLines(o.id):136 % for line in getPOLines(o.id):
137 <Row ss:AutoFitHeight="1">137 <Row ss:AutoFitHeight="1">
138 <Cell ss:StyleID="line"><Data ss:Type="String">${(line['order_ref'])|x}</Data></Cell>
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>
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>
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>
@@ -145,6 +146,9 @@
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>
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>
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>
149 <Cell ss:StyleID="line"><Data ss:Type="String">${(line['order_created'])|x}</Data></Cell>
150 <Cell ss:StyleID="line"><Data ss:Type="String">${(line['order_confirmed_date'])|x}</Data></Cell>
151 <Cell ss:StyleID="line"><Data ss:Type="String">${(line['order_status'])|x}</Data></Cell>
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>
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>
150 </Row>154 </Row>
151155
=== modified file 'sale_override/sale.py'
--- sale_override/sale.py 2015-01-28 17:26:00 +0000
+++ sale_override/sale.py 2015-03-12 10:44:53 +0000
@@ -855,6 +855,16 @@
855 # 1/ Check validity of analytic distribution855 # 1/ Check validity of analytic distribution
856 self.analytic_distribution_checks(cr, uid, order_brw_list)856 self.analytic_distribution_checks(cr, uid, order_brw_list)
857857
858 no_price_lines = line_obj.search(cr, uid, [
859 ('order_id', '=', ids),
860 ('price_unit', '=', 0.00),
861 ])
862 if no_price_lines:
863 raise osv.except_osv(
864 _('Warning'),
865 _('FO cannot be validated as line cannot have unit price of zero.'),
866 )
867
858 for order in order_brw_list:868 for order in order_brw_list:
859 # 2/ Check if there is lines in order869 # 2/ Check if there is lines in order
860 if len(order.order_line) < 1:870 if len(order.order_line) < 1:
861871
=== modified file 'sourcing/sale_order_line.py'
--- sourcing/sale_order_line.py 2014-10-22 08:44:42 +0000
+++ sourcing/sale_order_line.py 2015-03-12 10:44:53 +0000
@@ -48,32 +48,6 @@
48 _inherit = 'sale.order.line'48 _inherit = 'sale.order.line'
49 _description = 'Sales Order Line'49 _description = 'Sales Order Line'
5050
51 def fields_view_get(self, cr, uid, view_id=None, view_type='form', context=None, toolbar=False, submenu=False):
52 if context is None:
53 context = {}
54
55 '''
56 !!!!! ATTENTION ATTENTION!!!!!!
57 UTP-1021: This solution is NOT stable and could be dangerous!!!!
58 need to have a proper fix for this,
59 currently we have only 3 tree views for sale.order.line
60 so I use the value in the context to identify that it is not the
61 view of wizard, but this assumption could be totally WRONG!
62 But in this current version, it works!
63 '''
64 if not context.get('search_default_need_sourcing', False) and \
65 view_type == 'tree':
66 if '_terp_view_name' in context:
67 '''
68 UFTP-346: HACK ON HACK UTP-1021
69 '_terp_view_name' not set if grouping
70 and we do not want special view when grouping
71 '''
72 view_id = self.pool.get('ir.model.data').get_object_reference(
73 cr, uid, 'sourcing', 'sourcing_line_special_tree_view')[1]
74 return super(sale_order_line, self).fields_view_get(cr, uid, view_id,
75 view_type, context, toolbar, submenu)
76
77 """51 """
78 Other methods52 Other methods
79 """53 """
@@ -1047,6 +1021,17 @@
1047 _('A location must be chosen before sourcing the line.'),1021 _('A location must be chosen before sourcing the line.'),
1048 )1022 )
10491023
1024 no_price = self.search(cr, uid, [
1025 ('id', 'in', ids),
1026 ('price_unit', '=', 0.00),
1027 ('order_id.procurement_request', '=', False),
1028 ], count=True, context=context)
1029 if no_price:
1030 raise osv.except_osv(
1031 _('Warning'),
1032 _('You cannot confirm the sourcing of a line with unit price as zero.'),
1033 )
1034
1050 order_to_check = {}1035 order_to_check = {}
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):
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']
10531038
=== modified file 'sourcing/wizard/multiple_sourcing.py'
--- sourcing/wizard/multiple_sourcing.py 2014-10-10 12:26:59 +0000
+++ sourcing/wizard/multiple_sourcing.py 2015-03-12 10:44:53 +0000
@@ -53,7 +53,7 @@
53 'stock.location',53 'stock.location',
54 string='Location',54 string='Location',
55 ),55 ),
56 'supplier': fields.many2one(56 'supplier_id': fields.many2one(
57 'res.partner',57 'res.partner',
58 string='Supplier',58 string='Supplier',
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.",
@@ -124,7 +124,7 @@
124 if loc != -1:124 if loc != -1:
125 res['location_id'] = loc125 res['location_id'] = loc
126 if supplier != -1:126 if supplier != -1:
127 res['supplier'] = supplier127 res['supplier_id'] = supplier
128128
129 if not res['line_ids']:129 if not res['line_ids']:
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'))
@@ -146,7 +146,7 @@
146 if wiz.type == 'make_to_order':146 if wiz.type == 'make_to_order':
147 if not wiz.po_cft:147 if not wiz.po_cft:
148 raise osv.except_osv(_('Error'), _('The Procurement method should be filled !'))148 raise osv.except_osv(_('Error'), _('The Procurement method should be filled !'))
149 elif wiz.po_cft != 'cft' and not wiz.supplier:149 elif wiz.po_cft != 'cft' and not wiz.supplier_id:
150 raise osv.except_osv(_('Error'), _('You should select a supplier !'))150 raise osv.except_osv(_('Error'), _('You should select a supplier !'))
151151
152 errors = {}152 errors = {}
@@ -159,7 +159,7 @@
159 try:159 try:
160 line_obj.write(cr, uid, [line.id], {'type': wiz.type,160 line_obj.write(cr, uid, [line.id], {'type': wiz.type,
161 'po_cft': wiz.po_cft,161 'po_cft': wiz.po_cft,
162 'supplier': wiz.supplier and wiz.supplier.id or False,162 'supplier': wiz.supplier_id and wiz.supplier_id.id or False,
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},
164 context=context)164 context=context)
165 except osv.except_osv, e:165 except osv.except_osv, e:
@@ -227,7 +227,7 @@
227 if l_type == 'make_to_order':227 if l_type == 'make_to_order':
228 return {'value': {'location_id': False}}228 return {'value': {'location_id': False}}
229229
230 res = {'value': {'po_cft': False, 'supplier': False}}230 res = {'value': {'po_cft': False, 'supplier_id': False}}
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]:
232 return res232 return res
233233
@@ -248,15 +248,15 @@
248 all_line_empty = False248 all_line_empty = False
249249
250 if all_line_empty: # by default, and if all lines has no location, then set by default Stock250 if all_line_empty: # by default, and if all lines has no location, then set by default Stock
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}}
252 return {'value': {'po_cft': False, 'supplier': False}}252 return {'value': {'po_cft': False, 'supplier_id': False}}
253253
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):
255 '''255 '''
256 Unset the supplier if tender is choosen256 Unset the supplier if tender is choosen
257 '''257 '''
258 if po_cft == 'cft':258 if po_cft == 'cft':
259 return {'value': {'supplier': False}}259 return {'value': {'supplier_id': False}}
260260
261 return {}261 return {}
262262
@@ -278,16 +278,16 @@
278 }278 }
279 return result279 return result
280280
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):
282 res = {'value': {}}282 res = {'value': {}}
283 if not location_id:283 if not location_id:
284 return res284 return res
285285
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]:
287 return res287 return res
288288
289 line_obj = self.pool.get('sale.order.line')289 line_obj = self.pool.get('sale.order.line')
290 active_ids = context[0][2]290 active_ids = line_ids[0][2]
291291
292 context = {}292 context = {}
293 context.update({'from_multiple_line_sourcing': False})293 context.update({'from_multiple_line_sourcing': False})
294294
=== modified file 'sourcing/wizard/multiple_sourcing_view.xml'
--- sourcing/wizard/multiple_sourcing_view.xml 2014-10-09 13:19:51 +0000
+++ sourcing/wizard/multiple_sourcing_view.xml 2015-03-12 10:44:53 +0000
@@ -15,35 +15,24 @@
15 </group>15 </group>
16 <group colspan="4" col="4">16 <group colspan="4" col="4">
17 <separator colspan="4" string="Selected lines to source" />17 <separator colspan="4" string="Selected lines to source" />
18 <field name="line_ids" nolabel="1" colspan="4">18 <field name="line_ids" nolabel="1" colspan="4" />
19 <tree string="Lines to source" hide_new_button="True" noteditable="True">
20 <field name="order_id" string="Order reference" />
21 <field name="line_number" />
22 <field name="product_id" />
23 <field name="product_uom_qty" />
24 <field name="product_uom" />
25 <field name="real_stock" />
26 <field name="available_stock" />
27 <field name="virtual_stock" />
28 </tree>
29 </field>
30 <separator colspan="4" string="Procurement method" />19 <separator colspan="4" string="Procurement method" />
31 <field name="type" 20 <field name="type"
32 on_change="change_type(type, line_ids)"/>21 on_change="change_type(type)"/>
33 <field name="po_cft" attrs="{'readonly': [('type', '=', 'make_to_stock')]}"22 <field name="po_cft" attrs="{'readonly': [('type', '=', 'make_to_stock')]}"
34 on_change="change_po_cft(po_cft)"/>23 on_change="change_po_cft(po_cft)"/>
35 <separator colspan="4" string="Supplier selection" />24 <separator colspan="4" string="Supplier selection" />
36 <field name="supplier"25 <field name="supplier_id"
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)]"
38 attrs="{'readonly': ['|', ('po_cft', '=', 'cft'), ('type', '=', 'make_to_stock')]}"27 attrs="{'readonly': ['|', ('po_cft', '=', 'cft'), ('type', '=', 'make_to_stock')]}"
39 on_change="change_supplier(supplier)"28 on_change="change_supplier(supplier_id)"
40 />29 />
4130
4231
43 <field name="location_id" domain="[('usage', '=', 'internal'), ('quarantine_location', '=', False), 32 <field name="location_id" domain="[('usage', '=', 'internal'), ('quarantine_location', '=', False),
44 ('scrap_location', '=', False), ('destruction_location', '=', False), 33 ('scrap_location', '=', False), ('destruction_location', '=', False),
45 ('output_ok', '=', False), ('input_ok', '=', False)]" 34 ('output_ok', '=', False), ('input_ok', '=', False)]"
46 attrs="{'readonly': [('type', '!=', 'make_to_stock')]}" 35 attrs="{'readonly': [('type', '!=', 'make_to_stock')]}"
47 on_change="change_location(location_id, line_ids)" />36 on_change="change_location(location_id, line_ids)" />
4837
49 </group>38 </group>
@@ -59,8 +48,8 @@
59 <record id="sourcing_line_special_tree_view" model="ir.ui.view">48 <record id="sourcing_line_special_tree_view" model="ir.ui.view">
60 <field name="name">sourcing.line.special.tree.view</field>49 <field name="name">sourcing.line.special.tree.view</field>
61 <field name="model">sale.order.line</field>50 <field name="model">sale.order.line</field>
62 <field name="type">form</field>51 <field name="type">tree</field>
63 <field name="priority" eval="5000" />52 <field name="priority" eval="10" />
64 <field name="arch" type="xml">53 <field name="arch" type="xml">
65 <tree string="Lines to source" hide_new_button="True" noteditable="True">54 <tree string="Lines to source" hide_new_button="True" noteditable="True">
66 <field name="order_id" string="Order reference" />55 <field name="order_id" string="Order reference" />
6756
=== modified file 'stock_override/report/internal_move.rml'
--- stock_override/report/internal_move.rml 2014-04-08 12:14:42 +0000
+++ stock_override/report/internal_move.rml 2015-03-12 10:44:53 +0000
@@ -9,7 +9,7 @@
9 </pageGraphics>9 </pageGraphics>
10 </pageTemplate>-->10 </pageTemplate>-->
1111
12 <pageTemplate>12 <pageTemplate id="first">
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"/>
14 <pageGraphics>14 <pageGraphics>
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>
@@ -23,6 +23,19 @@
23 <lines>25 550 818 550</lines>23 <lines>25 550 818 550</lines>
24 </pageGraphics>24 </pageGraphics>
25 </pageTemplate>25 </pageTemplate>
26 <pageTemplate id="second">
27 <frame id="second" x1="28.0" y1="28.0" width="786" height="525"/>
28 <pageGraphics>
29 <fill color="black"/>
30 <stroke color="black"/>
31 <setFont name="DejaVu Sans" size="8"/>
32 <drawString x="25" y="555"> [[ formatLang(time.strftime("%Y-%m-%d"), date=True) ]] [[ time.strftime("%H:%M") ]]</drawString>
33 <setFont name="DejaVu Sans Bold" size="10"/>
34 <drawString x="382" y="555">[[ company.partner_id.name ]]</drawString>
35 <stroke color="#000000"/>
36 <lines>25 550 818 550</lines>
37 </pageGraphics>
38 </pageTemplate>
2639
27 </template>40 </template>
2841
@@ -36,6 +49,7 @@
36 <blockTableStyle id="HeaderInfo">49 <blockTableStyle id="HeaderInfo">
37 <blockValign value="MIDDLE" />50 <blockValign value="MIDDLE" />
38 <lineStyle kind="GRID" colorName="#f2f2f2" />51 <lineStyle kind="GRID" colorName="#f2f2f2" />
52 <blockSpan start="1,-1" stop="-1,-1" />
39 </blockTableStyle>53 </blockTableStyle>
4054
41 <blockTableStyle id="LineHeader">55 <blockTableStyle id="LineHeader">
@@ -88,7 +102,7 @@
88 </para>102 </para>
89103
90 <!-- Header Information -->104 <!-- Header Information -->
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">
92 <tr>106 <tr>
93 <td>107 <td>
94 <para style="HeaderRight">Reference :</para>108 <para style="HeaderRight">Reference :</para>
@@ -97,10 +111,10 @@
97 <para style="Header">[[ picking.name ]]</para>111 <para style="Header">[[ picking.name ]]</para>
98 </td>112 </td>
99 <td>113 <td>
100 <para style="HeaderRight">Origin :</para>114 <para style="HeaderRight">Order Category :</para>
101 </td>115 </td>
102 <td>116 <td>
103 <para style="Header">[[ picking.origin ]]</para>117 <para style="Header">[[ get_selec(picking, 'order_category') ]]</para>
104 </td>118 </td>
105 <td>119 <td>
106 <para style="HeaderRight">Actual Receipt Date :</para>120 <para style="HeaderRight">Actual Receipt Date :</para>
@@ -131,12 +145,6 @@
131 </tr>145 </tr>
132 <tr>146 <tr>
133 <td>147 <td>
134 <para style="HeaderRight">Order Category :</para>
135 </td>
136 <td>
137 <para style="Header">[[ get_selec(picking, 'order_category') ]]</para>
138 </td>
139 <td>
140 <para style="HeaderRight">State :</para>148 <para style="HeaderRight">State :</para>
141 </td>149 </td>
142 <td>150 <td>
@@ -148,6 +156,20 @@
148 <td>156 <td>
149 <para style="Header"> </para>157 <para style="Header"> </para>
150 </td>158 </td>
159 <td>
160 <para style="HeaderRight"> </para>
161 </td>
162 <td>
163 <para style="Header"> </para>
164 </td>
165 </tr>
166 <tr>
167 <td>
168 <para style="HeaderRight">Origin :</para>
169 </td>
170 <td>
171 <para style="Header">[[ picking.origin ]]</para>
172 </td>
151 </tr>173 </tr>
152 </blockTable>174 </blockTable>
153175
@@ -155,6 +177,7 @@
155 <font color="white"> </font>177 <font color="white"> </font>
156 </para>178 </para>
157179
180 <setNextTemplate name="second" />
158181
159 <section>182 <section>
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">
@@ -242,7 +265,7 @@
242 <para style="Header">265 <para style="Header">
243 <font color="white"> </font>266 <font color="white"> </font>
244 </para>267 </para>
245 268
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">
247 <tr>270 <tr>
248 <td>271 <td>
249272
=== modified file 'unifield_tests/master_data/070_products.yml'
--- unifield_tests/master_data/070_products.yml 2014-10-09 06:56:59 +0000
+++ unifield_tests/master_data/070_products.yml 2015-03-12 10:44:53 +0000
@@ -4,7 +4,7 @@
4 Create Product PL14 Create Product PL1
5-5-
6 !record {model: product.product, id: prod_log_1}:6 !record {model: product.product, id: prod_log_1}:
7 code: PL1 (Test)7 default_code: PL1 (Test)
8 name: PL1 (Test)8 name: PL1 (Test)
9 supply_method: buy9 supply_method: buy
10 type: product10 type: product
@@ -18,7 +18,7 @@
18 Create Product PL218 Create Product PL2
19-19-
20 !record {model: product.product, id: prod_log_2}:20 !record {model: product.product, id: prod_log_2}:
21 code: PL2 (Test)21 default_code: PL2 (Test)
22 name: PL2 (Test)22 name: PL2 (Test)
23 supply_method: buy23 supply_method: buy
24 type: product24 type: product
@@ -32,7 +32,7 @@
32 Create Product PL332 Create Product PL3
33-33-
34 !record {model: product.product, id: prod_log_3}:34 !record {model: product.product, id: prod_log_3}:
35 code: PL3 (Test)35 default_code: PL3 (Test)
36 name: PL3 (Test)36 name: PL3 (Test)
37 supply_method: buy37 supply_method: buy
38 type: product38 type: product
@@ -46,7 +46,7 @@
46 Create Product PL446 Create Product PL4
47-47-
48 !record {model: product.product, id: prod_log_4}:48 !record {model: product.product, id: prod_log_4}:
49 code: PL4 (Test)49 default_code: PL4 (Test)
50 name: PL4 (Test)50 name: PL4 (Test)
51 supply_method: buy51 supply_method: buy
52 type: product52 type: product
@@ -60,7 +60,7 @@
60 Create Product PL560 Create Product PL5
61-61-
62 !record {model: product.product, id: prod_log_5}:62 !record {model: product.product, id: prod_log_5}:
63 code: PL5 (Test)63 default_code: PL5 (Test)
64 name: PL5 (Test)64 name: PL5 (Test)
65 supply_method: buy65 supply_method: buy
66 type: product66 type: product
@@ -76,7 +76,7 @@
76 Create Product PM176 Create Product PM1
77-77-
78 !record {model: product.product, id: prod_med_1}:78 !record {model: product.product, id: prod_med_1}:
79 code: PM1 (Test)79 default_code: PM1 (Test)
80 name: PM1 (Test)80 name: PM1 (Test)
81 supply_method: buy81 supply_method: buy
82 type: product82 type: product
@@ -90,7 +90,7 @@
90 Create Product PM90 Create Product PM
91-91-
92 !record {model: product.product, id: prod_med_2}:92 !record {model: product.product, id: prod_med_2}:
93 code: PM2 (Test)93 default_code: PM2 (Test)
94 name: PM2 (Test)94 name: PM2 (Test)
95 supply_method: buy95 supply_method: buy
96 type: product96 type: product
@@ -104,7 +104,7 @@
104 Create Product PM3104 Create Product PM3
105-105-
106 !record {model: product.product, id: prod_med_3}:106 !record {model: product.product, id: prod_med_3}:
107 code: PM3 (Test)107 default_code: PM3 (Test)
108 name: PM3 (Test)108 name: PM3 (Test)
109 supply_method: buy109 supply_method: buy
110 type: product110 type: product
@@ -118,7 +118,7 @@
118 Create Product PM4118 Create Product PM4
119-119-
120 !record {model: product.product, id: prod_med_4}:120 !record {model: product.product, id: prod_med_4}:
121 code: PM4 (Test)121 default_code: PM4 (Test)
122 name: PM4 (Test)122 name: PM4 (Test)
123 supply_method: buy123 supply_method: buy
124 type: product124 type: product
@@ -132,7 +132,7 @@
132 Create Product PM5132 Create Product PM5
133-133-
134 !record {model: product.product, id: prod_med_5}:134 !record {model: product.product, id: prod_med_5}:
135 code: PM5 (Test)135 default_code: PM5 (Test)
136 name: PM5 (Test)136 name: PM5 (Test)
137 supply_method: buy137 supply_method: buy
138 type: product138 type: product
139139
=== added file 'unifield_tests/tests/test_fo.py'
--- unifield_tests/tests/test_fo.py 1970-01-01 00:00:00 +0000
+++ unifield_tests/tests/test_fo.py 2015-03-12 10:44:53 +0000
@@ -0,0 +1,76 @@
1#!/usr/bin/env python
2# -*- coding: utf-8 -*-
3from __future__ import print_function
4from unifield_test import UnifieldTest
5from oerplib.error import RPCError
6
7import time
8
9
10class FOTest(UnifieldTest):
11
12 def setUp(self):
13 self.used_db = self.c1
14 db = self.used_db
15 self.fo_obj = db.get('sale.order')
16 self.fol_obj = db.get('sale.order.line')
17
18 def test_validation_no_price_unit(self):
19 """
20 Create a FO with two lines. One of these lines have no price unit.
21 Expected result: An error must be raised
22 """
23 partner_id = self.get_record(self.used_db, 'ext_customer_1')
24 order_type = 'regular'
25
26 # Get the analytic distribution
27 distrib_id = self.get_record(self.used_db, 'distrib_1')
28
29 order_values = self.fo_obj.\
30 onchange_partner_id(None, partner_id, order_type).get('value', {})
31 order_values.update({
32 'order_type': order_type,
33 'procurement_request': False,
34 'partner_id': partner_id,
35 'ready_to_ship_date': time.strftime('%Y-%m-%d'),
36 'analytic_distribution_id': distrib_id,
37 })
38 order_id = self.fo_obj.create(order_values)
39
40 # Create order lines
41 prod_log1_id = self.get_record(self.used_db, 'prod_log_1')
42 prod_log2_id = self.get_record(self.used_db, 'prod_log_2')
43 uom_pce_id = self.get_record(
44 self.used_db,
45 'product_uom_unit',
46 module='product'
47 )
48
49 line_values = {
50 'order_id': order_id,
51 'product_id': prod_log1_id,
52 'product_uom': uom_pce_id,
53 'product_uom_qty': 10.0,
54 'type': 'make_to_order',
55 'price_unit': 10.0,
56 }
57 self.fol_obj.create(line_values)
58
59 line_values.update({
60 'product_id': prod_log2_id,
61 'price_unit': 0.0,
62 })
63 self.fol_obj.create(line_values)
64
65 try:
66 self.c1.exec_workflow('sale.order', 'order_validated', order_id)
67 self.assert_(
68 False,
69 'No error message at FO validation with line with no price.',
70 )
71 except RPCError as e:
72 return True
73
74
75def get_test_class():
76 return FOTest
077
=== modified file 'unifield_tests/tests/test_uftp_324.py'
--- unifield_tests/tests/test_uftp_324.py 2014-10-17 14:14:49 +0000
+++ unifield_tests/tests/test_uftp_324.py 2015-03-12 10:44:53 +0000
@@ -112,6 +112,17 @@
112 # Validate the sale order112 # Validate the sale order
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)
114114
115 def test_utp_324(self):
116 """
117 Cancel the PO at coordo side, synchronize and check the state of the PO at
118 project side.
119 :return:
120 """
121 wiz_model = 'purchase.order.cancel.wizard'
122 c_wiz_obj = self.c1.get(wiz_model)
123 c_lc_wiz_obj = self.c1.get('sale.order.leave.close')
124 c_cancel_so_wiz_obj = self.c1.get('sale.order.cancelation.wizard')
125
115 # Source all lines on a Purchase Order to ext_supplier_1126 # Source all lines on a Purchase Order to ext_supplier_1
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)])
117 self.c_sol_obj.write(line_ids, {128 self.c_sol_obj.write(line_ids, {
@@ -147,17 +158,6 @@
147158
148 self.c_po_id = po_line['order_id'][0]159 self.c_po_id = po_line['order_id'][0]
149160
150 def test_utp_324(self):
151 """
152 Cancel the PO at coordo side, synchronize and check the state of the PO at
153 project side.
154 :return:
155 """
156 wiz_model = 'purchase.order.cancel.wizard'
157 c_wiz_obj = self.c1.get(wiz_model)
158 c_lc_wiz_obj = self.c1.get('sale.order.leave.close')
159 c_cancel_so_wiz_obj = self.c1.get('sale.order.cancelation.wizard')
160
161 # Cancel PO at coordo side161 # Cancel PO at coordo side
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)
163 # Validate cancellation163 # Validate cancellation
@@ -192,4 +192,4 @@
192 )192 )
193193
194def get_test_class():194def get_test_class():
195 return UFTP324Test
196\ No newline at end of file195\ No newline at end of file
196 return UFTP324Test

Subscribers

People subscribed via source and target branches