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

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
16686
1
7月 19
3929
0
9月 17
6835