콘텐츠로 건너뛰기
메뉴
커뮤니티에 참여하려면 회원 가입을 하시기 바랍니다.
신고된 질문입니다
2 답글
2818 화면

I create a model named 'task.budget' and then in another module used the tier_validation as follows:

classTaskBudget(models.Model):    _name ="task.budget"    _inherit =["task.budget","tier.validation"]    _state_from =["to_approve"]    _state_to =["approved"]    _tier_validation_manual_config =False@api.modeldef_get_under_validation_exceptions(self):        res =super(TaskBudget,self)._get_under_validation_exceptions()        res.append("route_id")

I coded by imitating the OCA purchase_request_tier_validation.

Here is the problem, I also have a model named task.task, it has a One2many field refers to the task.budget. And in the form view of task.task,I just show the budget as follows:

<fieldname="budget_ids"readonly='true'/>

But in the form view of task, once I click on the line of budget, it raises a error as above.

Error: Missing field string information for the field 'need_validation' from the 'task.budget' model
    at http://192.168.56.102:8269/web/assets/1371-f84290c/web.assets_backend.min.js:6684:258
    at traverse (http://192.168.56.102:8269/web/assets/1371-f84290c/web.assets_backend.min.js:6679:200)
    at http://192.168.56.102:8269/web/assets/1371-f84290c/web.assets_backend.min.js:6679:242
    at _.each._.forEach (http://192.168.56.102:8269/web/assets/544-21bb36b/web.assets_common.min.js:63:404)
    at traverse (http://192.168.56.102:8269/web/assets/1371-f84290c/web.assets_backend.min.js:6679:211)
    at processArch (http://192.168.56.102:8269/web/assets/1371-f84290c/web.assets_backend.min.js:6683:180)
    at generateLegacyLoadViewsResult (http://192.168.56.102:8269/web/assets/1371-f84290c/web.assets_backend.min.js:6681:106)
    at http://192.168.56.102:8269/web/assets/1371-f84290c/web.assets_backend.min.js:5710:447
    at async getFormViewInfo (http://192.168.56.102:8269/web/assets/1371-f84290c/web.assets_backend.min.js:3623:483)
    at async openRecord (http://192.168.56.102:8269/web/assets/1371-f84290c/web.assets_backend.min.js:3628:56)

It makes me quite confused, cause the need_validation is a field of tier_validation model, it doesn't make sense.Can anyone explain this to me, thank you.


아바타
취소
작성자

It's not working.

Thans for your replying.

The way I refer to task.budget in task.task like this:

budget_ids = fields.One2many(

required=True,

string="budget details",

inverse_name='task_id',

comodel_name='task.budget',

domain=[('state','=','approved')],

)

작성자 베스트 답변

I solved this by adding the fields in the view like this:

<fieldname="requested_by"position="after">

<fieldname="need_validation"invisible="1"/>

<fieldname="validated"invisible="1"/>

<fieldname="rejected"invisible="1"/>

<fieldname="can_review"invisible="1"/>

<fieldname="next_review"invisible="1"/>

<fieldname="review_ids"invisible="1"/>

field>

I use a One2many field infer to the purchase.request and installed the purchase request tier validation, it seems like the module I created does not know the fields that purchase.request inherits from tier.validation. So it needs to be shown in the tier validation form view.

아바타
취소
베스트 답변

Hi


Can you install/upgrade the module base_tier_validation, and check is this issue is resolved or not


Regards


아바타
취소
관련 게시물 답글 화면 활동
0
6월 24
7
1
2월 24
26
3
2월 20
16708
1
7월 19
3938
0
9월 17
6864