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
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- CRM
- e-Commerce
- Accounting
- Inventory
- PoS
- Project management
- MRP
This question has been flagged
1
Reply
3245
Views
"record.env["mrp.bom"]._bom_find(...)" now returns a dict, so you have to index return with the product like "boms[record.product_id]"
Enjoying the discussion? Don't just read, join in!
Create an account today to enjoy exclusive features and engage with our awesome community!
Sign upRelated Posts | Replies | Views | Activity | |
---|---|---|---|---|
|
1
Aug 22
|
2144 | ||
|
1
May 22
|
1116 | ||
|
1
Jan 22
|
1730 | ||
|
1
Aug 24
|
362 | ||
|
1
Aug 24
|
945 |
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
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
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