Overslaan naar inhoud
Menu
Je moet geregistreerd zijn om te kunnen communiceren met de community.
Deze vraag is gerapporteerd
2 Antwoorden
1252 Weergaven

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
Annuleer
Beste antwoord

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
Annuleer
Auteur Beste antwoord

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
Annuleer
Gerelateerde posts Antwoorden Weergaven Activiteit
4
jan. 25
1184
4
apr. 24
1759
4
mei 25
2103
2
mei 25
5438
1
mrt. 25
1347