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
1=== modified file 'bin/addons/stock_override/stock.py'
2--- bin/addons/stock_override/stock.py 2016-03-24 16:43:45 +0000
3+++ bin/addons/stock_override/stock.py 2016-04-12 15:35:13 +0000
4@@ -993,7 +993,7 @@
5
6 return res
7
8- def is_invoice_needed(self, cr, uid, sp=None):
9+ def is_invoice_needed(self, cr, uid, sp=None, invoice_type=None):
10 """
11 Check if invoice is needed. Cases where we do not need invoice:
12 - OUT from scratch (without purchase_id and sale_id) AND stock picking type in internal, external or esc
13@@ -1026,7 +1026,8 @@
14 res = False
15
16 # (US-952) Move out on an external partner should not create a Stock Transfer Voucher
17- if sp.type == 'out' and sp.partner_id.partner_type == 'external':
18+ # US-1212: but should create refund
19+ if sp.type == 'out' and sp.partner_id.partner_type == 'external' and invoice_type != 'in_refund':
20 res = False
21
22 return res
23@@ -1040,7 +1041,7 @@
24 invoice_type = self._get_invoice_type(stock_picking)
25
26 # Check if no invoice needed
27- if not self.is_invoice_needed(cr, uid, stock_picking):
28+ if not self.is_invoice_needed(cr, uid, stock_picking, invoice_type):
29 return
30
31 # we do not create invoice for procurement_request (Internal Request)

Subscribers

People subscribed via source and target branches