Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
3 ตอบกลับ
2887 มุมมอง

Hi, I am looking to hide the sum in the document path of a purchase order from purchase.user (path to the current document at the very top right below menu):

https://de.imgbb.com/

I didn't even find the record to alter via xpath. If someone could tell me how to do it or at least point me in the direction, I'd be most grateful.

อวตาร
ละทิ้ง

Please provide a proper link to your image and make sure it is not necessary to sign up to look at the image, if not sure, please use imgur.com or tinypic.com.

ผู้เขียน

Sorry about that, I assume I can't post links due to low karma. Try: http://de.tinypic.com/r/25s7l7m/9

คำตอบที่ดีที่สุด

Hello,

This is the function which defines name for purchase order form, you can edit original code or overridethis function:

@api.multi
@api.depends('name', 'partner_ref')
def name_get(self):
result = []
for po in self:
name = po.name
if po.partner_ref:
name += ' ('+po.partner_ref+')'
if po.amount_total:
name += ': ' + formatLang(self.env, po.amount_total, currency_obj=po.currency_id)
result.append((po.id, name))
return result

This is available in addons/ purchase/ models/ purchase.py

If you don't want the amount you can delete these two lines

if po.amount_total:
name += ': ' + formatLang(self.env, po.amount_total, currency_obj=po.currency_id)


i.e, your final code should look like:

@api.multi
@api.depends('name', 'partner_ref')
def name_get(self):
result = []
for po in self:
name = po.name
if po.partner_ref:
name += ' ('+po.partner_ref+')'
result.append((po.id, name))
return result


อวตาร
ละทิ้ง
ผู้เขียน

Hi Mohammed, thank you for your input! I ended up overwritting the function in my module and commenting formatLang. I was hoping to solve it via xml to keep the sum for purchase managers, but this does the job as well helping me a lot, thanks!

Related Posts ตอบกลับ มุมมอง กิจกรรม
0
พ.ค. 22
2613
0
ก.ค. 24
1967
1
พ.ย. 20
4227
1
ต.ค. 20
4832
3
เม.ย. 18
7287