Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
1 Trả lời
2756 Lượt xem

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.

Ảnh đại diện
Huỷ bỏ
Tác giả Câu trả lời hay nhất

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

Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
4
thg 2 25
3420
0
thg 10 24
1247
1
thg 8 24
2568
2
thg 11 24
3866
3
thg 10 23
15329