Ir al contenido
Menú
Se marcó esta pregunta
3 Respuestas
4701 Vistas

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
Descartar
Mejor respuesta

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
Descartar
Mejor respuesta

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
Descartar
Mejor respuesta

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

Avatar
Descartar
Publicaciones relacionadas Respuestas Vistas Actividad
1
mar 15
4776
1
nov 19
4203
3
nov 18
6770
4
abr 16
5676
2
dic 22
21177