Dear
We develop an application that inherits the contract module "Contracts Management - Recurring" by means of which a partner can have several contracts. The partner_id field can only be made mandatory at the view level, because other applications such as Project enter records into the account.analytic.account model for which this field is not mandatory. On the other hand in the Contacts module (res.partner) it is allowed to delete contacts, permission that can not be removed from the users. However, in the Contacts module there are 2 options to delete contacts, the first with the Action \ Delete button and the second by clicking on the kanban of the "Contacts & Address" page. In both cases the contact is deleted without taking into account that it has contracts in the contract module. What I need is that in the 2 deletion options it is not allowed to delete the contact that has associated contracts.
I would appreciate any suggestions.
We are working with Odoo 11.0
Hi Niyas, thank you for your kind answer!
But, it is not clear to me in which model I should put it, is it in account.analytic.account.py? What effect does the clause ondelete = 'restrict'?
A new question Do not allow deleting a contact with an associated contract on Help has been posted. Click here to access the question :
See question
Sent by Odoo S.A. using Odoo.
Hi Niyas, thank you for your kind answer!
But, it is not clear to me in which module I should put it, is it in account.analytic.account.py? What effect does the clause ondelete = 'restricted'?