Merge lp:~jfb-tempo-consulting/unifield-server/us-1212 into lp:unifield-server

Proposed by jftempo
Status: Merged
Merged at revision: 3700
Proposed branch: lp:~jfb-tempo-consulting/unifield-server/us-1212
Merge into: lp:unifield-server
Diff against target: 31 lines (+4/-3)
1 file modified
bin/addons/stock_override/stock.py (+4/-3)
To merge this branch: bzr merge lp:~jfb-tempo-consulting/unifield-server/us-1212
Reviewer Review Type Date Requested Status
UniField Reviewer Team Pending
Review via email: mp+291641@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
=== modified file 'bin/addons/stock_override/stock.py'
--- bin/addons/stock_override/stock.py 2016-03-24 16:43:45 +0000
+++ bin/addons/stock_override/stock.py 2016-04-12 15:35:13 +0000
@@ -993,7 +993,7 @@
993993
994 return res994 return res
995995
996 def is_invoice_needed(self, cr, uid, sp=None):996 def is_invoice_needed(self, cr, uid, sp=None, invoice_type=None):
997 """997 """
998 Check if invoice is needed. Cases where we do not need invoice:998 Check if invoice is needed. Cases where we do not need invoice:
999 - OUT from scratch (without purchase_id and sale_id) AND stock picking type in internal, external or esc999 - OUT from scratch (without purchase_id and sale_id) AND stock picking type in internal, external or esc
@@ -1026,7 +1026,8 @@
1026 res = False1026 res = False
10271027
1028 # (US-952) Move out on an external partner should not create a Stock Transfer Voucher1028 # (US-952) Move out on an external partner should not create a Stock Transfer Voucher
1029 if sp.type == 'out' and sp.partner_id.partner_type == 'external':1029 # US-1212: but should create refund
1030 if sp.type == 'out' and sp.partner_id.partner_type == 'external' and invoice_type != 'in_refund':
1030 res = False1031 res = False
10311032
1032 return res1033 return res
@@ -1040,7 +1041,7 @@
1040 invoice_type = self._get_invoice_type(stock_picking)1041 invoice_type = self._get_invoice_type(stock_picking)
10411042
1042 # Check if no invoice needed1043 # Check if no invoice needed
1043 if not self.is_invoice_needed(cr, uid, stock_picking):1044 if not self.is_invoice_needed(cr, uid, stock_picking, invoice_type):
1044 return1045 return
10451046
1046 # we do not create invoice for procurement_request (Internal Request)1047 # we do not create invoice for procurement_request (Internal Request)

Subscribers

People subscribed via source and target branches