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

Hi Everyone,

I have a custom field x_months_due in res.partner model. I wish to return the calculated value of the division between total receivables ( for the partner) and price_surcharge ( defined in pricelist and selected ( specific) for the partner.


The field x_months_due should ideally be updated on the fly.

Regards,

Flam

Avatar
Discard
Best Answer

x_months_due = fields.Integer(" x_months_due", compute="get_due")

@api.one
def get_due(self):
      self.x_months_due = #you computed value




Avatar
Discard
Author

Hi Hilar,

Thank you for your reply. The custom fields ( x_moths_due) indicated above was created settings > database structure > fields method. I am at a loss on how to define the above solution that you proposed to the custom field x_months_due. Thanking you FN