pos_loyalty_extend/views/loyalty_reward_views.xml
2026-05-28 14:50:21 +07:00

23 lines
1.5 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<odoo>
<record id="loyalty_reward_view_form_inherit_extend" model="ir.ui.view">
<field name="name">loyalty.reward.view.form.inherit.extend</field>
<field name="model">loyalty.reward</field>
<field name="inherit_id" ref="loyalty.loyalty_reward_view_form"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='reward_product_id']/parent::group" position="inside">
<field name="reward_product_applicability" widget="radio"/>
<field name="reward_product_category_id" invisible="reward_product_applicability != 'cheapest'"/>
</xpath>
<xpath expr="//field[@name='reward_product_id']" position="attributes">
<attribute name="required">reward_type == 'product' and reward_product_applicability == 'specific' and not reward_product_ids</attribute>
<attribute name="invisible">reward_type != 'product' or reward_product_applicability == 'cheapest' and reward_product_category_id</attribute>
</xpath>
<xpath expr="//field[@name='reward_product_tag_id']" position="attributes">
<attribute name="required">reward_type == 'product' and reward_product_applicability == 'specific' and not reward_product_ids</attribute>
<attribute name="invisible">reward_type != 'product' or reward_product_applicability == 'cheapest' and reward_product_category_id</attribute>
</xpath>
</field>
</record>
</odoo>