تخطي للذهاب إلى المحتوى
القائمة
لقد تم الإبلاغ عن هذا السؤال
1399 أدوات العرض

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.

الصورة الرمزية
إهمال
المنشورات ذات الصلة الردود أدوات العرض النشاط
1
مايو 23
2201
1
أكتوبر 22
2911
2
أبريل 23
6197
2
سبتمبر 21
3128
3
ديسمبر 19
5787