-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Open
Description
Chapter 13 says:
Unfortunatelly - when _name is ommited (implicit)
from odoo import models
import logging
_logger = logging.getLogger(__name__)
class EstateModel(models.Model):
_inherit = ["estate_property"]
_description = "Enhancement of RealEstate Model"
def action_sold(self):
_logger.warning("Child Action sold")
return super().action_sold()
The "Child Action sold" is never invoked (only "Parent Action sold" is displayed).
But when name is explicitly set to the same as "parent model" :
from odoo import models
import logging
_logger = logging.getLogger(__name__)
class EstateModel(models.Model):
_name = "estate_property"
_inherit = ["estate_property"]
_description = "Enhancement of RealEstate Model"
def action_sold(self):
_logger.warning("Child Action sold")
return super().action_sold()
Both "Child Action sold" and "Parent Action sold" are displayed.
I think this should me a warning in the tutorial
Metadata
Metadata
Assignees
Labels
No labels