Skip ke Konten
Menu
Pertanyaan ini telah diberikan tanda
3 Replies
4717 Tampilan

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
Buang
Jawaban Terbai

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
Buang
Jawaban Terbai

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
Buang
Jawaban Terbai

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

Avatar
Buang
Post Terkait Replies Tampilan Aktivitas
1
Mar 15
4789
1
Nov 19
4214
3
Nov 18
6775
4
Apr 16
5686
2
Des 22
21208