Merge lp:~unifield-team/unifield-server/us-2415 into lp:unifield-server

Proposed by jftempo
Status: Merged
Merged at revision: 4319
Proposed branch: lp:~unifield-team/unifield-server/us-2415
Merge into: lp:unifield-server
Diff against target: 58 lines (+24/-6)
1 file modified
bin/addons/msf_printed_documents/report/report_reception.py (+24/-6)
To merge this branch: bzr merge lp:~unifield-team/unifield-server/us-2415
Reviewer Review Type Date Requested Status
UniField Reviewer Team Pending
Review via email: mp+320363@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/msf_printed_documents/report/report_reception.py'
2--- bin/addons/msf_printed_documents/report/report_reception.py 2016-03-08 15:32:40 +0000
3+++ bin/addons/msf_printed_documents/report/report_reception.py 2017-03-20 14:27:26 +0000
4@@ -93,14 +93,14 @@
5
6 def getQtyPO(self,line):
7 # line amount from the PO, always the same on all INs for a given PO
8- val = line.purchase_line_id.product_qty if line.purchase_line_id else 0
9+ val = line.purchase_line_id.product_qty if line.purchase_line_id else line.product_qty
10 return "{0:.2f}".format(val)
11
12 def getQtyBO(self,line,o):
13 # Back Order amount = PO amount - all receipts
14
15 # get PO qty
16- qtyPO = line.purchase_line_id.product_qty if line.purchase_line_id else 0
17+ qtyPO = line.purchase_line_id.product_qty if line.purchase_line_id else line.product_qty
18 # get received qty (current and previous INs)
19 cr, uid = self.cr, self.uid
20 val = 0.00
21@@ -147,16 +147,34 @@
22 return time.strftime('%d/%m/%Y', time.strptime(o.min_date,'%Y-%m-%d %H:%M:%S'))
23
24 def getPartnerCity(self,o):
25- return o.purchase_id and o.purchase_id.partner_address_id and o.purchase_id.partner_address_id.city or False
26+ if o.purchase_id:
27+ return o.purchase_id and o.purchase_id.partner_address_id and o.purchase_id.partner_address_id.city or False
28+ elif o.partner_id and len(o.partner_id.address):
29+ return o.partner_id.address[0].city
30+ else:
31+ return False
32
33 def getPartnerPhone(self,o):
34- return o.purchase_id and o.purchase_id.partner_address_id and o.purchase_id.partner_address_id.phone or False
35+ if o.purchase_id:
36+ return o.purchase_id and o.purchase_id.partner_address_id and o.purchase_id.partner_address_id.phone or False
37+ elif o.partner_id and len(o.partner_id.address):
38+ return o.partner_id.address[0].phone
39+ else:
40+ return False
41
42 def getPartnerName(self,o):
43- return o.purchase_id and o.purchase_id.partner_id and o.purchase_id.partner_id.name or False
44+ if o.purchase_id:
45+ return o.purchase_id and o.purchase_id.partner_id and o.purchase_id.partner_id.name or False
46+ elif o.partner_id:
47+ return o.partner_id.name
48+ else:
49+ return False
50
51 def getPartnerAddress(self,o):
52- temp = o.purchase_id and o.purchase_id.partner_address_id.name_get()
53+ if o.purchase_id:
54+ temp = o.purchase_id and o.purchase_id.partner_address_id.name_get()
55+ elif o.partner_id and len(o.partner_id.address):
56+ temp = o.partner_id.address[0].name_get()
57 if temp:
58 return temp[0][1]
59

Subscribers

People subscribed via source and target branches

to all changes: