Merge lp:~mallorymarcot/unifield-server/us-4708 into lp:unifield-server

Proposed by jftempo
Status: Merged
Merged at revision: 4966
Proposed branch: lp:~mallorymarcot/unifield-server/us-4708
Merge into: lp:unifield-server
Diff against target: 28 lines (+7/-0)
2 files modified
bin/addons/sale/sale_workflow.py (+4/-0)
bin/addons/sourcing/wizard/multiple_sourcing.py (+3/-0)
To merge this branch: bzr merge lp:~mallorymarcot/unifield-server/us-4708
Reviewer Review Type Date Requested Status
UniField Reviewer Team Pending
Review via email: mp+349125@code.launchpad.net
To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'bin/addons/sale/sale_workflow.py'
2--- bin/addons/sale/sale_workflow.py 2018-06-08 14:22:21 +0000
3+++ bin/addons/sale/sale_workflow.py 2018-07-09 08:35:53 +0000
4@@ -555,6 +555,10 @@
5 )
6 if not sol.stock_take_date and sol.order_id.stock_take_date:
7 to_write['stock_take_date'] = sol.order_id.stock_take_date
8+ if sol.order_id.order_type == 'loan':
9+ to_write['supplier'] = False
10+ to_write['type'] = 'make_to_stock'
11+ to_write['po_cft'] = False
12 if not sol.order_id.procurement_request: # in case of FO
13 # check unit price:
14 if not sol.price_unit or sol.price_unit <= 0:
15
16=== modified file 'bin/addons/sourcing/wizard/multiple_sourcing.py'
17--- bin/addons/sourcing/wizard/multiple_sourcing.py 2018-04-11 09:09:40 +0000
18+++ bin/addons/sourcing/wizard/multiple_sourcing.py 2018-07-09 08:35:53 +0000
19@@ -282,6 +282,9 @@
20 raise osv.except_osv(_('Error'), _('You cannot choose Direct Purchase Order as method to source Internal Request lines.'))
21 lines_to_confirm.append(sol.id)
22
23+ if wiz.type == 'make_to_order' and sol.order_id.order_type == 'loan':
24+ raise osv.except_osv(_('Error'), _('Line #%s of %s You cannot cannot source a loan on order') % (sol.line_number, sol.order_id.name))
25+
26 line_obj.confirmLine(cr, uid, lines_to_confirm, context=context)
27
28 return {'type': 'ir.actions.act_window_close'}

Subscribers

People subscribed via source and target branches