Odoo Help

0

Smart button on partner form

By
Jihen BEN ALI
on 2/1/16, 10:58 AM 497 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

1
Axel Mendoza
On 2/4/16, 4:48 AM

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



About This Community

This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

Register

Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

1 follower(s)

Stats

Asked: 2/1/16, 10:58 AM
Seen: 497 times
Last updated: 2/4/16, 4:48 AM