I was going through the code and randomly find this line. Can someone tell me what is it used for?
template = self.env.ref('coupon.mail_template_sale_coupon', raise_if_not_found=False)
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
I was going through the code and randomly find this line. Can someone tell me what is it used for?
template = self.env.ref('coupon.mail_template_sale_coupon', raise_if_not_found=False)
Hello Rob,
Looking through more of the code it looks like if the record cannot be found and raise_if_not_found is True, this line of code will run:
raise ValueError('No record found for unique ID %s. It may have been deleted.' % (xmlid))
If no record can be found and raise_if_not_found is False then the function will return None.
This can be seen here on the Github repository.
Thanks,
Thank you.
Create an account today to enjoy exclusive features and engage with our awesome community!
Sign upRelated Posts | Replies | Views | Activity | |
---|---|---|---|---|
|
1
Nov 24
|
1483 | ||
|
1
Nov 24
|
1188 | ||
|
2
Sep 24
|
1047 | ||
Update stock quantity
Solved
|
|
1
Aug 24
|
2451 | |
|
3
Aug 24
|
2686 |