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

Hello all,

In these 3 tables, we have a column « name » :

  • purchase_order_line

  • sale_order_line

  • account_invoice_line

we don't want the internal code at the beginning of the field « name ».

For example, in this field, instead of « [g-cafe] Grand café », we just want « Grand café ».

Thanks to help!

อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

Hello Pascal,

You must be referring to this issue on a particular field, such as the product, right?

By default on each model the name shown in the lists corresponds to the field 'name' in that model.

However there's the option to override this behaviour, in order to customize the name shown, by means of implementing method 'name_get' in a particular model.

In case of the model 'product', that is used in 'purchase.order.line', 'sale.order.line', '.account.invoice.line', the this method, as seen in the module 'product' and file 'product.py' does this concatenation:

name = '[%s] %s' % (code,name)

In order to avoid this you should create a new custom model, inherit from 'product' and redefine this method to suit your needs.

Regards,

Jordi Ballester

Eficent.


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

Thanks 100 times!

Related Posts ตอบกลับ มุมมอง กิจกรรม
1
มี.ค. 15
8195
1
มิ.ย. 24
2209
1
ส.ค. 24
5834
Create new invoice by code แก้ไขแล้ว
1
พ.ย. 22
18796
1
ก.ค. 21
2975