India

ZestyBeanz Technologies Pvt Ltd 4th Floor, Nila, Technopark Thiruvananthapuram,
India – 695581
Phone: +91 471 4063254
Fax : +91 471 2700171

   .

ZestyBeanz Technologies Pvt Ltd
61/3236, Manikkath Cross Road
Ravipuram, Kochi, India - 682016
Phone: +91 484 4063254

  UAE

Zesty Labs
Office # 2003, Millennium Plaza Building
Sheikh Zayed Rd, Dubai, UAE
Phone: +971 4333 2222​
Mobile: +971-52-7553466

  Germany​

ZestyBeanz Technologies GmbH
Reuterstraße 1
90408 Nürnberg
Fon: +49 911 4801 444
Fax: +49 911 4801 445

Reply to comment

Contact Form


Jabir's picture

Sequence in OpenERP

Adding a sequence for records in OpenERP is very simple. For making a field a sequence type, we need to create new sequence or use existing sequence. For creating a sequence, we need to create two type of objects, one is “ir.sequence.type” and other “ir.sequence”. The example to create these records are given below..

<record forcecreate="1" id="seq_type_id" model="ir.sequence.type">
 
<field name="name">Name</field>

  <field name="code">code</field>
</record>

<record forcecreate="1" id="seq_id" model="ir.sequence">
  <field name="name">Name</field>
  <field name="code">code</field>
  <field name="padding" eval="pading"/>
  <field name="prefix">prefix</field>
  <field name="suffix">suffix</field>
</record>

When thsi xml file is executed, the new sequence with name “Name” will be created on OpenERP. You can see this sequence from “Menu/Administration/Configuration/Sequences/Sequences”.

All the fields created here is self explanatory. If you have any doubt, you can keep the mouse over the label of each field on openerp and it will display corresponding help text.

Now we need to add this sequence to a record. For that we have to call the get function on ir.sequence class with the correct code. This function call can be done on _default so that the sequence is generated by default when new record is created. This can be done using following code,

_defaults = {

'field_name': lambda self,cr,uid,context={}: self.pool.get('ir.sequence').get(cr, uid, 'code'),

}

Reply

The content of this field is kept private and will not be shown publicly.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.
  • You can enable syntax highlighting of source code with the following tags: <code>, <blockcode>, <c>, <cpp>, <drupal5>, <drupal6>, <java>, <javascript>, <php>, <python>, <ruby>. The supported tag styles are: <foo>, [foo], [[foo]]. PHP source code can also be enclosed in <?php ... ?> or <% ... %>.

More information about formatting options

CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.
Image CAPTCHA
Enter the characters shown in the image. Ignore spaces and be careful about upper and lower case.