Skip to Content
Menu
This question has been flagged
1 Reply
5242 Views

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?

Avatar
Discard
Best Answer

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

Avatar
Discard
Author

This is it. Thank you.

Related Posts Replies Views Activity
2
Aug 20
2198
0
Feb 20
2996
0
Apr 22
1376
0
Nov 21
1561
1
Sep 21
2080