For Example If i have 3 Fields - Amount 1 , Amount 2 , Amount 3
1. Amount 2 value should be default to Amount 1 value & can be editable
2. Amount 3 value should be default to Amount 2 value & can be editable
XML View
<?xml version="1.0"?>
<odoo>
<record id="hr_expense_form_view_field" model="ir.ui.view">
<field name="name">hr_expense_additional_field</field>
<field name="model">hr.expense</field>
<field name="inherit_id" ref="hr_expense.hr_expense_form_view"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='amount1']" position="attributes">
<attribute name="string">Amount1</attribute>
</xpath>
<xpath expr="//field[@name='amount1']" position="after">
<field name="amount2" attrs="{'readonly': True}" />
<field name="amount3" attrs="{'readonly': True}"/>
</xpath>
</field>
</record>
.py File
class Expense(models.Model):
_inherit = 'hr.expense'
amount2 = fields.Float(string='Amount2')
amount3 = fields.Float(string='Amount3')