Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
2 ตอบกลับ
2790 มุมมอง

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


อวตาร
ละทิ้ง
Related Posts ตอบกลับ มุมมอง กิจกรรม
0
มิ.ย. 24
7
1
ก.พ. 24
26
3
ก.พ. 20
16691
1
ก.ค. 19
3930
0
ก.ย. 17
6838