In invoice screen when i try to validate an invoice without adding any line items it throws me an error whereas in accounting -> journal entries I'm able to post an entry without adding any line items. How can i change this behavior of journal entries to the same as invoice.
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- सीआरएम
- e-Commerce
- लेखांकन
- इन्वेंटरी
- PoS
- Project
- MRP
This question has been flagged
Hi,
For this what you can do is that, inherit the account.move and super the function of the POST) action_post) button and check whether the end user entered the journal items(line_ids), if lines_ids is not entered you can return a warning message.
def action_post(self):
res = super(classname, self).action_post()
if not self.line_ids:
# return warning message
raise ValidationError(_("No Journal Items"))
return res
The code is just typed , not tested, so check and make necessary changes
Thanks
Thanks for the answer Raphy, I'll look into it and update the same.
It worked like a charm, Thanks bud!
Enjoying the discussion? Don't just read, join in!
Create an account today to enjoy exclusive features and engage with our awesome community!
Sign upRelated Posts | Replies | Views | Activity | |
---|---|---|---|---|
|
1
अग॰ 22
|
7116 | ||
|
1
मई 19
|
5947 | ||
|
12
अप्रैल 19
|
4760 | ||
|
3
अप्रैल 23
|
5798 | ||
|
2
जुल॰ 25
|
1485 |