addons-cm/website_sale_aplicoop/views/group_order_views.xml
snt c1226e720b [ADD] website_sale_aplicoop: Category blacklist with recursive exclusion
- Add comprehensive test suite for excluded_category_ids
- 9 tests covering: single category, recursive subcategories,
  parent exclusion, direct product override, unrelated categories,
  empty blacklist, multiple exclusions, combined blacklists,
  available_products_count validation
- Update UI to show excluded_category_ids in 'Productos Excluidos'
- Bump version to 18.0.1.6.0
- Update CHANGELOG with category blacklist documentation

Technical notes:
- Category blacklist was already implemented in model/logic
- This commit adds missing tests and documentation
- Recursive exclusion via get_all_excluded_descendants()
- Blacklist has absolute priority over all inclusion sources
2026-02-22 23:04:33 +01:00

218 lines
12 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data>
<!-- Tree view for Group Order -->
<record id="view_group_order_tree" model="ir.ui.view">
<field name="name">group.order.tree</field>
<field name="model">group.order</field>
<field name="arch" type="xml">
<list string="Group Orders">
<field name="sequence" widget="handle"/>
<field name="company_id" optional="hide"/>
<field name="name"/>
<field name="group_ids" widget="many2many_tags" options="{'color_field': 'color'}"/>
<field name="type" optional="show"/>
<field name="start_date" optional="show"/>
<field name="end_date" optional="show"/>
<field name="home_delivery" optional="hide"/>
<field name="delivery_product_id" optional="hide"/>
<field name="state" optional="show"/>
</list>
</field>
</record>
<!-- Form view for Group Order -->
<record id="view_group_order_form" model="ir.ui.view">
<field name="name">group.order.form</field>
<field name="model">group.order</field>
<field name="arch" type="xml">
<form string="Group Order">
<header>
<button name="action_open" type="object" string="Open" invisible="state != 'draft'" class="oe_highlight"/>
<button name="action_close" type="object" string="Close" invisible="state != 'open'"/>
<button name="action_cancel" type="object" string="Cancel" invisible="state in ('closed', 'cancelled')"/>
<button name="action_reset_to_draft" type="object" string="Reset to Draft" invisible="state != 'closed'" class="oe_highlight"/>
<field name="state" widget="statusbar" statusbar_visible="draft,open,closed"/>
</header>
<sheet>
<div class="oe_title">
<div class="row">
<div class="col-md-1">
<field name="image" widget="image" class="oe_avatar"/>
</div>
<div class="col-md-11">
<h1>
<field name="name" placeholder="Order Name"/>
</h1>
</div>
</div>
</div>
<group>
<group>
<field name="company_id" help="Company that owns this group order"/>
<field name="sequence" help="Sequence for ordering in website list"/>
<field name="group_ids" widget="many2many_tags" help="Groups that can participate in this order"/>
<field name="type" help="Type of group order: Regular, Special, or Promotional"/>
<field name="start_date" help="Day when the order opens for purchases"/>
<field name="end_date" help="Day when the order closes (empty = permanent)"/>
</group>
<group>
<field name="period" help="How often this order repeats"/>
<field name="pickup_day" help="Day when members pick up orders"/>
<field name="cutoff_day" help="Day when purchases stop"/>
<field name="home_delivery" help="Enable home delivery option for this order"/>
<field name="delivery_product_id" invisible="not home_delivery" required="home_delivery" help="Product to use for home delivery"/>
</group>
</group>
<group string="Calculated Dates" name="calculated_dates">
<group>
<field name="cutoff_date" readonly="1" help="Automatically calculated cutoff date"/>
<field name="pickup_date" readonly="1" help="Automatically calculated pickup date"/>
</group>
<group>
<field name="delivery_date" readonly="1" help="Automatically calculated delivery date (pickup + 1 day)"/>
</group>
</group>
<group string="Description">
<field name="description" placeholder="Free text description..." nolabel="1"/>
</group>
<group string="Delivery">
<field name="delivery_notice" placeholder="Information about home delivery..." nolabel="1"/>
</group>
<group string="Catálogo de Productos">
<group string="Productos Incluidos" col="2">
<field name="supplier_ids" widget="many2many_tags" help="All products from these suppliers will be included"/>
<field name="category_ids" widget="many2many_tags" help="All products in these categories (including subcategories) will be included"/>
<field name="product_ids" widget="many2many_tags" help="Specific products to include directly"/>
</group>
<group string="Productos Excluidos" col="2">
<field name="excluded_supplier_ids" widget="many2many_tags" help="Suppliers excluded from this order. Products with these suppliers as main seller will not be available (blacklist has absolute priority)"/>
<field name="excluded_category_ids" widget="many2many_tags" help="Categories excluded from this order. Products in these categories and all their subcategories will not be available (blacklist has absolute priority)"/>
<field name="excluded_product_ids" widget="many2many_tags" help="Products explicitly excluded from this order (blacklist has absolute priority over inclusions)"/>
</group>
</group>
</sheet>
</form>
</field>
</record>
<!-- Search view for Group Order -->
<record id="view_group_order_search" model="ir.ui.view">
<field name="name">group.order.search</field>
<field name="model">group.order</field>
<field name="arch" type="xml">
<search string="Group Orders">
<field name="name"/>
<field name="group_ids"/>
<field name="type"/>
<field name="state"/>
<separator/>
<filter name="draft" string="Draft" domain="[('state', '=', 'draft')]"/>
<filter name="open" string="Open" domain="[('state', '=', 'open')]"/>
<filter name="closed" string="Closed" domain="[('state', '=', 'closed')]"/>
</search>
</field>
</record>
<!-- Acción para Group Order -->
<record id="action_group_order" model="ir.actions.act_window">
<field name="name">Group Orders</field>
<field name="res_model">group.order</field>
<field name="view_mode">list,form</field>
<field name="help" type="html">
<p class="o_view_nocontent_smiling_face">
Create a new group order
</p>
</field>
</record>
<!-- Menú para acceder a Group Order -->
<menuitem id="menu_group_order" name="Consumer Group Management" parent="website_sale.menu_ecommerce" sequence="50"/>
<menuitem id="menu_group_order_list" name="Consumer Group Orders" parent="menu_group_order" action="action_group_order" sequence="1"/>
<!-- Consumer Groups Views -->
<record id="view_consumer_group_tree" model="ir.ui.view">
<field name="name">consumer.group.tree</field>
<field name="model">res.partner</field>
<field name="arch" type="xml">
<list string="Consumer Groups">
<field name="name"/>
<field name="email"/>
<field name="phone"/>
<field name="city"/>
<field name="member_ids" widget="many2many_tags"/>
</list>
</field>
</record>
<record id="view_consumer_group_form" model="ir.ui.view">
<field name="name">consumer.group.form</field>
<field name="model">res.partner</field>
<field name="arch" type="xml">
<form string="Consumer Group">
<sheet>
<div class="oe_button_box" name="button_box"/>
<widget name="web_ribbon" title="Archived" bg_color="text-bg-danger" invisible="active"/>
<field name="image_1920" widget="image" class="oe_avatar" options="{'preview_image': 'avatar_128'}"/>
<div class="oe_title">
<h1>
<field name="name" placeholder="Group Name"/>
</h1>
</div>
<group>
<group>
<field name="email"/>
<field name="phone"/>
<field name="mobile"/>
</group>
<group>
<field name="street"/>
<field name="city"/>
<field name="zip"/>
<field name="country_id"/>
</group>
</group>
<notebook>
<page string="Members" name="members">
<field name="member_ids">
<list>
<field name="name"/>
<field name="email"/>
</list>
</field>
</page>
<page string="Internal Notes" name="notes">
<field name="comment" placeholder="Internal notes..."/>
</page>
</notebook>
</sheet>
<chatter/>
</form>
</field>
</record>
<record id="action_consumer_groups" model="ir.actions.act_window">
<field name="name">Consumer Groups</field>
<field name="res_model">res.partner</field>
<field name="view_mode">list,form</field>
<field name="domain">[('is_group', '=', True)]</field>
<field name="context">{'default_is_group': True, 'default_is_company': True}</field>
<field name="view_ids" eval="[(5, 0, 0),
(0, 0, {'view_mode': 'list', 'view_id': ref('view_consumer_group_tree')}),
(0, 0, {'view_mode': 'form', 'view_id': ref('view_consumer_group_form')})]"/>
<field name="help" type="html">
<p class="o_view_nocontent_smiling_face">
Create a new consumer group
</p>
<p>
Consumer groups are organizations that can place group orders together.
</p>
</field>
</record>
<menuitem id="menu_consumer_groups" name="Consumer Groups" parent="menu_group_order" action="action_consumer_groups" sequence="10"/>
</data>
</odoo>