Skip to content

Commit

Permalink
upd
Browse files Browse the repository at this point in the history
  • Loading branch information
ilyasProgrammer committed Jul 7, 2023
1 parent d8d6536 commit 568cba0
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 28 deletions.
66 changes: 40 additions & 26 deletions sale_commission_product_criteria_domain/demo/demo_data.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,17 @@
<field name="commission_type">product_restricted</field>
</record>

<!-- Commission Groups -->
<record id="demo_cig_spain" model="commission.items.group">
<field name="name">Spain</field>
<field name="commission_id" ref="demo_commission_rules_restrict" />
</record>

<record id="demo_cig_italy" model="commission.items.group">
<field name="name">Italy</field>
<field name="commission_id" ref="demo_commission_rules_restrict" />
</record>

<!-- Commission Items -->
<record id="demo_crr_item_1" model="commission.item">
<field name="commission_id" ref="demo_commission_rules_restrict" />
Expand All @@ -14,6 +25,7 @@
<field name="applied_on">3_global</field>
<field name="commission_type">fixed</field>
<field name="fixed_amount">10</field>
<field name="group_id" ref="demo_cig_italy" />
</record>

<record id="demo_crr_item_2" model="commission.item">
Expand All @@ -24,6 +36,7 @@
<field name="commission_type">fixed</field>
<field name="fixed_amount">20</field>
<field name="categ_id" ref="product.product_category_5" />
<field name="group_id" ref="demo_cig_spain" />
</record>

<record id="demo_crr_item_3" model="commission.item">
Expand All @@ -37,6 +50,7 @@
name="product_tmpl_id"
ref="product.product_product_4_product_template"
/>
<field name="group_id" ref="demo_cig_spain" />
</record>

<record id="demo_crr_item_4" model="commission.item">
Expand All @@ -47,48 +61,48 @@
<field name="commission_type">percentage</field>
<field name="percent_amount">15</field>
<field name="product_id" ref="product.product_product_4" />
<field name="group_id" ref="demo_cig_spain" />
</record>

<record id="demo_cti_spain" model="commission.item">
<field name="commission_id" ref="demo_commission_rules_restrict" />
<field name="group_id" ref="demo_cig_spain" />
<field name="sequence" eval="22" />
<field name="based_on">sol</field>
<record id="demo_crr_item_5_disc" model="commission.item">
<field
name="commission_id"
ref="sale_commission_product_criteria.demo_commission_rules"
/>
<field name="sequence" eval="1" />
<field name="based_on">discount</field>
<field name="applied_on">1_product</field>
<field name="commission_type">fixed</field>
<field name="fixed_amount">55</field>
<field name="fixed_amount">7.50</field>
<field name="discount_from">10.01</field>
<field name="discount_to">100</field>
<field
name="product_tmpl_id"
model="product.template"
eval="obj().env.ref('product.product_product_8').product_tmpl_id"
ref="product.product_product_11_product_template"
/>
<field name="group_id" ref="demo_cig_italy" />
</record>

<record id="demo_cti_italy" model="commission.item">
<field name="commission_id" ref="demo_commission_rules_restrict" />
<field name="group_id" ref="demo_cig_italy" />
<field name="sequence" eval="23" />
<field name="based_on">sol</field>
<record id="demo_crr_item_6_disc" model="commission.item">
<field
name="commission_id"
ref="sale_commission_product_criteria.demo_commission_rules"
/>
<field name="sequence" eval="2" />
<field name="based_on">discount</field>
<field name="applied_on">1_product</field>
<field name="commission_type">fixed</field>
<field name="fixed_amount">66</field>
<field name="fixed_amount">15</field>
<field name="discount_from">0</field>
<field name="discount_to">10</field>
<field
name="product_tmpl_id"
model="product.template"
eval="obj().env.ref('product.product_product_8').product_tmpl_id"
ref="product.product_product_1_product_template"
/>
<field name="group_id" ref="demo_cig_spain" />
</record>

<record id="demo_cig_spain" model="commission.items.group">
<field name="name">Spain</field>
<field name="commission_id" ref="demo_commission_rules_restrict" />
</record>

<record id="demo_cig_italy" model="commission.items.group">
<field name="name">Italy</field>
<field name="commission_id" ref="demo_commission_rules_restrict" />
</record>

<!-- Agents -->
<record id="demo_agent_rules_restricted" model="res.partner">
<field name="name">Agent Rules Restricted</field>
<field name="is_company">True</field>
Expand Down
8 changes: 6 additions & 2 deletions sale_commission_product_criteria_domain/views/views.xml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,11 @@
<group>
<group>
<field name="agent_id" />
<field name="group_ids" widget="many2many_tags" required="1"/>
<field
name="group_ids"
widget="many2many_tags"
required="1"
/>
<field name="agent_group_ids" invisible="1" />
<field name="partner_agent_ids" invisible="1" />
<field name="partner_id" invisible="1" />
Expand All @@ -62,7 +66,7 @@
<field name="arch" type="xml">
<tree string="Agents Items Restriction">
<field name="agent_id" />
<field name="group_ids" widget="many2many_tags" required="1"/>
<field name="group_ids" widget="many2many_tags" required="1" />
<field name="agent_group_ids" invisible="1" />
<field name="partner_agent_ids" invisible="1" />
<field name="partner_id" invisible="1" />
Expand Down

0 comments on commit 568cba0

Please sign in to comment.