Community mailing list archives

community@mail.odoo.com

Create function in crone

by
akalala
- 04/10/2016 17:45:24
Hello,

recently i try to run a cron in odoo 8, but a have a this error :              

File "/opt/odoo/openerp/models.py", line 5303, in ensure_one raise except_orm("ValueError", "Expected singleton: %s" % self) except_orm: ('ValueError', 'Expected singleton: atelier.material()')

My function : 
@api.model
 def create_action(self):
        self.ensure_one()
        ids = self.env['atelier.materiel'].search([])
        for m in ids:
            res = self.env['atelier.location.interne'].create({'materiel': m.code_mat})

Thanks.