Siirry sisältöön
Menu
Sinun on rekisteröidyttävä, jotta voit olla vuorovaikutuksessa yhteisön kanssa.
Tämä kysymys on merkitty
1 Vastaa
2599 Näkymät

Hi everyone,

Using field service I'd like to customize the default worksheet to add some automatic code on the creation of the worksheet.


For now i'v tried a lot of things... but there is only the way of using the interface automated action that works.


Here is that I tried : 


from odoo import models, fields, api

class WorksheetTemplate(models.Model):

_inherit = ['x_project_task_worksheet_template_1']

def create(self, vals):
print("ok")
return super().create(WorksheetTemplate, vals)

And in my manifest I've added : 

['project','industry_fsm_report','worksheet']



But of cours I have that error : 

raise TypeError("Model %r does not exist in registry." % name)
TypeError: Model 'x_project_task_worksheet_template_1' does not exist in registry.

Avatar
Hylkää
Tekijä Paras vastaus

This is the creation of the template but not the worksheet directly. Anyway thank you I put a comments of the solution

Avatar
Hylkää
Aiheeseen liittyviä artikkeleita Vastaukset Näkymät Toimenpide
4
helmik. 25
2894
0
lokak. 24
1027
1
elok. 24
2291
2
marrask. 24
3488
3
lokak. 23
14991