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

I am trying to create a new field on the `sale.order.line` model. This field is called `x_all_route_ids`, and is meant to contain all of the available `stock.location.route`s for an Order Line.

It should look up the `product_id.route_ids` and `product_id.routes_from_categ_ids` for the Order Line, and join them together into a single set of Routes.

I am trying to set this field up through the Odoo UI, but am getting error related to my "Dependencies".

I have Dependencies defined as:

    product_id, product_id.route_ids, product_id.routes_from_categ_ids

I have Compute defined as:

    for record in self:

        record['x_all_route_ids'] = record.product_id.route_ids

To start I am just trying to get the field to show the same value as `product_id.route_ids`, but it's not working. When I save, I get the following error:

    Error while validating constraint Unknown field u'product_id' in dependency u'product_id'

Any idea what I'm doing wrong here?

อวตาร
ละทิ้ง
ผู้เขียน คำตอบที่ดีที่สุด

Seems there was just some issue with the UI because I had been changing field and dropdowns so often trying different things. I refreshed the page and things started working.

อวตาร
ละทิ้ง
Related Posts ตอบกลับ มุมมอง กิจกรรม
2
เม.ย. 24
3861
4
ก.พ. 20
4253
1
ก.พ. 24
2022
2
เม.ย. 24
2171
0
ก.ค. 24
3083