Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
4061 มุมมอง

Hi there,

I'm using Odoo 12 and I'm using Variants and Options in the sale module.

Whenever I add attribute values to a product all archived variants get their status changed from active = False to True? This makes it hard to manage products with a lot of variants.

I would think this is a bug, I don't see any reason why this could be useful? Any help?

Thanks

Rufus

อวตาร
ละทิ้ง
ผู้เขียน

For the moment it did an override to change behavior:

class ProductTemplate(models.Model):

_inherit = "product.template"

def create_variant_ids(self):

archived_product_variants_ids = self.env['product.product'].search([('product_tmpl_id','=',self.id),('active','=',False)])

super(ProductTemplate, self).create_variant_ids()

result = archived_product_variants_ids.write({'active':False})

Related Posts ตอบกลับ มุมมอง กิจกรรม
4
ต.ค. 23
2271
error when adding the sales app แก้ไขแล้ว
2
ก.ย. 25
242
3
ก.ย. 25
417
3
ก.ย. 25
467
How to merge companies แก้ไขแล้ว
4
ส.ค. 25
1615