İçereği Atla
Menü
Bu soru işaretlendi
1 Cevapla
4418 Görünümler
I'm getting this error, "ValueError: Invalid field product.product(32,) on model 'mrp.bom'" while trying to update a OCA module to be compatible with version 15. Happens when I go to create the model and try to set a product

Based on an OCA module, mrp_production_request, I haven't changed anything in the model other than that method

I have the "record.bom_id = boms" separated out for debugging, and that's where the error is

@api.onchange("product_id")
def _onchange_product_id(self):
for record in self:
if record.product_id:
record.product_uom_id = record.product_id.uom_id
boms = record.env["mrp.bom"]._bom_find(
record.product_id,
company_id=record.company_id.id,
picking_type=record.picking_type_id,
)
record.bom_id = boms

(What's up with this website, it keeps putting backslashes on all my text, im pretty sure it doesn't like links)

Here's the full error: https://www.toptal.com/developers/hastebin/ifecavurik.trace
OCA Module: https://github.com/OCA/manufacture/blob/13.0/mrp_production_request/models/mrp_production_request.py#L249-L257
Avatar
Vazgeç

elaborate the question with the module that you are trying to use.
also for adding codes in odoo forum, see; https://www.youtube.com/watch?v=nw3q0Cs1swg

Üretici

Niyas, I tried, but the website kept putting backslashes on my post (hence my comment in parentheses). So I tried to put it in links, but didn't work, my post is quite elaborate, but the website is bugged

Üretici

Niyas, I edited the post to not include any actual links and that made the backslashes go away. But then it made my whole post monospaced. This is by far one of the worst rich text editors I've ever used. A new one should be implemented, see; https://www.youtube.com/watch?v=TQG4yNVnGV4

Üretici En İyi Yanıt

"record.env["mrp.bom"]._bom_find(...)" now returns a dict, so you have to index return with the product like "boms[record.product_id]"

Avatar
Vazgeç
İlgili Gönderiler Cevaplar Görünümler Aktivite
1
Ağu 22
4372
1
May 22
2843
1
Oca 22
3036
1
Ağu 24
2001
1
Ağu 24
2580