Skip to Content
Меню
Вам необхідно зареєструватися, щоб взаємодіяти зі спільнотою.
Це запитання позначене
3 Відповіді
4787 Переглядів

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

Аватар
Відмінити
Найкраща відповідь

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

Аватар
Відмінити
Найкраща відповідь

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>
Аватар
Відмінити
Найкраща відповідь

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

Аватар
Відмінити
Related Posts Відповіді Переглядів Дія
1
бер. 15
4839
1
лист. 19
4306
3
лист. 18
6829
4
квіт. 16
5744
2
груд. 22
21390