Skip to Content
Menu
This question has been flagged
3 Replies
3650 Views

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

Avatar
Discard
Best Answer

Hi,

Make sure that the created sequence has get added into the system, you can activate the developer mode and under the Settings menu you can see a menu named Sequence & Identifiers, check whether the created sequence is there or not. If not make sure that the file in which you added the sequence is called inside the manifest file.

For more info regarding how to create sequence and assign it to a field, see this: How to Add New Sequence in odoo12

Thanks

Avatar
Discard
Best Answer

In your case, you are creating sequence with code 'mrp.lot' so you have to add sequence type also along with sequence in version 8.

<record id="sequence_type_mrp_lot" model="ir.sequence.type">
<field name="name">MRP Lot Number</field>
<field name="code">mrp.lot</field>
</record>
Avatar
Discard
Best Answer

do you have already solved this problem? please have de same problem 

Avatar
Discard
Related Posts Replies Views Activity
1
Mar 15
4140
1
Nov 19
3183
3
Nov 18
5730
4
Apr 16
4768
2
Dec 22
17969