تخطي للذهاب إلى المحتوى
القائمة
لقد تم الإبلاغ عن هذا السؤال
2 الردود
6121 أدوات العرض

Enterprise 10, Self-hosted, Ubuntu 16.04, POS Box

I've found several tutorials on editing the POS Receipt and know where the code is to edit. What do I put in to show the product Internal Reference (default_code) in brackets before the product name? Or instead of that, have the Display Name appear instead of just product name. We have too many items with the same name and need to know which one it is if a customer returns or would like to get more and don't know the details. 

I have tried adding: 
<t t-esc='line.product_default_code' />
<t t-esc='line.product_defaultcode' />
...line.product.default_code... 

Nothing is working. What should I use to get the internal reference to appear?

الصورة الرمزية
إهمال

Have you tried like name_get()?

الكاتب

name_get() didn't give anything. Tried changing around and using other options but either gave errors or nothing.

أفضل إجابة

You can try

t-esc="line.product_id.with_context(display_default_code=True).display_name"

or

t-esc="line.product_id.default_code"
# if line is a product relational line else try
object.default_code
# the dict of product details passing while rendering pos form
'products': sorted([{
'product_id': product.id,
'product_name': product.name,
'code': product.default_code,
'quantity': qty,
'price_unit': price_unit,
'discount': discount,
'uom': product.uom_id.name
}
# so try to fetch the code
الصورة الرمزية
إهمال

see my updated answer

الكاتب

Where/how do I fetch the code for this? Tried a couple versions I found searching but seem to get error with them as well.

المنشورات ذات الصلة الردود أدوات العرض النشاط
0
أكتوبر 18
3444
0
مارس 15
5963
1
ديسمبر 24
2141
0
أغسطس 24
1747
1
أغسطس 24
2763