mirror of
https://github.com/bringout/oca-ocb-sale.git
synced 2026-04-26 23:12:09 +02:00
19.0 vanilla
This commit is contained in:
parent
79f83631d5
commit
73afc09215
6267 changed files with 1534193 additions and 1130106 deletions
|
|
@ -1,36 +1,57 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<odoo>
|
||||
<record id="product_template_tree_view" model="ir.ui.view">
|
||||
<field name="name">product.template.product.tree</field>
|
||||
<field name="name">product.template.product.list</field>
|
||||
<field name="model">product.template</field>
|
||||
<field name="priority">10</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="Product" multi_edit="1" sample="1">
|
||||
<header>
|
||||
<button string="Print Labels" type="object" name="action_open_label_layout"/>
|
||||
</header>
|
||||
<field name="product_variant_count" invisible="1"/>
|
||||
<field name="sale_ok" invisible="1"/>
|
||||
<field name="currency_id" invisible="1"/>
|
||||
<field name="cost_currency_id" invisible="1"/>
|
||||
<field name="priority" widget="priority" optional="show" nolabel="1"/>
|
||||
<list string="Product" multi_edit="1" sample="1">
|
||||
<field name="product_variant_count" column_invisible="True"/>
|
||||
<field name="sale_ok" column_invisible="True"/>
|
||||
<field name="currency_id" column_invisible="True"/>
|
||||
<field name="cost_currency_id" column_invisible="True"/>
|
||||
<field name="is_favorite" widget="boolean_favorite" optional="show" nolabel="1"/>
|
||||
<field name="name" string="Product Name"/>
|
||||
<field name="default_code" optional="show"/>
|
||||
<field name="product_tag_ids" widget="many2many_tags" options="{'color_field': 'color'}" optional="show"/>
|
||||
<field name="barcode" optional="hide" attrs="{'readonly': [('product_variant_count', '>', 1)]}"/>
|
||||
<field name="product_tag_ids" widget="many2many_tags" optional="hide"/>
|
||||
<field name="barcode" optional="hide" readonly="product_variant_count != 1"/>
|
||||
<field name="company_id" options="{'no_create': True}"
|
||||
groups="base.group_multi_company" optional="hide"/>
|
||||
<field name="list_price" string="Sales Price" widget='monetary' options="{'currency_field': 'currency_id'}" optional="show" decoration-muted="not sale_ok"/>
|
||||
<field name="standard_price" widget='monetary' options="{'currency_field': 'cost_currency_id'}" optional="show" readonly="1"/>
|
||||
<field name="categ_id" optional="hide"/>
|
||||
<field name="detailed_type" optional="hide" readonly="1"/>
|
||||
<field name="type" invisible="1"/>
|
||||
<field name="type" optional="hide" readonly="1"/>
|
||||
<field name="uom_id" readonly="1" optional="show" groups="uom.group_uom"/>
|
||||
<field name="active" invisible="1"/>
|
||||
<field name="active" column_invisible="True"/>
|
||||
<field name="activity_exception_decoration" widget="activity_exception"/>
|
||||
</tree>
|
||||
</list>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="product_template_list_view_sellable" model="ir.ui.view">
|
||||
<field name="name">product.template.list.sellable</field>
|
||||
<field name="model">product.template</field>
|
||||
<field name="mode">primary</field>
|
||||
<field name="inherit_id" ref="product.product_template_tree_view"/>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//field[@name='standard_price']" position="attributes">
|
||||
<attribute name="optional">hide</attribute>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="product_template_list_view_purchasable" model="ir.ui.view">
|
||||
<field name="name">product.template.list.purchasable</field>
|
||||
<field name="model">product.template</field>
|
||||
<field name="mode">primary</field>
|
||||
<field name="inherit_id" ref="product.product_template_tree_view"/>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//field[@name='list_price']" position="attributes">
|
||||
<attribute name="optional">hide</attribute>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="product_template_only_form_view" model="ir.ui.view">
|
||||
<field name="name">product.template.product.form</field>
|
||||
<field name="model">product.template</field>
|
||||
|
|
@ -42,38 +63,52 @@
|
|||
<attribute name="name">Product Template</attribute>
|
||||
</xpath>
|
||||
<field name="categ_id" position="after">
|
||||
<field name="default_code" attrs="{'invisible': [('product_variant_count', '>', 1)]}"/>
|
||||
<field name="barcode" attrs="{'invisible': [('product_variant_count', '>', 1)]}"/>
|
||||
<field name="default_code" string="Reference" invisible="product_variant_count > 1"/>
|
||||
<field name="valid_product_template_attribute_line_ids" invisible="1"/>
|
||||
<field name="barcode"
|
||||
invisible="product_variant_count > 1
|
||||
or (product_variant_count == 0
|
||||
and valid_product_template_attribute_line_ids)
|
||||
or type in ['service', 'combo']"/>
|
||||
</field>
|
||||
|
||||
<div name="button_box" position="inside">
|
||||
<button name="action_open_documents" position="before">
|
||||
<button name="%(product.product_variant_action)d" type="action"
|
||||
icon="fa-sitemap" class="oe_stat_button"
|
||||
attrs="{'invisible': [('product_variant_count', '<=', 1)]}"
|
||||
invisible="product_variant_count <= 1"
|
||||
groups="product.group_product_variant">
|
||||
<field string="Variants" name="product_variant_count" widget="statinfo" />
|
||||
</button>
|
||||
</div>
|
||||
</button>
|
||||
|
||||
<xpath expr="//page[@name='general_information']" position="after">
|
||||
<page name="variants" string="Attributes & Variants" groups="product.group_product_variant">
|
||||
<field name="attribute_line_ids" widget="one2many" context="{'show_attribute': False}">
|
||||
<tree string="Variants" editable="bottom" decoration-info="value_count <= 1">
|
||||
<field name="value_count" invisible="1"/>
|
||||
<field name="attribute_id" attrs="{'readonly': [('id', '!=', False)]}"/>
|
||||
<page
|
||||
name="variants"
|
||||
string="Attributes & Variants"
|
||||
groups="product.group_product_variant"
|
||||
invisible="type == 'combo'"
|
||||
>
|
||||
<field name="attribute_line_ids" widget="one2many" context="{'show_attribute': False}" force_save="1">
|
||||
<list string="Variants" editable="bottom" decoration-info="value_count <= 1">
|
||||
<field name="value_count" column_invisible="True"/>
|
||||
<field name="sequence" widget="handle"/>
|
||||
<field name="attribute_id" readonly="id"/>
|
||||
<field name="value_ids" widget="many2many_tags" options="{'no_create_edit': True, 'color_field': 'color'}" context="{'default_attribute_id': attribute_id, 'show_attribute': False}"/>
|
||||
<button string="Configure" class="float-end btn-secondary"
|
||||
type="object" name="action_open_attribute_values"
|
||||
groups="product.group_product_variant"/>
|
||||
</tree>
|
||||
</list>
|
||||
</field>
|
||||
<p class="oe_grey oe_edit_only">
|
||||
<p class="opacity-50 oe_edit_only">
|
||||
<strong>Warning</strong>: adding or deleting attributes
|
||||
will delete and recreate existing variants and lead
|
||||
to the loss of their possible customizations.
|
||||
</p>
|
||||
</page>
|
||||
</xpath>
|
||||
<xpath expr="//group[@name='group_standard_price']" position="after">
|
||||
<field name="product_properties" columns="2"/>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
|
|
@ -81,38 +116,40 @@
|
|||
<field name="name">Product.template.product.kanban</field>
|
||||
<field name="model">product.template</field>
|
||||
<field name="arch" type="xml">
|
||||
<kanban sample="1" class="o_kanban_product_template">
|
||||
<field name="id"/>
|
||||
<field name="product_variant_count"/>
|
||||
<kanban sample="1">
|
||||
<field name="currency_id"/>
|
||||
<field name="activity_state"/>
|
||||
<field name="categ_id"/>
|
||||
<progressbar field="activity_state" colors='{"planned": "success", "today": "warning", "overdue": "danger"}'/>
|
||||
<templates>
|
||||
<t t-name="kanban-box">
|
||||
<div class="oe_kanban_card oe_kanban_global_click">
|
||||
<div class="o_kanban_image me-1">
|
||||
<img t-att-src="kanban_image('product.template', 'image_128', record.id.raw_value)" alt="Product" class="o_image_64_contain"/>
|
||||
<t t-name="card" class="flex-row">
|
||||
<main class="pe-2">
|
||||
<div class="mb-1">
|
||||
<div class="d-flex mb-0 h5">
|
||||
<field class="me-1" name="is_favorite" widget="boolean_favorite" nolabel="1"/>
|
||||
<field name="name"/>
|
||||
</div>
|
||||
<span t-if="record.default_code.value">
|
||||
[<field name="default_code"/>]
|
||||
</span>
|
||||
<strong t-if="record.product_variant_count.value > 1">
|
||||
<field name="product_variant_count"/> Variants
|
||||
</strong>
|
||||
</div>
|
||||
<div class="oe_kanban_details">
|
||||
<div class="o_kanban_record_top mb-0">
|
||||
<div class="o_kanban_record_headings">
|
||||
<strong class="o_kanban_record_title">
|
||||
<field name="name"/>
|
||||
</strong>
|
||||
</div>
|
||||
<field name="priority" widget="priority"/>
|
||||
</div>
|
||||
<t t-if="record.default_code.value">[<field name="default_code"/>]</t>
|
||||
<div t-if="record.product_variant_count.value > 1" groups="product.group_product_variant">
|
||||
<strong>
|
||||
<t t-esc="record.product_variant_count.value"/> Variants
|
||||
</strong>
|
||||
</div>
|
||||
<div name="product_lst_price" class="mt-1">
|
||||
Price: <field name="list_price" widget="monetary" options="{'currency_field': 'currency_id', 'field_digits': True}"></field>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<span>
|
||||
Price: <field name="list_price" widget="monetary" options="{'currency_field': 'currency_id', 'field_digits': True}"/>
|
||||
</span>
|
||||
<field name="product_properties" widget="properties"/>
|
||||
</main>
|
||||
<aside>
|
||||
<field
|
||||
name="image_128"
|
||||
widget="image"
|
||||
alt="Product"
|
||||
options="{'img_class': 'w-100 object-fit-contain'}"
|
||||
invisible="not image_128"
|
||||
/>
|
||||
</aside>
|
||||
</t>
|
||||
</templates>
|
||||
</kanban>
|
||||
|
|
@ -128,9 +165,9 @@
|
|||
<templates>
|
||||
<div t-name="activity-box">
|
||||
<img t-att-src="activity_image('product.template', 'image_128', record.id.raw_value)" role="img" t-att-title="record.id.value" t-att-alt="record.id.value"/>
|
||||
<div>
|
||||
<field name="name" display="full"/>
|
||||
<div t-if="record.default_code.value" class="text-muted">
|
||||
<div class="ms-2">
|
||||
<field name="name" display="full" class="o_text_block"/>
|
||||
<div t-if="record.default_code.value" class="o_text_block text-muted">
|
||||
[<field name="default_code"/>]
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -142,9 +179,8 @@
|
|||
|
||||
<record id="product_template_action" model="ir.actions.act_window">
|
||||
<field name="name">Products</field>
|
||||
<field name="type">ir.actions.act_window</field>
|
||||
<field name="res_model">product.template</field>
|
||||
<field name="view_mode">kanban,tree,form</field>
|
||||
<field name="view_mode">kanban,list,form</field>
|
||||
<field name="view_id" ref="product_template_kanban_view"/>
|
||||
<field name="search_view_id" ref="product.product_template_search_view"/>
|
||||
<field name="context">{"search_default_filter_to_sell":1}</field>
|
||||
|
|
@ -158,20 +194,29 @@
|
|||
</field>
|
||||
</record>
|
||||
|
||||
<record id="action_product_template_price_list_report" model="ir.actions.server">
|
||||
<field name="name">Generate Pricelist Report</field>
|
||||
<field name="groups_id" eval="[(4, ref('product.group_product_pricelist'))]"/>
|
||||
<record id="action_product_template_print_labels" model="ir.actions.server">
|
||||
<field name="name">Print Labels</field>
|
||||
<field name="model_id" ref="product.model_product_template"/>
|
||||
<field name="binding_model_id" ref="product.model_product_template"/>
|
||||
<field name="state">code</field>
|
||||
<field name="code">
|
||||
if records:
|
||||
action = records.action_open_label_layout()
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="action_product_template_price_list_report" model="ir.actions.server">
|
||||
<field name="name">Pricelist Report</field>
|
||||
<field name="group_ids" eval="[(4, ref('product.group_product_pricelist'))]"/>
|
||||
<field name="model_id" ref="product.model_product_template"/>
|
||||
<field name="binding_model_id" ref="product.model_product_template"/>
|
||||
<field name="state">code</field>
|
||||
<field name="code">
|
||||
ctx = env.context
|
||||
ctx.update({'default_pricelist': env['product.pricelist'].search([], limit=1).id})
|
||||
action = {
|
||||
'name': 'Pricelist Report',
|
||||
'type': 'ir.actions.client',
|
||||
'tag': 'generate_pricelist',
|
||||
'context': ctx,
|
||||
'tag': 'generate_pricelist_report',
|
||||
'context': env.context,
|
||||
}
|
||||
</field>
|
||||
</record>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue