[IMP] product,sale,...: Restructure Product Form
Purpose ======= - product form is a bit disorganized with fields showing up at wrong place: - inventory tab for services -> to remove - subscription & events fields under Invoicing tab - inventory tab is not structured - invoicing and bill control fields are not grouped together - etc.
This commit is contained in:
committed by
Yannick Tivisse
parent
6095f4c06d
commit
10eee18a04
@@ -7,23 +7,24 @@
|
||||
<field name="priority">5</field>
|
||||
<field name="inherit_id" ref="product.product_template_form_view"/>
|
||||
<field name="arch" type="xml">
|
||||
<page name="sales" position="after">
|
||||
<page string="Invoicing" name="invoicing" groups="account.group_account_invoice">
|
||||
<page name="inventory" position="after">
|
||||
<page string="Invoicing" name="invoicing">
|
||||
<group name="properties">
|
||||
<group>
|
||||
<group string="Receivables">
|
||||
<field name="taxes_id" widget="many2many_tags"/>
|
||||
<field name="property_account_income_id"
|
||||
domain="[('internal_type','=','other'),('deprecated','=',False)]"
|
||||
groups="account.group_account_user"/>
|
||||
<field name="taxes_id" widget="many2many_tags"/>
|
||||
</group>
|
||||
<group>
|
||||
<group string="Payables" name="payables">
|
||||
<field name="supplier_taxes_id" widget="many2many_tags"/>
|
||||
<field name="property_account_expense_id"
|
||||
domain="[('internal_type','=','other'),('deprecated','=',False)]"
|
||||
groups="account.group_account_user"/>
|
||||
<field name="supplier_taxes_id" widget="many2many_tags"/>
|
||||
</group>
|
||||
</group>
|
||||
<group name="accounting"/>
|
||||
<group name="invoicing"/>
|
||||
</page>
|
||||
</page>
|
||||
</field>
|
||||
|
||||
@@ -6,10 +6,11 @@
|
||||
<field name="model">product.template</field>
|
||||
<field name="inherit_id" ref="account.product_template_form_view"/>
|
||||
<field name="arch" type="xml">
|
||||
<field name="property_account_expense_id" position="before">
|
||||
<field name="property_account_expense_id" position="after">
|
||||
<field name="asset_category_id"
|
||||
domain="[('type', '=', 'purchase')]"
|
||||
context="{'default_type': 'purchase'}"/>
|
||||
context="{'default_type': 'purchase'}"
|
||||
groups="account.group_account_user"/>
|
||||
</field>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
<field name="model">product.template</field>
|
||||
<field name="inherit_id" ref="product.product_template_form_view"/>
|
||||
<field name="arch" type="xml">
|
||||
<field name="type" position="after">
|
||||
<field name="categ_id" position="after">
|
||||
<field name="hs_code"/>
|
||||
</field>
|
||||
</field>
|
||||
|
||||
@@ -6,7 +6,7 @@ from odoo import api, fields, models
|
||||
class ProductTemplate(models.Model):
|
||||
_inherit = 'product.template'
|
||||
|
||||
event_ok = fields.Boolean(string='Event Registration', help='Determine if a product needs '
|
||||
event_ok = fields.Boolean(string='Is an Event Ticket', help='Determine if a product needs '
|
||||
'to create automatically an event registration at the confirmation of a sales order line.')
|
||||
|
||||
@api.onchange('event_ok')
|
||||
|
||||
@@ -3,11 +3,13 @@
|
||||
<record id="event_sale_product_template_form" model="ir.ui.view">
|
||||
<field name="name">product.template.event.form.inherit</field>
|
||||
<field name="model">product.template</field>
|
||||
<field name="inherit_id" ref="sale.product_template_form_view_invoice_policy" />
|
||||
<field name="inherit_id" ref="product.product_template_form_view" />
|
||||
<field name="arch" type="xml">
|
||||
<field name="invoice_policy" position="before">
|
||||
<field name="event_ok" />
|
||||
</field>
|
||||
<group name="email_template_and_project" position="after">
|
||||
<group string="Events">
|
||||
<field name="event_ok" />
|
||||
</group>
|
||||
</group>
|
||||
</field>
|
||||
</record>
|
||||
</odoo>
|
||||
|
||||
@@ -7,7 +7,7 @@ from odoo.exceptions import UserError
|
||||
class ProductTemplate(models.Model):
|
||||
_inherit = 'product.template'
|
||||
|
||||
available_in_pos = fields.Boolean(string='Available in the Point of Sale', help='Check if you want this product to appear in the Point of Sale', default=True)
|
||||
available_in_pos = fields.Boolean(string='Available in Point of Sale', help='Check if you want this product to appear in the Point of Sale', default=True)
|
||||
to_weight = fields.Boolean(string='To Weigh With Scale', help="Check if the product should be weighted using the hardware scale integration")
|
||||
pos_categ_id = fields.Many2one(
|
||||
'pos.category', string='Point of Sale Category',
|
||||
|
||||
@@ -57,7 +57,7 @@
|
||||
<field name="model">product.template</field>
|
||||
<field name="inherit_id" ref="stock.view_template_property_form"/>
|
||||
<field name="arch" type="xml">
|
||||
<group name="sale_condition" position="after">
|
||||
<group name="email_template_and_project" position="before">
|
||||
<group name="pos" string="Point of Sale">
|
||||
<field name="available_in_pos"/>
|
||||
<field name="pos_categ_id" attrs="{'invisible': [('available_in_pos', '=', False)]}"/>
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
<xpath expr="//button[@name='toggle_active']" position="before">
|
||||
<button class="oe_stat_button" name="%(procurement.procurement_order_action_product_template_stat)d"
|
||||
icon="fa-truck" string="Procurements" type="action"
|
||||
groups="base.group_no_one"
|
||||
groups="stock.group_adv_location"
|
||||
attrs="{'invisible':[('type', '=', 'service')]}"/>
|
||||
</xpath>
|
||||
</field>
|
||||
|
||||
@@ -61,7 +61,7 @@ class ProductTemplate(models.Model):
|
||||
'Price', compute='_compute_template_price', inverse='_set_template_price',
|
||||
digits=dp.get_precision('Product Price'))
|
||||
list_price = fields.Float(
|
||||
'Sale Price', default=1.0,
|
||||
'Sales Price', default=1.0,
|
||||
digits=dp.get_precision('Product Price'),
|
||||
help="Base price to compute the customer price. Sometimes called the catalog price.")
|
||||
lst_price = fields.Float(
|
||||
@@ -81,7 +81,6 @@ class ProductTemplate(models.Model):
|
||||
inverse='_set_weight', store=True,
|
||||
help="The weight of the contents in Kg, not including any packaging, etc.")
|
||||
|
||||
warranty = fields.Float('Warranty')
|
||||
sale_ok = fields.Boolean(
|
||||
'Can be Sold', default=True,
|
||||
help="Specify if the product can be selected in a sales order line.")
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
<xpath expr="//form" position="attributes">
|
||||
<attribute name="name">Product Template</attribute>
|
||||
</xpath>
|
||||
<field name="type" position="after">
|
||||
<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>
|
||||
@@ -42,7 +42,7 @@
|
||||
</button>
|
||||
</button>
|
||||
|
||||
<xpath expr="//page[@name='sales']" position="after">
|
||||
<xpath expr="//page[@name='general_information']" position="after">
|
||||
<page name="variants" string="Variants" groups="product.group_product_variant">
|
||||
<field name="attribute_line_ids" widget="one2many_list" context="{'show_attribute': False}">
|
||||
<tree string="Variants" editable="bottom">
|
||||
|
||||
@@ -50,7 +50,7 @@
|
||||
<field name="list_price" widget='monetary' options="{'currency_field': 'currency_id'}"/>
|
||||
<label for="standard_price" groups="base.group_user"/>
|
||||
<div name="standard_price_uom" groups="base.group_user">
|
||||
<field name="standard_price" widget='monetary' options="{'currency_field': 'currency_id'}" class="oe_inline"/>
|
||||
<field name="standard_price" widget='monetary' options="{'currency_field': 'currency_id'}"/>
|
||||
</div>
|
||||
<field name="company_id" groups="base.group_multi_company"
|
||||
options="{'no_create': True}"/>
|
||||
@@ -61,14 +61,6 @@
|
||||
</group>
|
||||
</group>
|
||||
</page>
|
||||
<page string="Inventory" name="inventory" groups="stock.group_stock_user,product.group_stock_packaging">
|
||||
<group name="packaging" string="Packaging"
|
||||
colspan="4"
|
||||
attrs="{'invisible':['|', ('type', 'not in', ['product', 'consu']), ('product_variant_count', '>', 1)]}"
|
||||
groups="product.group_stock_packaging">
|
||||
<field name="packaging_ids" nolabel="1" context="{'default_product_id': product_variant_id,'tree_view_ref':'product.product_packaging_tree_view', 'form_view_ref':'product.product_packaging_form_view'}"/>
|
||||
</group>
|
||||
</page>
|
||||
<page string="Sales" attrs="{'invisible':[('sale_ok','=',False)]}" name="sales">
|
||||
<div name="pricelist_item" groups="product.group_product_pricelist">
|
||||
<separator string="Pricing"/>
|
||||
@@ -88,13 +80,24 @@
|
||||
attrs="{'invisible':[('type', '!=', 'service')]}"/>
|
||||
</group>
|
||||
</page>
|
||||
<page string="Inventory" name="inventory" groups="stock.group_stock_user,product.group_stock_packaging" attrs="{'invisible':[('type', '=', 'service')]}">
|
||||
<group name="packaging" string="Packaging"
|
||||
colspan="4"
|
||||
attrs="{'invisible':['|', ('type', 'not in', ['product', 'consu']), ('product_variant_count', '>', 1)]}"
|
||||
groups="product.group_stock_packaging">
|
||||
<field name="packaging_ids" nolabel="1" context="{'default_product_id': product_variant_id,'tree_view_ref':'product.product_packaging_tree_view', 'form_view_ref':'product.product_packaging_form_view'}"/>
|
||||
</group>
|
||||
</page>
|
||||
<page string="Notes" name="notes">
|
||||
<group name="description">
|
||||
<group string="Description for Quotations">
|
||||
<field name="description_sale" nolabel="1" placeholder="This note will be displayed on the quotations."/>
|
||||
<group string="Description for Customers" attrs="{'invisible': [('sale_ok','=',False)]}">
|
||||
<field name="description_sale" nolabel="1" placeholder="This note will show up on sales orders."/>
|
||||
</group>
|
||||
</group>
|
||||
<group name="warning"/>
|
||||
<group name="warning">
|
||||
<group name="sale_warning"/>
|
||||
<group name="purchase_warning"/>
|
||||
</group>
|
||||
</page>
|
||||
</notebook>
|
||||
</sheet>
|
||||
@@ -308,7 +311,7 @@
|
||||
<field name="name" position="after">
|
||||
<field name="product_tmpl_id" class="oe_inline" readonly="1" invisible="1" attrs="{'required': [('id', '!=', False)]}"/>
|
||||
</field>
|
||||
<field name="item_ids" position="replace">
|
||||
<field name="item_ids" position="inside">
|
||||
<field name="pricelist_item_ids" widget="many2many">
|
||||
<tree string="Pricelist Items">
|
||||
<field name="pricelist_id"/>
|
||||
|
||||
@@ -6,11 +6,11 @@
|
||||
<field name="inherit_id" ref="product.product_template_form_view"/>
|
||||
<field name="arch" type="xml">
|
||||
<group name="email_template_and_project" position="attributes">
|
||||
<attribute name="string">Miscellaneous</attribute>
|
||||
<attribute name="string">Email</attribute>
|
||||
<attribute name="attrs"></attribute>
|
||||
</group>
|
||||
<group name="email_template_and_project" position="inside">
|
||||
<field name="email_template_id" string="Invoice Confirmation Email"
|
||||
<field name="email_template_id" string="Email Template" help="Send a product-specific email once the invoice is paid"
|
||||
domain="[('model','=','product.template')]"
|
||||
context="{
|
||||
'form_view_ref':'product_email_template.email_template_form_simplified',
|
||||
@@ -18,7 +18,6 @@
|
||||
'default_subject': name,
|
||||
'default_name': name,
|
||||
}"/>
|
||||
/>
|
||||
</group>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
@@ -5,26 +5,26 @@
|
||||
<field name="model">product.template</field>
|
||||
<field name="inherit_id" ref="stock.view_template_property_form" />
|
||||
<field name="arch" type="xml">
|
||||
<group name="stock_property" position="after">
|
||||
<group name="expiry_and_lots" groups="stock.group_production_lot" attrs="{'invisible': [('tracking','=','none')]}">
|
||||
<label for="life_time"/>
|
||||
<div class="o_row">
|
||||
<field name="life_time" />
|
||||
<group name="traceability" position="after">
|
||||
<group string="Dates" name="expiry_and_lots" groups="stock.group_production_lot" attrs="{'invisible': [('tracking', '=','none')]}">
|
||||
<label for="use_time"/>
|
||||
<div>
|
||||
<field name="use_time" class="oe_inline"/>
|
||||
<span>days</span>
|
||||
</div>
|
||||
<label for="use_time"/>
|
||||
<div class="o_row">
|
||||
<field name="use_time" />
|
||||
<label for="life_time"/>
|
||||
<div>
|
||||
<field name="life_time" class="oe_inline"/>
|
||||
<span>days</span>
|
||||
</div>
|
||||
<label for="removal_time"/>
|
||||
<div class="o_row">
|
||||
<field name="removal_time" />
|
||||
<div>
|
||||
<field name="removal_time" class="oe_inline"/>
|
||||
<span>days</span>
|
||||
</div>
|
||||
<label for="alert_time"/>
|
||||
<div class="o_row">
|
||||
<field name="alert_time" />
|
||||
<div>
|
||||
<field name="alert_time" class="oe_inline"/>
|
||||
<span>days</span>
|
||||
</div>
|
||||
</group>
|
||||
|
||||
@@ -1100,7 +1100,7 @@ class ProductTemplate(models.Model):
|
||||
purchase_method = fields.Selection([
|
||||
('purchase', 'On ordered quantities'),
|
||||
('receive', 'On received quantities'),
|
||||
], string="Control Purchase Bills",
|
||||
], string="Control Policy",
|
||||
help="On ordered quantities: control bills based on ordered quantities.\n"
|
||||
"On received quantities: control bills based on received quantity.", default="receive")
|
||||
route_ids = fields.Many2many(default=lambda self: self._get_buy_route())
|
||||
|
||||
@@ -558,14 +558,19 @@
|
||||
<field name="model">product.template</field>
|
||||
<field name="inherit_id" ref="product.product_template_form_view"/>
|
||||
<field name="arch" type="xml">
|
||||
<group name="inventory" position="after">
|
||||
<separator string="Vendors"/>
|
||||
<field name="seller_ids" context="{'default_product_tmpl_id': context.get('product_tmpl_id', active_id)}"/>
|
||||
<page name="sales" position="after">
|
||||
<page string="Purchase" name="purchase" attrs="{'invisible': [('purchase_ok','=',False)]}">
|
||||
<group string="Vendors" name="vendors">
|
||||
<field name="seller_ids" context="{'default_product_tmpl_id': context.get('product_tmpl_id', active_id)}" nolabel="1"/>
|
||||
</group>
|
||||
</page>
|
||||
</page>
|
||||
<group name="invoicing" position="inside">
|
||||
<group string="Purchase Bills" name="bill" attrs="{'invisible': [('purchase_ok','=',False)]}" groups="purchase.group_purchase_manager">
|
||||
<field name="purchase_method" widget="radio"/>
|
||||
</group>
|
||||
</group>
|
||||
<field name="uom_po_id" position="after">
|
||||
<field name="purchase_method" widget="radio" groups="purchase.group_purchase_manager"/>
|
||||
</field>
|
||||
<group name="warning" position="inside">
|
||||
<group name="purchase_warning" position="replace">
|
||||
<group string="Warning when Purchasing this Product" groups="purchase.group_warning_purchase">
|
||||
<field name="purchase_line_warn" nolabel="1"/>
|
||||
<field name="purchase_line_warn_msg" colspan="3" nolabel="1"
|
||||
@@ -573,9 +578,9 @@
|
||||
</group>
|
||||
</group>
|
||||
<group name="description" position="inside">
|
||||
<group string="Description for Vendors">
|
||||
<group string="Description for Vendors" attrs="{'invisible': [('purchase_ok','=',False)]}">
|
||||
<field name="description_purchase" nolabel="1"
|
||||
placeholder="This note will be displayed for vendors."/>
|
||||
placeholder="This note will show up on purchase orders."/>
|
||||
</group>
|
||||
</group>
|
||||
</field>
|
||||
@@ -587,7 +592,7 @@
|
||||
<field name="inherit_id" ref="account.view_category_property_form"/>
|
||||
<field name="arch" type="xml">
|
||||
<field name="property_account_income_categ_id" position="before">
|
||||
<field name="property_account_creditor_price_difference_categ" domain="[('deprecated','=',False)]"/>
|
||||
<field name="property_account_creditor_price_difference_categ" domain="[('deprecated','=',False)]" groups="account.group_account_user"/>
|
||||
</field>
|
||||
</field>
|
||||
</record>
|
||||
@@ -606,7 +611,7 @@
|
||||
<field name="inherit_id" ref="account.product_template_form_view"/>
|
||||
<field name="arch" type="xml">
|
||||
<field name="property_account_expense_id" position="replace" >
|
||||
<field name="property_account_expense_id" domain="[('deprecated','=',False)]" attrs="{'readonly': [('purchase_ok', '=', 0)]}" groups="account.group_account_user"/>
|
||||
<field name="property_account_expense_id" domain="[('deprecated','=',False)]" attrs="{'readonly': [('purchase_ok', '=', 0)]}"/>
|
||||
</field>
|
||||
<field name='supplier_taxes_id' position="replace" >
|
||||
<field name="supplier_taxes_id" colspan="2" widget="many2many_tags" attrs="{'readonly':[('purchase_ok','=',0)]}"/>
|
||||
@@ -634,8 +639,7 @@
|
||||
<field name="model">product.template</field>
|
||||
<field name="inherit_id" ref="account.product_template_form_view"/>
|
||||
<field name="arch" type="xml">
|
||||
<field name="supplier_taxes_id" position="after">
|
||||
<label string="" colspan="2"/>
|
||||
<field name="property_account_expense_id" position="after">
|
||||
<field name="property_account_creditor_price_difference" domain="[('deprecated','=',False)]" attrs="{'readonly':[('purchase_ok', '=', 0)]}" />
|
||||
</field>
|
||||
</field>
|
||||
|
||||
@@ -256,11 +256,13 @@
|
||||
<record model="ir.ui.view" id="product_template_form_view_inherit">
|
||||
<field name="name">product.template.form.inherit</field>
|
||||
<field name="model">product.template</field>
|
||||
<field name="inherit_id" ref="stock.view_template_property_form"/>
|
||||
<field name="inherit_id" ref="purchase.view_product_supplier_inherit"/>
|
||||
<field name="arch" type="xml">
|
||||
<field name="route_ids" position="after">
|
||||
<field name="purchase_requisition" widget="radio"/>
|
||||
</field>
|
||||
<group name="vendors" position="after">
|
||||
<group string="Reordering">
|
||||
<field name="purchase_requisition" widget="radio"/>
|
||||
</group>
|
||||
</group>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
|
||||
@@ -21,4 +21,4 @@ class ReportIntrastatCode(models.Model):
|
||||
class ProductTemplate(models.Model):
|
||||
_inherit = "product.template"
|
||||
|
||||
intrastat_id = fields.Many2one('report.intrastat.code', string='Intrastat code')
|
||||
intrastat_id = fields.Many2one('report.intrastat.code', string='Intrastat Code')
|
||||
|
||||
@@ -29,10 +29,8 @@
|
||||
<field name="model">product.template</field>
|
||||
<field name="inherit_id" ref="stock.view_template_property_form"/>
|
||||
<field name="arch" type="xml">
|
||||
<group name="group_lots_and_weight" position="after">
|
||||
<group>
|
||||
<field name="intrastat_id"/>
|
||||
</group>
|
||||
<group name="group_lots_and_weight" position="inside">
|
||||
<field name="intrastat_id"/>
|
||||
</group>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
@@ -16,7 +16,7 @@ class ProductTemplate(models.Model):
|
||||
sale_line_warn = fields.Selection(WARNING_MESSAGE, 'Sales Order Line', help=WARNING_HELP, required=True, default="no-message")
|
||||
sale_line_warn_msg = fields.Text('Message for Sales Order Line')
|
||||
expense_policy = fields.Selection(
|
||||
[('no', 'No'), ('cost', 'At cost'), ('sales_price', 'At sale price')],
|
||||
[('no', 'No'), ('cost', 'At cost'), ('sales_price', 'Sales price')],
|
||||
string='Re-Invoice Expenses',
|
||||
default='no')
|
||||
|
||||
|
||||
@@ -610,6 +610,13 @@
|
||||
<field string="Sales" name="sales_count" widget="statinfo" />
|
||||
</button>
|
||||
</button>
|
||||
<group name="sale_warning" position="replace">
|
||||
<group string="Warning when Selling this Product" groups="sale.group_warning_sale">
|
||||
<field name="sale_line_warn" nolabel="1"/>
|
||||
<field name="sale_line_warn_msg" colspan="3" nolabel="1"
|
||||
attrs="{'required':[('sale_line_warn','!=','no-message')],'readonly':[('sale_line_warn','=','no-message')]}"/>
|
||||
</group>
|
||||
</group>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
@@ -625,7 +632,7 @@
|
||||
<field string="Sales" name="sales_count" widget="statinfo" />
|
||||
</button>
|
||||
</button>
|
||||
<group name="warning" position="inside">
|
||||
<group name="sale_warning" position="replace">
|
||||
<group string="Warning when Selling this Product" groups="sale.group_warning_sale">
|
||||
<field name="sale_line_warn" nolabel="1"/>
|
||||
<field name="sale_line_warn_msg" colspan="3" nolabel="1"
|
||||
@@ -640,13 +647,12 @@
|
||||
<field name="model">product.template</field>
|
||||
<field name="inherit_id" ref="product.product_template_form_view"/>
|
||||
<field name="arch" type="xml">
|
||||
<page name="invoicing" position="inside">
|
||||
<separator string="Invoicing Policy"/>
|
||||
<group>
|
||||
<group name="invoicing" position="inside">
|
||||
<group string="Invoicing" name="invoicing" attrs="{'invisible': [('sale_ok','=',False)]}">
|
||||
<field name="invoice_policy" widget="radio"/>
|
||||
<field name="track_service" widget="radio" invisible="True"/>
|
||||
</group>
|
||||
</page>
|
||||
</group>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
<field name="model">product.template</field>
|
||||
<field name="inherit_id" ref="sale.product_template_form_view_invoice_policy"/>
|
||||
<field name="arch" type="xml">
|
||||
<field name="invoice_policy" position="after">
|
||||
<field name="track_service" position="after">
|
||||
<field name="expense_policy" widget="radio"
|
||||
attrs="{'invisible': [('can_be_expensed','=',False)]}"/>
|
||||
</field>
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
parent="sales_team.menu_base_partner" sequence="5" />
|
||||
<menuitem id="menu_invoiced" name="Invoicing" parent="menu_aftersale" sequence="1"/>
|
||||
|
||||
<record id="stock_location_route_form_view_inherit_sale_stock" model="ir.ui.view">
|
||||
<record id="stock_location_route_view_form_inherit_sale_stock" model="ir.ui.view">
|
||||
<field name="name">stock.location.route.form</field>
|
||||
<field name="inherit_id" ref="stock.stock_location_route_form_view"/>
|
||||
<field name="model">stock.location.route</field>
|
||||
@@ -23,5 +23,27 @@
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="product_template_view_form_inherit_sale" model="ir.ui.view">
|
||||
<field name="name">product.template.inherit.form</field>
|
||||
<field name="inherit_id" ref="sale.product_template_form_view_sale_order_button"/>
|
||||
<field name="model">product.template</field>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//button[@name='action_view_sales'][last()]" position="replace" />
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="product_template_view_form_inherit_stock" model="ir.ui.view">
|
||||
<field name="name">product.template.inherit.form</field>
|
||||
<field name="inherit_id" ref="stock.product_template_form_view_procurement_button"/>
|
||||
<field name="model">product.template</field>
|
||||
<field name="arch" type="xml">
|
||||
<button name="action_view_orderpoints" position="after">
|
||||
<button class="oe_stat_button" name="action_view_sales"
|
||||
type="object" icon="fa-usd">
|
||||
<field string="Sales" name="sales_count" widget="statinfo" />
|
||||
</button>
|
||||
</button>
|
||||
</field>
|
||||
</record>
|
||||
</data>
|
||||
</odoo>
|
||||
|
||||
@@ -125,22 +125,28 @@
|
||||
<field name="arch" type="xml">
|
||||
<group name="packaging" position="before">
|
||||
<group name="inventory">
|
||||
<group>
|
||||
<group string="Operations" name="operations">
|
||||
<field name="route_ids" widget="many2many_checkboxes" attrs="{'invisible':[('type', 'in', ['service', 'digital'])]}"/>
|
||||
<field name="route_from_categ_ids" widget="many2many_tags" readonly="1" attrs="{'invisible':[('route_from_categ_ids', '=', [])]}"/>
|
||||
<label for="sale_delay"/>
|
||||
<div>
|
||||
<field name="sale_delay" attrs="{'readonly':[('sale_ok','=',False)]}" class="oe_inline" style="vertical-align:baseline"/> days
|
||||
</div>
|
||||
</group>
|
||||
<group name="group_lots_and_weight">
|
||||
<label for="weight" attrs="{'invisible':['|', ('type', 'not in', ['product', 'consu']), ('product_variant_count', '>', 1)]}"/>
|
||||
<div class="o_row" name="weight" attrs="{'invisible':['|', ('type', 'not in', ['product', 'consu']), ('product_variant_count', '>', 1)]}">
|
||||
<group string="Logistics" name="group_lots_and_weight" attrs="{'invisible':['|', ('type', 'not in', ['product', 'consu']), ('product_variant_count', '>', 1)]}">
|
||||
<label for="weight"/>
|
||||
<div class="o_row" name="weight">
|
||||
<field name="weight"/>
|
||||
</div>
|
||||
<field name="tracking" widget="radio" attrs="{'invisible':[('type', 'in', ['service', 'digital'])]}" groups="stock.group_production_lot"/>
|
||||
<label for="volume" attrs="{'invisible':['|', ('type', 'not in', ['product', 'consu']), ('product_variant_count', '>', 1)]}"/>
|
||||
<div class="o_row" name="volume" attrs="{'invisible':['|', ('type', 'not in', ['product', 'consu']), ('product_variant_count', '>', 1)]}">
|
||||
<label for="volume"/>
|
||||
<div class="o_row" name="volume">
|
||||
<field name="volume" string="Volume"/>
|
||||
</div>
|
||||
</group>
|
||||
<group name="stock_property" groups="base.group_no_one">
|
||||
<group string="Traceability" name="traceability" groups="stock.group_production_lot">
|
||||
<field name="tracking" widget="radio" attrs="{'invisible':[('type', 'in', ['service', 'digital'])]}"/>
|
||||
</group>
|
||||
<group string="Counterpart Locations" name="stock_property" groups="base.group_no_one">
|
||||
<field name="property_stock_procurement" domain="[('usage','=','procurement')]"/>
|
||||
<field name="property_stock_production" domain="[('usage','=','production')]"/>
|
||||
<field name="property_stock_inventory" domain="[('usage','=','inventory')]"/>
|
||||
@@ -149,27 +155,15 @@
|
||||
</group>
|
||||
<group name="description" position="after">
|
||||
<group>
|
||||
<group string="Description for Internal Transfers">
|
||||
<field name="description_picking" placeholder="Description for Internal Transfers (Rack, Row and Case Information)" nolabel="1"/>
|
||||
</group>
|
||||
<group string="Description for Delivery Orders">
|
||||
<field name="description_pickingout" nolabel="1" placeholder="This note will be displayed on Delivery orders."/>
|
||||
<field name="description_pickingout" nolabel="1" placeholder="This note will show up on delivery orders."/>
|
||||
</group>
|
||||
<group string="Description for Receptions">
|
||||
<field name="description_pickingin" nolabel="1" placeholder="This note will show up on the receipt orders (e.g. where to store the product in the warehouse)."/>
|
||||
</group>
|
||||
<group string="Description for Internal Transfers">
|
||||
<field name="description_picking" placeholder="This note will show up on internal transfer orders (e.g. where to pick the product in the warehouse)." nolabel="1"/>
|
||||
</group>
|
||||
</group>
|
||||
<group string="Description for Receptions">
|
||||
<field name="description_pickingin" nolabel="1" placeholder="This note will be displayed on the Receptions."/>
|
||||
</group>
|
||||
</group>
|
||||
<group name="email_template_and_project" position="before">
|
||||
<group name="sale_condition" string="Sale Conditions">
|
||||
<label for="warranty" groups="stock.group_production_lot"/>
|
||||
<div groups="stock.group_production_lot">
|
||||
<field name="warranty" class="oe_inline"/> months
|
||||
</div>
|
||||
<label for="sale_delay"/>
|
||||
<div>
|
||||
<field name="sale_delay" attrs="{'readonly':[('sale_ok','=',False)]}" class="oe_inline" style="vertical-align:baseline"/> days
|
||||
</div>
|
||||
</group>
|
||||
</group>
|
||||
</field>
|
||||
|
||||
@@ -39,7 +39,7 @@
|
||||
</field>
|
||||
<field name="standard_price" position="replace">
|
||||
<field name="standard_price"
|
||||
attrs="{'readonly':['&', ('valuation','=','real_time'), ('cost_method', 'in', ['standard', 'average'])]}" class="oe_inline"
|
||||
attrs="{'readonly':['&', ('valuation','=','real_time'), ('cost_method', 'in', ['standard', 'average'])]}"
|
||||
widget='monetary' options="{'currency_field': 'currency_id'}"/>
|
||||
</field>
|
||||
<div name="standard_price_uom" position="after">
|
||||
@@ -49,13 +49,11 @@
|
||||
class="oe_link oe_read_only" colspan="2"/>
|
||||
</div>
|
||||
<group name="accounting" position="inside">
|
||||
<group name="property_inventory_valuation" attrs="{'invisible': [('type','=','service')]}">
|
||||
<group name="property_inventory_valuation" string="Stock Valuation" attrs="{'invisible': [('type','=','service'), ('valuation', '!=', 'real_time')]}">
|
||||
<field name="property_valuation" invisible="1"/>
|
||||
<field name="property_stock_account_input"
|
||||
attrs="{'invisible':[ ('valuation', '!=', 'real_time')]}"
|
||||
domain="[('deprecated', '=', False)]"/>
|
||||
<field name="property_stock_account_output"
|
||||
attrs="{'invisible':[ ('valuation', '!=', 'real_time')]}"
|
||||
domain="[('deprecated', '=', False)]"/>
|
||||
</group>
|
||||
</group>
|
||||
|
||||
@@ -15,7 +15,7 @@ SPLIT_METHOD = [
|
||||
class ProductTemplate(models.Model):
|
||||
_inherit = "product.template"
|
||||
|
||||
landed_cost_ok = fields.Boolean('Landed Costs')
|
||||
landed_cost_ok = fields.Boolean('Is a Landed Cost')
|
||||
split_method = fields.Selection(
|
||||
selection=SPLIT_METHOD, string='Split Method', default='equal',
|
||||
help="Equal : Cost will be equally divided.\n"
|
||||
|
||||
@@ -4,10 +4,10 @@
|
||||
<record id="view_product_landed_cost_form" model="ir.ui.view">
|
||||
<field name="name">product.template.landed.cost.form</field>
|
||||
<field name="model">product.template</field>
|
||||
<field name="inherit_id" ref="product.product_template_form_view"/>
|
||||
<field name="inherit_id" ref="purchase.view_product_supplier_inherit"/>
|
||||
<field name="arch" type="xml">
|
||||
<group name="accounting" position="inside">
|
||||
<group>
|
||||
<group string="Landed Costs">
|
||||
<field name="landed_cost_ok" class="oe_inline" attrs="{'invisible':[('type', 'not in', ['product', 'consu', 'service'])]}"/>
|
||||
<field name="split_method" attrs="{'invisible':['|', ('landed_cost_ok', '=' ,False), ('type', 'not in', ['product', 'consu', 'service'])]}"/>
|
||||
</group>
|
||||
|
||||
@@ -79,7 +79,7 @@
|
||||
</group>
|
||||
<button name="toggle_active" position="before">
|
||||
<button class="oe_stat_button" name="website_publish_button"
|
||||
type="object" icon="fa-globe">
|
||||
type="object" icon="fa-globe" attrs="{'invisible': [('sale_ok','=',False)]}">
|
||||
<field name="website_published" widget="website_button"/>
|
||||
</button>
|
||||
</button>
|
||||
|
||||
Reference in New Issue
Block a user