Thanks to earlier help I was able to get a ticket to increment at a number of my choice using this code:
<record id="seq_res_code_inh2" model="ir.sequence">
<field name="name">ticketnumber</field>
<field name="code">helpdesk.ticket</field>
<field name="padding">9</field>
<field name="number_next">20151000</field>
<field name="number_increment">1</field>
</record>
However, I need the number_next to be dynamic. mainly consisting of year, month and then 3 digits so I wrote this code:
currentyear = datetime.now().year
currentmonth = datetime.now().month
ticketinc = int(str(currentyear) + str(currentmonth) + "000")
When I try to use ticketinc instead of a number I get error message:
ParseError: "invalid literal for int() with base 10: 'ticketinc'" while parsing /home/vagrant/addons/helpdesk/helpdesk_view.xml:211, near
<record id="seq_res_code_inh2" model="ir.sequence">
<field name="name">ticketnumber</field>
<field name="code">helpdesk.ticket</field>
<field name="padding">9</field>
<field name="number_next">ticketinc</field>
<field name="number_increment">1</field>
</record>
Is there anyway to use this code so that I have a dynamic number instead of a static one?