Hello community,
I have a problem with the overload of the create() and write() methods.
Let me explain.
My custom module inherits from a custom module in which I have no rights to modify the code. These 2 modules overload the create and write methods. On the other hand, I don't like the custom module overloads. So I want to override these method overloads so that my new overloads in my custom module are taken into account. How can I do it?
I tried not to call super(), it works but it doesn't call other write and create method() from all other modules. Do you have any idea please? thank you in advance
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
2
Replies
1993
Views
Here you can use monkey patch.
For more information please check this discussion.
Hello
You can do something like this:
from odoo.addons.stock.models.stock_picking import Picking
def button_validate(self):
#your code
return
Picking.button_validate = button_validate
Enjoying the discussion? Don't just read, join in!
Create an account today to enjoy exclusive features and engage with our awesome community!
Sign upRelated Posts | Replies | Views | Activity | |
---|---|---|---|---|
|
2
Nov 24
|
263 | ||
|
1
Oct 24
|
331 | ||
|
4
Oct 24
|
324 | ||
Connect Odoo with unopim
Solved
|
|
2
Oct 24
|
361 | |
|
2
Dec 24
|
666 |
You can skip all the models and call the base Model
BaseMetaModel = self.env.registry['base']
super(BaseMetaModel, self).create(values)
I can't post an answer, anyone knows why?