Hola, tengo los siguientes códigos en un formulario en odoo studio, en XML, lo que necesito es que cuando vaya a crear un nuevo registro, el campo " <field name="x_name"", tenga un nombre predefinido y también que cada vez que se crea un nuevo registro, automáticamente se cree un número consecutivo de la siguiente forma: "ACC 23-001", "ACC 23-002", "ACC 23-003" Y así consecutivamente, este es mi codigo: <form> <header> <field widget="barra de estado" name="x_studio_stage_id" options="{'clickable': '1'}"/> </header> <sheet string="Acción"> <field name="x_studio_kanban_state" widget ="state_selection"/> <widget name="web_ribbon" text="Archivado"bg_color="bg-success" attrs="{'invisible': [('x_active', '=', True)]}"/> <field name="x_active" invisible="1"/> <field class= "oe_avatar" widget="image" name="x_studio_image"/> <field name="x_name" style="color:#192d5c; border-bottom:1px solid #0b385f" required="1" placeholder="Nombre.. ."/> <group name="studio_group_aa0a02"> <group name="studio_group_aa0a02_left"> <field name="x_studio_partner_id"/> <field name="x_studio_partner_phone" widget="phone" options="{'enable_sms': True }"/> <nombre de campo="x_studio_partner_email" widget="correo electrónico"/><field name="x_studio_date"/> <label string="Dates" for="x_studio_date_start"/> <div class="o_row"> <field name="x_studio_date_start" options="{"related_end_date": "x_studio_date_stop" ;}"/> <span> a </span> <field name="x_studio_date_stop" widget="daterange" options="{"related_start_date": "x_studio_date_start"}"/> </div> </group> <group name="studio_group_aa0a02_right"> <field name="x_studio_user_id" style="color:#16b2f5; border-bottom:1px solid #0b385f; background-color:#e6feff; width:100%" widget="many2one_avatar_user"/> <field name="x_studio_currency_id" invisible="1"/> <field name="x_studio_value" widget="monetary" options="{'currency_field': 'x_studio_currency_id'}"/> <field name=" x_studio_tag_ids" widget="many2many_tags" options="{'color_field': 'x_color'}"/> </group> </group> <group> <field name="activity_ids" widget="statinfo"/> <field name ="x_studio_actividades" widget="many2many_tags"/> <field name="x_studio_notes" placeholder="Escriba sus notas aquí ..." nolabel="1"/> </group> </sheet> <div class="oe_chatter" name="oe_chatter"> <field name="message_follower_ids"/> <field name="message_ids"/> <field name="activity_ids"/> </div> </form>
html code that: Hola, tengo los siguientes códigos en un formulario en odoo studio, en XML, lo que necesito es que cuando vaya a crear un nuevo registro, el campo " <field name="x_name"", tenga un nombre predefinido y también que cada vez que se crea un nuevo registro, automáticamente se cree un número consecutivo de la siguiente forma: "ACC 23-001", "ACC 23-002", "ACC 23-003" Y así consecutivamente, este es mi codigo:
<form> <header> <field widget="barra de estado" name="x_studio_stage_id" options="{'clickable': '1'}"/> </header> <sheet string="Acción"> <field name="x_studio_kanban_state" widget ="state_selection"/> <widget name="web_ribbon" text="Archivado"bg_color