Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
1893 Lượt xem

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



Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
2
thg 8 25
3921
1
thg 7 24
1851
3
thg 12 23
2084
UpLoad Budget Đã xử lý
1
thg 5 23
2785
0
thg 9 17
3472