Skip to Content
Menu
This question has been flagged
2 Replies
3589 Views

Hello,

I am trying to add a new tab to the "Manufacturing Orders" form.

The tab will show form which has three fields as follows -

OA name,

list of products for the selected OA,

Quantity for the selected product.

I am getting following error when updating module -

File "/odoo/odoo-server/odoo/fields.py", line 368, in __getattr__

.....

....

return self._attrs[name]

RuntimeError: maximum recursion depth exceeded

My code is as follows -

class my_mrp(models.Model):

_inherit = 'mrp.production'

oayn = fields.Boolean('Order Reference')

order_id = fields.Many2one('sale.order', string="Order Reference", help="Select Sale Order")

product_id = fields.Many2one('sale.order.line', string="Order Reference Product", help="Select product", domain=[('id', 'in', order_id.id)])

It should display all the products for the selected OA. I have tried many different things but it's not working.

Can someone help me please?

Thanks in advance,


Avatar
Discard
Author Best Answer

Thanks for the reply.

It is showing only one product. Sale order has multiple products.

Any suggestion is welcome. Thanks

Avatar
Discard
Best Answer

order_id = fields.Many2one('sale.order', string="Order test", help="Select Sale Order")

product_id = fields.Many2one('product.product', string="Order Reference Product", help="Select product",related='order_id.order_line.product_id')

Avatar
Discard
Related Posts Replies Views Activity
1
Nov 22
14656
3
Aug 22
10765
2
Aug 22
3054
0
Jul 22
835
2
Oct 21
1437