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
=== modified file 'bin/addons/msf_printed_documents/report/report_reception.py'
--- bin/addons/msf_printed_documents/report/report_reception.py 2016-03-08 15:32:40 +0000
+++ bin/addons/msf_printed_documents/report/report_reception.py 2017-03-20 14:27:26 +0000
@@ -93,14 +93,14 @@
9393
94 def getQtyPO(self,line):94 def getQtyPO(self,line):
95 # line amount from the PO, always the same on all INs for a given PO95 # line amount from the PO, always the same on all INs for a given PO
96 val = line.purchase_line_id.product_qty if line.purchase_line_id else 096 val = line.purchase_line_id.product_qty if line.purchase_line_id else line.product_qty
97 return "{0:.2f}".format(val)97 return "{0:.2f}".format(val)
9898
99 def getQtyBO(self,line,o):99 def getQtyBO(self,line,o):
100 # Back Order amount = PO amount - all receipts100 # Back Order amount = PO amount - all receipts
101101
102 # get PO qty102 # get PO qty
103 qtyPO = line.purchase_line_id.product_qty if line.purchase_line_id else 0103 qtyPO = line.purchase_line_id.product_qty if line.purchase_line_id else line.product_qty
104 # get received qty (current and previous INs)104 # get received qty (current and previous INs)
105 cr, uid = self.cr, self.uid105 cr, uid = self.cr, self.uid
106 val = 0.00106 val = 0.00
@@ -147,16 +147,34 @@
147 return time.strftime('%d/%m/%Y', time.strptime(o.min_date,'%Y-%m-%d %H:%M:%S'))147 return time.strftime('%d/%m/%Y', time.strptime(o.min_date,'%Y-%m-%d %H:%M:%S'))
148148
149 def getPartnerCity(self,o):149 def getPartnerCity(self,o):
150 return o.purchase_id and o.purchase_id.partner_address_id and o.purchase_id.partner_address_id.city or False150 if o.purchase_id:
151 return o.purchase_id and o.purchase_id.partner_address_id and o.purchase_id.partner_address_id.city or False
152 elif o.partner_id and len(o.partner_id.address):
153 return o.partner_id.address[0].city
154 else:
155 return False
151156
152 def getPartnerPhone(self,o):157 def getPartnerPhone(self,o):
153 return o.purchase_id and o.purchase_id.partner_address_id and o.purchase_id.partner_address_id.phone or False158 if o.purchase_id:
159 return o.purchase_id and o.purchase_id.partner_address_id and o.purchase_id.partner_address_id.phone or False
160 elif o.partner_id and len(o.partner_id.address):
161 return o.partner_id.address[0].phone
162 else:
163 return False
154164
155 def getPartnerName(self,o):165 def getPartnerName(self,o):
156 return o.purchase_id and o.purchase_id.partner_id and o.purchase_id.partner_id.name or False166 if o.purchase_id:
167 return o.purchase_id and o.purchase_id.partner_id and o.purchase_id.partner_id.name or False
168 elif o.partner_id:
169 return o.partner_id.name
170 else:
171 return False
157172
158 def getPartnerAddress(self,o):173 def getPartnerAddress(self,o):
159 temp = o.purchase_id and o.purchase_id.partner_address_id.name_get()174 if o.purchase_id:
175 temp = o.purchase_id and o.purchase_id.partner_address_id.name_get()
176 elif o.partner_id and len(o.partner_id.address):
177 temp = o.partner_id.address[0].name_get()
160 if temp:178 if temp:
161 return temp[0][1]179 return temp[0][1]
162180

Subscribers

People subscribed via source and target branches

to all changes: