Dear Drees Far,
Using on change method you can perform your structure.
Step 1: Create two new field which has char data type
Step 2: Now you will put on change method in First Field(integer) and Second Field(char)
Step 3: On change method return the value as per you set logic in python file and set those value in new two char field.
Example:
in .XML file
<field name="first_field" on_change="change_first_field(first_field)" />
<field name="second_field" on_change="change_second_field(second_field)" />
in .PY file
First create two new field which have char data type
'new_first_field': fields.char('New First Field'),
'new_second_field': fields.char('New Second Field'),
def change_first_field(self, cr, uid, ids, first_field, context=None):
if not first_field:
return {}
new_str = str(first_field)
new_value_first = new_str[0:2] + ' Then ' + new_str[2:4] + ' Then ' + new_str[4:6]
return {
'value': {
'new_first_field': new_value_first,
}
}
def change_second_field(self, cr, uid, ids, second_field, context=None):
if not second_field:
return {}
new_str = str(second_field)
new_value_second = new_str[0:4] + ' Then ' + new_str[4:5]
return {
'value': {
'new_second_field': new_value_second,
}
}
May this code will help you
Thanks & Regards
Ankit H Gandhi