Ir al contenido
Menú
Se marcó esta pregunta
2 Respuestas
1304 Vistas

Dear Odoo helpers,

In Purchase module. I added 'Product Category' in the list view as shown in the top image. The bottom image is the associated image of this purchase order (P00011). How can I pass the 'product category' information in P00011 to WH/IN/00006? So that once clicking the Inventory Receipt, the user will see 'product category' info there? 

Thank you for advice.   



Avatar
Descartar
Mejor respuesta

Hi,

We can use related attributes filed here to pass value from purchase order to receipt.

class Stock(models.Model)_inherit = 'stock.move'

categ_id = fields.Many2One('product.category', related = 'picking_id.purchase_id.categ_id')

Replace the field cteg_id by your field name.


Hope it helps,

Avatar
Descartar
Autor Mejor respuesta

Jaideep,

yes. It helped. Thank you so much.

Could please explain the logic behind?


I have a follow up question... 

Product Category shows the contents in  WH/IN/00XX, but no in  WH/OUT/00XX. How to get it show up in  WH/OUT/00XX?


I used below commands. It now can show up contents at both 'IN' and 'OUT' 'Product Category' fields

class StockMove(models.Model): 
  _inherit = "stock.move"     categ_id = fields.Many2one('product.category', 'Product Category', related = 'product_id.categ_id', required=True) class Picking(models.Model):
    _inherit = "stock.picking"  
categ_id = fields.Many2one('product.category', 'Product Category', related = 'product_id.categ_id')


Avatar
Descartar
Publicaciones relacionadas Respuestas Vistas Actividad
4
ene 25
1226
4
abr 24
1824
4
may 25
2216
2
may 25
5573
1
mar 25
1436