Skip ke Konten
Menu
Pertanyaan ini telah diberikan tanda
2 Replies
1249 Tampilan

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
Buang
Jawaban Terbai

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
Buang
Penulis Jawaban Terbai

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
Buang
Post Terkait Replies Tampilan Aktivitas
4
Jan 25
1180
4
Apr 24
1756
4
Mei 25
2097
2
Mei 25
5418
1
Mar 25
1334