In a custom module I have two classes. How can class test
in @api.one
call test2_func
on a button click?
What should I put in def call_test2_func(self)
?
For example:
class test(models.Model):
_name = "test.class"
_description = "TEST"
@api.one
def call_test2_func(self):
"""call test2_func here"""
class test2(models.Model):
_name = "test2.class"
_description = "TEST 2"
@api.one
def test2_func(self):
print("TEST 2")
Maybe I should leave a reply instead of a comment. If you're using Odoo and the new OpenERP api you can can access the model dictionaty though
self.env
in your model classes. So to call the functiontest2_func
in the modeltest2.class
you should write