I'm trying to create a new item in this dropdown list for Odoo V12, but I'm nos sure how to define the template/record ... I need to generate a new option for calling a python function.
The model of the view is the next one: education.group The module that contains this model is called: education
I tried the next code but I still have the issue. (I'm not sure if the view has to be defined like that).
<record id="education_group_mailing_action" model="ir.actions.server">
<field name="name">Generate group lists</field>
<field name="type">ir.actions.server</field>
<field name="model_id" ref="education.group"/>
<field name="binding_model_id" ref="education.group"/>
<field name="state">code</field>
<field name="code">action = records.generate_lists()</field>
</record>
class ResPartner(models.Model):
_inherit='education.group'
def generate_lists(self):
print("que pasa")
This is the error:
This is the model in the DB:
Anyone knows how to do it? Thanks for reading!