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')],
)