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

Hi everyone,

Help me please I want to add a smart button on partner form that shows the amount of unpaid invoice(the credit).

Thanks

Avatar
Discard
Best Answer

You could do it like:

in the .xml

<div class="oe_right oe_button_box" name="buttons">

<button class="oe_inline oe_stat_button" type="action" style="margin-righ: 10px"

name="%(action_open_view_move_line_to_invoice_form)d" icon="fa-strikethrough"

context="{'invoice_type': 'paid'}">

<div>Invoice UnPaids<br/><strong><field name="unpaid_count" widget="monetary"/></strong></div>

</button>

</div>

in the .py
_columns = {
...
'unpaid_count': fields.function(_unpaid_count, string='UnPaid', type='float', digits_compute=dp.get_precision('Product Price')),
}
You just need to implement the function _unpaid_count to return the values



Avatar
Discard