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

I have inherited the sale order line and added some custom fields for my needs.

Now I need to add button against each line for a function that is applied on each line of a sale order on that button click.

Is there a way to bring it?

الصورة الرمزية
إهمال
أفضل إجابة

Hi,

You can inherit the sale order line view and add a button inside the line similar to the Register Lots, Packs and Location button in picking.
Add the button after your custom fields on sale.order.line view inside your XML file.

.xml

<button name="button_function" string="String you want" type="object" icon="fa-icon_you_like"
width="0.1"
options='{"warn": true}'/>

.py

class SaleOrderLine(models.Model):
_inherit = 'sale.order.line'

def button_function(self):
"""And then write your function"""

Regards

الصورة الرمزية
إهمال
الكاتب

This is it. Thank you.

المنشورات ذات الصلة الردود أدوات العرض النشاط
2
أغسطس 20
2912
0
فبراير 20
3944
0
أبريل 22
2099
0
نوفمبر 21
2380
1
سبتمبر 21
3374