Skip to Content
Meniu
Trebuie să fiți înregistrat pentru a interacționa cu comunitatea.
Această întrebare a fost marcată
3 Răspunsuri
4755 Vizualizări

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

Imagine profil
Abandonează
Cel mai bun răspuns

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

Imagine profil
Abandonează
Cel mai bun răspuns

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>
Imagine profil
Abandonează
Cel mai bun răspuns

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

Imagine profil
Abandonează
Related Posts Răspunsuri Vizualizări Activitate
1
mar. 15
4812
1
nov. 19
4263
3
nov. 18
6797
4
apr. 16
5709
2
dec. 22
21297