Browse Source

[FIX]Unique index update error and Reseting the Qauntity to produce

pull/124/head
Cybrosys Technologies 7 years ago
committed by GitHub
parent
commit
702512d4c5
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 5
      mrp_production_draft/models/mrp_production.py

5
mrp_production_draft/models/mrp_production.py

@ -42,9 +42,9 @@ class MrpProduction(models.Model):
@api.model_cr
def init(self):
self.env.cr.execute('ALTER TABLE mrp_production DROP CONSTRAINT mrp_production_name_uniq')
self.env.cr.execute('ALTER TABLE mrp_production DROP CONSTRAINT IF EXISTS mrp_production_name_uniq')
self.env.cr.execute(
'''CREATE UNIQUE INDEX mrp_mo_unique ON mrp_production (name,company_id) WHERE (state != 'draft')''')
'''CREATE UNIQUE INDEX IF NOT EXISTS mrp_mo_unique ON mrp_production (name,company_id) WHERE (state != 'draft')''')
@api.model
def create(self, values):
@ -74,7 +74,6 @@ class MrpProduction(models.Model):
@api.multi
def action_confirm(self):
self.onchange_product_id()
for production in self:
if not production.name or production.name == _('New'):
picking_type_id = production._get_default_picking_type()

Loading…
Cancel
Save