Skip ke Konten
Menu
Pertanyaan ini telah diberikan tanda
1772 Tampilan

Dear all

I want to restrict account Budget entries on the basis of practical_amount exceeds planned _amount.

I have created new selection filed for budget type as flexible & strict in budget form. using onchange fuction for selection of strict budget filed need to restrict entries if it exceeded with warning.

class CrossoveredBudget(models.Model):
_inherit = "crossovered.budget"
budget_type = fields.Selection([('flexible', 'Flexible'), ('strict', 'Strict')],string="Budget Type", required=True)

@api.onchange("budget_type")
def change_budget_type(self):
if self.budget_type == "strict":
raise exceptions.UserError(_(
'This invoice exceeds the limits set in the Budget, use '
'another journal in order to validate this invoice'
))



Avatar
Buang
Post Terkait Replies Tampilan Aktivitas
2
Agu 25
3730
1
Jul 24
1683
3
Des 23
1919
UpLoad Budget Diselesaikan
1
Mei 23
2635
0
Sep 17
3353