ParseError: "Wrong value for ir.sequence.code: 'mrp.lot'" while parsing file:///c:/program files (x86)/odoo 8.0-20170901/server/openerp/addons/mrp_lot/sequence.xml:6, near <record model="ir.sequence" id="seq_lot_id"> <field name="name">Lot Number</field> <field name="code">mrp.lot</field> <field name="active">True</field> <field name="prefix">LOT</field> <field name="number_increment">1</field> <field name="number_next">1</field> <field name="padding">5</field> <field name="implementation">standard</field> </record>
class mrp_lot(models.Model):
_name = "mrp.lot"
name = fields.Char(string="Lot No", readonly=True, required=True, copy=False, default='New')
@api.model
def create(self, vals):
if vals.get('name', 'New') == 'New':
vals['name'] = self.env['ir.sequence'].next_by_code('mrp.lot') or 'New'
result = super(mrp_lot, self).create(vals)
return result