<?xml version="1.0" encoding="utf-8"?>
<odoo>

    <record id="inherit_view_partner_form" model="ir.ui.view">
        <field name="name">res.partner</field>
        <field name="model">res.partner</field>
        <field name="inherit_id" ref="base.view_partner_form"/>
        <field name="arch" type="xml">
            <group name="sale" position="inside">
                <field name="credit_limit" string="Credit Limit" attrs="{'invisible':[('partner_type','!=','postpaid')], 'readonly':[('state','=','approved')]}"/>
                <field name="due_days" attrs="{'invisible':[('partner_type','!=','postpaid')], 'readonly':[('state','=','approved')]}"/>
                <field name="block" attrs="{'invisible':[('partner_type','!=','postpaid')]}"/>
                <field name="allow" attrs="{'invisible':[('partner_type','!=','postpaid')], 'readonly':[('state','=','approved')]}"/>
            </group>


        </field>
    </record>

    <record id="view_order_form_inherit_binaa" model="ir.ui.view">
        <field name="name">sale.order.form</field>
        <field name="model">sale.order</field>
        <field name="inherit_id" ref="sale.view_order_form"/>
        <field name="arch" type="xml">
            <field name="partner_id" position="after">
                <field name="allow" groups="sales_team.group_sale_manager"/>
            </field>
        </field>
    </record>
    
</odoo> 
