Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ

class ProductTemplate(models.Model):

    _inherit = 'product.template'
    x_brand_name = fields.Char(string='Brand Name')
    x_est_location = fields.Char(string='EST Location')
    x_merchant_id = fields.Many2one('res.partner', string='Merchant Name')
    x_merchant_reference = fields.Char(string='Merchant Reference')
    current_location = fields.Char(string="Current Location", compute="_compute_current_location")
    lot_ids = fields.Many2one(string="lot", comodel_name='stock.production.lot', related="location_id.lot_id", store=True)

     def _compute_current_location(self): ...


 My goal is to add an attribute 'lot_ids' to this model, but this attribute is related to either 'stock.quant' or 'stock.production.lot'. I know that 'lot_id' is a Many2one field, but I'm not sure exactly how to implement this.

Can anyone guide me through this issue? Thanks in advance.

Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
1
thg 5 23
2201
1
thg 10 22
2911
2
thg 4 23
6199
2
thg 9 21
3129
3
thg 12 19
5789