[VIEW] ~in pos_order form, partner_id is readonly when pos_order is in paid, done...
authorLudovic CHEVALIER <ludovic.chevalier@heureux-cyclage.org>
Thu, 9 Jan 2014 15:36:42 +0000 (16:36 +0100)
committerLudovic CHEVALIER <ludovic.chevalier@heureux-cyclage.org>
Thu, 9 Jan 2014 15:36:42 +0000 (16:36 +0100)
view/point_of_sale.xml

index fd1ddc1..d3c6d6b 100644 (file)
@@ -6,8 +6,8 @@
             <field name="model">pos.order</field>
             <field name="inherit_id" ref="bikecoop.view_pos_pos_form"/>
             <field name="arch" type="xml">
-                <xpath expr="//field[@name='partner_id']" position="attributes">
-                    <attribute name="required">1</attribute>
+                <xpath expr="//field[@name='partner_id']" position="replace">
+                    <field name="partner_id" on_change="onchange_partner_id(partner_id, context)" context="{'search_default_customer':1}" attrs="{'readonly': [('state','in', ('paid', 'done', 'invoiced'))]}" required="1" />
                 </xpath>
             </field>
         </record>