Hello, i want to block creation of 2 invoices for the same user at the same date in odoo 12
User is allow to create a single invoice for a customer for the same date.
An alert must be done if the user tries to create a second invoice for the same customer at the same date.
Can anyone help me?
Thank you
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- CRM
- e-Commerce
- Accounting
- Inventory
- PoS
- Project management
- MRP
This question has been flagged
It is only possible if you do customization.
You need to do customization for it, you can use api.connstrains to write your logic-
@api.constrains('partner_id','user_id', 'date_invoice')
def check_same_invoice(self):
// write your logic for particular users to raise warning
Thank you for your answer, But I think I didn't express myself.
I actually want to send an alert when the same customer is billed twice on the same date
Maybe you read the answer carefully?
Enjoying the discussion? Don't just read, join in!
Create an account today to enjoy exclusive features and engage with our awesome community!
Sign up
I actually want to send an alert when the same customer is billed twice on the same date.
I create a custom module to inherit account.invoice and i add a sql contraint field but it doesn't work.
Here is the code add in inherit class account.invoice
_sql_constraints = [('paie_uniq', 'unique(partner_id,date_invoice)',
'Erreur !')]