コンテンツへスキップ
メニュー
この質問にフラグが付けられました
1823 ビュー

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'
))



アバター
破棄
関連投稿 返信 ビュー 活動
2
8月 25
3786
1
7月 24
1758
3
12月 23
1966
UpLoad Budget 解決済
1
5月 23
2701
0
9月 17
3407