跳至内容
菜单
此问题已终结
1 回复
2768 查看

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.

形象
丢弃
编写者 最佳答案

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

形象
丢弃
相关帖文 回复 查看 活动
4
2月 25
3433
0
10月 24
1255
1
8月 24
2570
2
11月 24
3873
3
10月 23
15334