Skip to Content
Menu
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
To pytanie dostało ostrzeżenie
1 Odpowiedz
5627 Widoki

Under accounting -> Vendors -> Bills:


How do I ensure that for a given vendor bill, if someone creates a new Bill in the system with the same reference ('ref') string it should raise an exception. Vendor bills should have unique reference. 

https://imgur.com/EWrnS0S

After Inheriting the account.move, how can I get the context with constrains method where if a user tries to create a new bill with a reference which already exists in the system, it should raise an exception and not make a duplicate?


Thank you for your time. 

Awatar
Odrzuć
Najlepsza odpowiedź

This is already checked in Odoo. 

See https://github.com/odoo/odoo/blob/13.0/addons/account/models/account_move.py#L1458

Awatar
Odrzuć
Powiązane posty Odpowiedzi Widoki Czynność
2
gru 23
1388
1
wrz 23
2065
0
wrz 22
2829
0
sie 25
133
0
sie 25
177