Odoo Help

0
5 Answers
1
Avatar

Sudhir Arya (ERP Harbor Consulting Services)

--Sudhir Arya (ERP Harbor Consulting Services)--
14192
| 7 8 8
Ahmedabad, India
--Sudhir Arya (ERP Harbor Consulting Services)--

• Co-Founder & Co-Owner at ERP Harbor Consulting Services

• ERP Consultant / ERP Customization / TechnoFunctional Expert

• Sound knowledge in Python, Odoo (Open ERP), XML, PostgreSQL

• Domain knowledge of Sale Management, Purchase Management, Warehouse Management, Manufacturing, Multi Company Configuration & Management, HR Management, Medical Management, Construction Management, Education Management, Point of Sale, Third Party Integrations

• Positive attitude and quick Learner

• Good analytical skill, quick bug and issue tracing and find the solution

• Good knowledge and experience in payment gateway integration with Odoo

• Ready to accept new challenges

• Active Memeber On Stackoverflow 

LinkedIn

Blog

Stackoverflow

ERP Harbor Consulting Services

Skype:sudhir@erpharbor.com
Website: http://www.erpharbor.com
Sudhir Arya (ERP Harbor Consulting Services)
5/15/19, 3:37 AM

Hi Claudio Zayas,

You need to inherit the "account.analytic.account" object in your custom module and overwrite the partner_id field and add ondelete="restrict" in the field.

class AnalyticAccount(models.Model):
_inherit = 'account.analytic.account'

partner_id = fields.Many2one(ondelete="restrict")

ondelete restrict will now allow user to delete any partner record if it is associated with any Contract.

1
Avatar

Niyas Raphy

--Niyas Raphy--
14998
| 6 6 9
Calicut, India
--Niyas Raphy--

Odoo Techno Functionalist

Feel free to connect :  niyasraphyk@gmail.com

Twitter:https://twitter.com/niyasraphy
LinkedIn: https://www.linkedin.com/in/niyasraphy/
FB:https://www.facebook.com/niyasraphy123

Happy to help :)

Niyas Raphy
5/13/19, 9:34 AM

Hi,

You can use ondelete='restrict' with the partner field in your model.

partner = fields.Many2one('res.partner', string='Partner', ondelete='restrict')

Thanks

0
Claudio Zayas
5/15/19, 10:50 AM

Dear Sudhir & Niyas, thank you very much for your help. I applied your solution and it worked fine!

Best regards,

Claudio


Ask a Question
Keep Informed
1 follower(s)
About This Community

This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

Register
Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now