[REF] product: update and form cleaning

Among a lot of views tweakings and cleaning, some changes are listed here.

product
- add currency_id, taken from the company

stock
- procurement request and inveotry adjustement wizards now correctly work
  on product and templates with 1 or more variants. With one product the product
  field is readonly, with a template and/or a product with variants the
  product field is limited to the existing varians.
- valuation and cost method fields on the templates now come from property
  fields defined on the template, or from property fields defined on the
  product category. It allows to define those fields directly from the
  category.Among a lot of views tweakings and cleaning, some changes are listed here.

membership
-  details not visible in the default product view. However there is a specific view
to use in (membership / configuration / create member product)
This commit is contained in:
Prashent Panchal
2015-08-25 11:06:29 +02:00
committed by Thibault Delavallée
parent 59f448a3ca
commit af9d21b379
35 changed files with 604 additions and 558 deletions
+10 -9
View File
@@ -9,20 +9,21 @@
<field name="arch" type="xml">
<page name="sales" position="after">
<page string="Accounting" groups="account.group_account_invoice">
<group>
<label for="categ_id" string="Internal Category"/>
<div><field name="categ_id" colspan="3" nolabel="1"/></div>
</group>
<group name="properties">
<group>
<field name="property_account_income_id" domain="[('internal_type','=','other'),('deprecated','=',False)]" groups="account.group_account_user"/>
<field name="taxes_id" colspan="2" 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>
<field name="property_account_expense_id" domain="[('internal_type','=','other'),('deprecated','=',False)]" groups="account.group_account_user"/>
<field name="supplier_taxes_id" colspan="2" 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"/>
</page>
</page>
</field>
@@ -35,7 +36,7 @@
<field name="arch" type="xml">
<data>
<xpath expr="//group[@name='parent']" position="inside">
<group name="account_property" string="Account Properties" colspan="2">
<group name="account_property" string="Account Properties">
<field name="property_account_income_categ_id" domain="[('internal_type','=','other'),('deprecated', '=', False)]"/>
<field name="property_account_expense_categ_id" domain="[('internal_type','=','other'),('deprecated', '=', False)]"/>
</group>
@@ -229,16 +229,21 @@
<record id="view_product_template_form_inherit" model="ir.ui.view">
<field name="name">Product Template (form)</field>
<field name="model">product.template</field>
<field name="inherit_id" ref="product.product_template_form_view"/>
<field name="inherit_id" ref="account.product_template_form_view"/>
<field name="arch" type="xml">
<xpath expr="//group[@name='properties']" position="before">
<group name="asset types">
<field name="asset_category_id" domain="[('type','=','purchase')]" context="{'default_type':'purchase'}"/>
</group>
</xpath>
<field name="property_account_expense_id" position="before">
<field name="asset_category_id"
domain="[('type', '=', 'purchase')]"
context="{'default_type': 'purchase'}"/>
</field>
<field name="property_account_income_id" position="before">
<field name="deferred_revenue_category_id"
domain="[('type', '=', 'sale')]"
context="{'default_type': 'sale'}"/>
</field>
</field>
</record>
<record id="view_account_move_form_asset_inherit" model="ir.ui.view">
<field name="name">Journal Entries (form)</field>
<field name="model">account.move</field>
-18
View File
@@ -80,24 +80,6 @@
</field>
</record>
<record model="ir.ui.view" id="product_template_form_view">
<field name="name">Membership Products</field>
<field name="model">product.template</field>
<field name="priority">6</field>
<field name="inherit_id" ref="product.product_template_form_view"/>
<field name="arch" type="xml">
<field name="type" position="after">
<field name="membership" readonly="0" attrs="{'invisible': [('type', '!=', 'service')]}"/>
</field>
<field name="description" position="before">
<group attrs="{'invisible':[('membership','=',False)]}">
<field name="membership_date_from" readonly="0" attrs="{'required':[('membership','=',True)]}"/>
<field name="membership_date_to" readonly="0" attrs="{'required':[('membership','=',True)]}"/>
</group>
</field>
</field>
</record>
<record model="ir.actions.act_window" id="action_membership_products">
<field name="name">Membership Products</field>
<field name="res_model">product.template</field>
+3 -3
View File
@@ -544,11 +544,11 @@
<field name="model">product.template</field>
<field name="inherit_id" ref="product.product_template_form_view"/>
<field name="arch" type="xml">
<group name="website_and_pos" position="inside">
<group name="sale_condition" position="after">
<group name="pos" string="Point of Sale">
<field name="pos_categ_id"/>
<field name="available_in_pos"/>
<field name="to_weight" />
<field name="pos_categ_id" attrs="{'invisible': [('available_in_pos', '=', False)]}"/>
<field name="to_weight" attrs="{'invisible': [('available_in_pos', '=', False)]}"/>
</group>
</group>
</field>
+1 -1
View File
@@ -4,7 +4,7 @@
{
'name': 'Products & Pricelists',
'version': '1.1',
'version': '1.2',
'category': 'Sales Management',
'depends': ['base', 'decimal_precision', 'mail', 'report'],
'demo': [
+23 -5
View File
@@ -342,9 +342,22 @@ class product_attribute_line(osv.osv):
_columns = {
'product_tmpl_id': fields.many2one('product.template', 'Product Template', required=True, ondelete='cascade'),
'attribute_id': fields.many2one('product.attribute', 'Attribute', required=True, ondelete='restrict'),
'value_ids': fields.many2many('product.attribute.value', id1='line_id', id2='val_id', string='Product Attribute Value(s)'),
'value_ids': fields.many2many('product.attribute.value', id1='line_id', id2='val_id', string='Attribute Values'),
}
def name_search(self, cr, uid, name='', args=None, operator='ilike', context=None, limit=100):
# TDE FIXME: currently overriding the domain; however as it includes a
# search on a m2o and one on a m2m, probably this will quickly become
# difficult to compute - check if performance optimization is required
if name and operator in ('=', 'ilike', '=ilike', 'like', '=like'):
new_args = ['|', ('attribute_id', operator, name), ('value_ids', operator, name)]
else:
new_args = args
return super(product_attribute_line, self).name_search(
cr, uid, name=name,
args=new_args,
operator=operator, context=context, limit=limit)
#----------------------------------------------------------
# Products
@@ -473,6 +486,11 @@ class product_template(osv.osv):
'rental': fields.boolean('Can be Rent'),
'categ_id': fields.many2one('product.category','Internal Category', required=True, change_default=True, domain="[('type','=','normal')]" ,help="Select category for the current product"),
'price': fields.function(_product_template_price, fnct_inv=_set_product_template_price, type='float', string='Price', digits_compute=dp.get_precision('Product Price')),
'currency_id': fields.related(
'company_id', 'currency_id',
type='many2one',
relation='res.currency',
string='Currency'),
'list_price': fields.float('Sale Price', digits_compute=dp.get_precision('Product Price'), help="Base price to compute the customer price. Sometimes called the catalog price."),
'lst_price' : fields.related('list_price', type="float", string='Public Price', digits_compute=dp.get_precision('Product Price')),
'standard_price': fields.function(_compute_product_template_field, fnct_inv=_set_product_template_field, multi='_compute_product_template_field', type='float', string='Cost Price', digits_compute=dp.get_precision('Product Price'),
@@ -596,8 +614,8 @@ class product_template(osv.osv):
res = False
return res
def onchange_type(self, cr, uid, ids, type):
return {}
def onchange_type(self, cr, uid, ids, type, context=None):
return {'value': {}}
def onchange_uom(self, cursor, user, ids, uom_id, uom_po_id):
if uom_id:
@@ -977,8 +995,8 @@ class product_product(osv.osv):
self.pool.get('product.template').unlink(cr, uid, unlink_product_tmpl_ids, context=context)
return res
def onchange_type(self, cr, uid, ids, type):
return {}
def onchange_type(self, cr, uid, ids, type, context=None):
return {'value': {}}
def onchange_uom(self, cursor, user, ids, uom_id, uom_po_id):
if uom_id and uom_po_id:
+133 -163
View File
@@ -3,6 +3,30 @@
<data>
<menuitem id="base.menu_product" name="Product Variants" parent="base.menu_base_partner" sequence="9" groups="product.group_product_variant"/>
<!-- Variants -->
<record id="product_attribute_value_view_tree" model="ir.ui.view">
<field name="name">product.attribute.value.view.tree</field>
<field name="model">product.attribute.value</field>
<field name="arch" type="xml">
<tree string="Attributes" editable="top">
<field name="sequence" widget="handle"/>
<field name="attribute_id"/>
<field name="name"/>
<field name="price_extra"/>
</tree>
</field>
</record>
<record id="product_attribute_value_action" model="ir.actions.act_window">
<field name="name">Variant Values</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">product.attribute.value</field>
<field name="view_mode">tree</field>
<field name="view_type">form</field>
<field name="view_id" ref="product_attribute_value_view_tree"/>
<field name="domain">[('product_ids.product_tmpl_id', '=', active_id)]</field>
<field name="context">{'default_product_tmpl_id': active_id}</field>
</record>
<!-- templates -->
<record id="product_template_search_view" model="ir.ui.view">
@@ -11,19 +35,13 @@
<field name="arch" type="xml">
<search string="Product">
<field name="name" string="Product" filter_domain="['|',('default_code','ilike',self),('name','ilike',self)]"/>
<separator/>
<filter string="Services" name="services" domain="[('type','=','service')]"/>
<filter string="Consumable" name="consumable" domain="[('type','=','consu')]" help="Consumable products"/>
<filter string="Products" name="consumable" domain="[('type','=','consu')]" help="Products your store in the inventory"/>
<separator/>
<filter string="Can be Sold" name="filter_to_sell" domain="[('sale_ok','=',1)]"/>
<field name="categ_id" filter_domain="[('categ_id', 'child_of', self)]"/>
<field string="Product Variant" name="product_variant_ids" filter_domain="['|', ('product_variant_ids.name','ilike',self), ('product_variant_ids.attribute_value_ids.attribute_id.name','ilike',self)]" groups="product.group_product_variant"/>
<field name="company_id"/>
<field string="Attributes" name="attribute_line_ids"/>
<field name="pricelist_id" widget="selection" context="{'pricelist': self}" filter_domain="[]" groups="product.group_sale_pricelist"/> <!-- Keep widget=selection on this field to pass numeric `self` value, which is not the case for regular m2o widgets! -->
<group expand='0' name="group_by" string='Group by...'>
<filter string='Category' domain="[]" context="{'group_by' : 'categ_id'}"/>
<filter string='Default Unit of Measure' domain="[]" context="{'group_by' : 'uom_id'}"/>
<filter string='Type' domain="[]" context="{'group_by' : 'type'}"/>
</group>
</search>
</field>
</record>
@@ -52,9 +70,15 @@
<field name="mode">primary</field>
<field name="arch" type="xml">
<form string="Product">
<field name="is_product_variant" invisible="1"/>
<field name='product_variant_count' invisible='1'/>
<header>
<button string="Variant Prices" type="action"
name="%(product_attribute_value_action)d"
attrs="{'invisible': [('product_variant_count', '&lt;=', 1)]}"
groups="product.group_product_variant"/>
</header>
<sheet>
<field name="is_product_variant" invisible="1"/>
<field name='product_variant_count' invisible='1'/>
<field name="id" invisible="True"/>
<div class="oe_button_box" name="button_box"/>
<field name="image_medium" widget="image" class="oe_avatar"/>
@@ -69,75 +93,73 @@
</div>
</div>
<notebook>
<page string="Information">
<group colspan="4">
<group>
<field name="type" on_change="onchange_type(type)"/>
<field name="uom_id" options="{'no_open': True, 'no_create': True}" on_change="onchange_uom(uom_id,uom_po_id)" groups="product.group_uom"/>
<page string="General Information">
<group>
<group name="group_general">
<field name="categ_id" string="Internal Category"/>
<field name="type" on_change="onchange_type(type, context)"/>
</group>
<group name="group_standard_price">
<field name="active" groups="base.group_no_one"/>
<field name="list_price"/>
</group>
<group>
<field name="active"/>
<label for="standard_price" groups="base.group_user"/>
<div name="standard_price_uom" groups="base.group_user">
<field name="standard_price" class="oe_inline"/>
<field name="currency_id" readonly="1" class="oe_inline" nolabel="1"/>
<label string="/" class="oe_inline" groups="product.group_uom"/>
<field name="uom_rel_id" class="oe_inline" groups="product.group_uom"/>
</div>
<field name="uom_id" on_change="onchange_uom(uom_id,uom_po_id)" groups="product.group_uom"/>
<field name="uom_po_id" groups="product.group_uom"/>
</group>
</group>
<group colspan="4">
<field name="company_id" groups="base.group_multi_company" options="{'no_create': True}"/>
</group>
<field name="description" placeholder="describe the product characteristics..."/>
</page>
<page string="Procurements" name="procurements" groups="base.group_user">
<group name="procurement">
<group name="general" col="4">
<group name="standard_price" attrs="{'invisible':[('product_variant_count','>',1)]}">
<label for="standard_price"/>
<div>
<field name="standard_price" class="oe_inline"/>
<label string="/" class="oe_inline" groups="product.group_uom"/>
<field name="uom_rel_id" options="{'no_open':True,'no_create':True}" class="oe_inline" groups="product.group_uom"/>
</div>
</group>
<field name="uom_po_id" options="{'no_open': True, 'no_create': True}" groups="product.group_uom"/>
<page string="Inventory">
<group name="inventory">
<group>
<field name="company_id" groups="base.group_multi_company"
options="{'no_create': True}"/>
</group>
<group name="group_lots_and_weight">
<field digits="(14, 3)" name="weight" string="Weight"
attrs="{'invisible':[('type', 'not in', ['product', 'consu'])]}"/>
</group>
</group>
<separator string="Vendors"/>
<field name="seller_ids"/>
<separator string="Description for Vendors"/>
<field name="description_purchase" placeholder="This note will be displayed on requests for quotation..."/>
</page>
<page string="Inventory">
<group name="inventory">
<group name="status" string="Status">
<field name="state"/>
<field name="product_manager"/>
</group>
<group name="weight" string="Weights" attrs="{'invisible':['|', ('type','=','service'), ('product_variant_count','>',1)]}">
<field digits="(14, 3)" name="volume"/>
<field name="weight"/>
</group>
</group>
<group name="packaging" string="Packaging" attrs="{'invisible':[('type','=','service')]}" groups="product.group_stock_packaging" colspan="4">
<group name="packaging" string="Packaging"
colspan="4"
attrs="{'invisible':[('type', 'not in', ['product, consu'])]}"
groups="product.group_stock_packaging">
<field name="packaging_ids" nolabel="1"/>
</group>
</page>
<page string="Sales" attrs="{'invisible':[('sale_ok','=',False)]}" name="sales">
<group name="sale">
<group name="sale_condition" string="Sale Conditions" colspan="3">
<group name="sale_condition" string="Sale Conditions">
<label for="warranty"/>
<div>
<field name="warranty" class="oe_inline"/> months
</div>
</group>
<group name="email_template_and_project"
attrs="{'invisible':[('type', '!=', 'service')]}"/>
<group groups="product.group_uos" string="Unit of Measure">
<field name="uos_id" options="{'no_open':True,'no_create':True}"/>
<field name="uos_coeff"/>
<field name="mes_type"/>
<field name="uos_coeff" groups="base.group_no_one"/>
</group>
</group>
<group name="website_and_pos" col="2">
</group>
<separator string="Description for Quotations"/>
<field name="description_sale" placeholder="note to be displayed on quotations..."/>
</page>
<page string="Notes" name="notes">
<group name="description">
<separator string="Description for Quotations" colspan="4"/>
<field name="description_sale" colspan="4" nolabel="1"
placeholder="This note will be displayed on the quotations."/>
<separator string="Description for Vendors" colspan="4"/>
<field name="description_purchase" nolabel="1"
placeholder="This note will be displayed on requests for quotation." colspan="4"/>
</group>
</page>
</notebook>
</sheet>
<div class="oe_chatter">
@@ -154,43 +176,13 @@
<field name="mode">primary</field>
<field name="inherit_id" ref="product.product_template_search_view"/>
<field name="arch" type="xml">
<field name="product_variant_ids" position="replace">
<field name="attribute_line_ids" position="replace">
<field name="attribute_value_ids" groups="product.group_product_variant"/>
<field name="product_tmpl_id" string="Product Template"/>
</field>
<field name="name" position="after">
<field name="product_tmpl_id" string="Product Template"/>
</field>
<xpath expr="//group[@name='group_by']" position="inside">
<filter string='Product Template' name="template_id" domain="[]" context="{'group_by' : 'product_tmpl_id'}"/>
</xpath>
</field>
</record>
<!-- variants -->
<record id="variants_template_tree_view" model="ir.ui.view">
<field name="name">variants.template.tree</field>
<field name="model">product.attribute.value</field>
<field name="arch" type="xml">
<tree string="Variant Values" editable="top">
<field name="sequence" widget="handle"/>
<field name="attribute_id"/>
<field name="name"/>
<field name="price_extra"/>
</tree>
</field>
</record>
<record id="variants_template_action" model="ir.actions.act_window">
<field name="name">Variant Values</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">product.attribute.value</field>
<field name="view_mode">tree</field>
<field name="view_type">form</field>
<field name="view_id" ref="variants_template_tree_view"/>
<field name="domain">[('product_ids.product_tmpl_id', '=', active_id)]</field>
<field name="context">{'default_product_tmpl_id': active_id}</field>
</record>
<record id="product_normal_action" model="ir.actions.act_window">
<field name="name">Product</field>
<field name="type">ir.actions.act_window</field>
@@ -294,31 +286,33 @@
<xpath expr="//form" position="attributes">
<attribute name="name">Product Template</attribute>
</xpath>
<field name="active" position="after">
<field name="barcode" attrs="{'invisible': [('product_variant_count', '>', 1)]}"/>
<field name="type" position="after">
<field name="default_code" attrs="{'invisible': [('product_variant_count', '>', 1)]}"/>
<field name="barcode" attrs="{'invisible': [('product_variant_count', '>', 1)]}"/>
</field>
<div name="button_box" position="inside">
<button class="oe_stat_button" string="Variant Prices" name="%(variants_template_action)d" type="action" icon="fa-usd" groups="product.group_product_variant"/>
<button class="oe_stat_button" name="%(product.product_variant_action)d" type="action" icon="fa-sitemap" groups="product.group_product_variant">
<field string="List of Variants" name="product_variant_count" widget="statinfo" />
<button name="%(product.product_variant_action)d" type="action"
icon="fa-sitemap" class="oe_stat_button"
attrs="{'invisible': [('product_variant_count', '&lt;=', 1)]}"
groups="product.group_product_variant">
<field string="Variants" name="product_variant_count" widget="statinfo" />
</button>
</div>
<xpath expr="//page[@name='sales']" position="after">
<page name="variants" string="Variants" groups="product.group_product_variant">
<p class="oe_grey">
<strong>Warning</strong>: adding or deleting attributes
will delete and recreate existing variants and lead
to the loss of their possible customizations.
</p>
<field name="attribute_line_ids" widget="one2many_list" context="{'show_attribute': False}">
<tree string="Variants" editable="bottom">
<tree string="Variants" editable="bottom">
<field name="attribute_id"/>
<field name="value_ids" widget="many2many_tags" options="{'no_create_edit': True}" domain="[('attribute_id', '=', attribute_id)]" context="{'default_attribute_id': attribute_id}"/>
</tree>
</field>
<p class="oe_grey">
<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>
</field>
@@ -381,7 +375,21 @@
</p>
</field>
</record>
<record id="product_template_action_product" 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_type">form</field>
<field name="context">{"search_default_products": 1, 'default_type': 'product'}</field>
<field name="help" type="html">
<p class="oe_view_nocontent_create">
Click to define a new product.
</p>
</field>
</record>
<menuitem id="base.menu_sales" name="Sales" parent="base.menu_base_partner" sequence="5"/>
<menuitem action="product_template_action"
id="menu_product_template_action"
@@ -430,11 +438,12 @@
<field name="seller_ids" readonly="1"/>
</field>
<field name="description_purchase" position="replace">
<field name="description_purchase" placeholder="This note will be displayed on requests for quotation..." readonly="1"/>
<field name="description_purchase" nolabel="1"
placeholder="This note will be displayed on requests for quotation..." readonly="1"/>
</field>
<field name="active" position="after">
<field name="barcode"/>
<field name="type" position="after">
<field name="default_code"/>
<field name="barcode"/>
</field>
<field name="list_price" position="attributes">
<attribute name="name">lst_price</attribute>
@@ -446,12 +455,12 @@
<field name="standard_price" position="replace">
<field name="standard_price" attrs="{'invisible':[('product_variant_count','=', 1)]}"/>
</field>
<group name="weight" position="replace">
<group name="weight" string="Weights" attrs="{'invisible':['|', ('type','=','service'), ('product_variant_count','=',1)]}">
<field digits="(14, 3)" name="volume"/>
<field digits="(14, 3)" name="weight"/>
</group>
</group>
<field name="weight" position="replace">
<field digits="(14, 3)" name="volume"
attrs="{'invisible':['|', ('type', 'not in', ['product', 'consu']),('product_variant_count','=',1)]}"/>
<field digits="(14, 3)" name="weight"
attrs="{'invisible':['|', ('type', 'not in', ['product', 'consu']),('product_variant_count','=',1)]}"/>
</field>
<xpath expr="//div[@class='oe_title']" position="inside">
<field name="attribute_value_ids" widget="many2many_tags" groups="product.group_product_variant"/>
</xpath>
@@ -581,13 +590,13 @@
<field name="arch" type="xml">
<form string="Product Categories">
<div class="oe_title">
<label for="name" class="oe_edit_only"/>
<label for="name" string="Category Name" class="oe_edit_only"/>
<h1>
<field name="name"/>
</h1>
</div>
<group>
<group name="parent" col="4">
<group name="parent">
<group string="Category Type">
<field name="parent_id"/>
<field name="type"/>
</group>
@@ -605,31 +614,6 @@
</tree>
</field>
</record>
<record id="product_category_tree_view" model="ir.ui.view">
<field name="name">product.category.tree</field>
<field name="model">product.category</field>
<field name="field_parent">child_id</field>
<field name="arch" type="xml">
<tree toolbar="True" string="Product Categories">
<field name="name"/>
</tree>
</field>
</record>
<record id="product_category_action" model="ir.actions.act_window">
<field name="name">Products by Category</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">product.category</field>
<field name="domain">[('parent_id','=',False)]</field>
<field name="view_type">tree</field>
<field name="view_id" ref="product_category_tree_view"/>
<field name="help" type="html">
<p>
Here is a list of all your products classified by category. You
can click a category to get the list of all products linked to
this category or to a child of this category.
</p>
</field>
</record>
<record id="product_category_action_form" model="ir.actions.act_window">
<field name="name">Product Categories</field>
<field name="type">ir.actions.act_window</field>
@@ -643,22 +627,6 @@
id="menu_product_category_action_form"
parent="prod_config_main" sequence="2"/>
<record id="product_normal_action_tree" model="ir.actions.act_window">
<field name="name">Product Variants</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">product.product</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form,kanban</field>
<field name="context">{'categ_id':active_id, 'search_default_categ_id':active_id}</field>
</record>
<record id="ir_product_category_open" model="ir.values">
<field eval="'tree_but_open'" name="key2"/>
<field eval="'product.category'" name="model"/>
<field name="name">Products by Categories</field>
<field eval="'ir.actions.act_window,%d'%product_normal_action_tree" name="value"/>
</record>
<!-- Unit of Measure -->
<record id="product_uom_tree_view" model="ir.ui.view">
@@ -795,15 +763,17 @@
<field name="model">product.supplierinfo</field>
<field name="arch" type="xml">
<form string="Vendor Information">
<group col="4">
<field name="name" context="{'default_customer': 0, 'search_default_supplier': 1, 'default_supplier': 1}"/>
<field name="sequence"/>
<field name="product_name"/>
<field name="product_code"/>
<field name="min_qty"/>
<field name="product_uom" groups="product.group_uom"/>
<field name="delay"/>
<field name="company_id" groups="base.group_multi_company" options="{'no_create': True}"/>
<group>
<group>
<field name="name" context="{'default_customer': 0, 'search_default_supplier': 1, 'default_supplier': 1}"/>
<field name="min_qty"/>
<field name="product_uom" groups="product.group_uom"/>
<field name="delay"/>
</group><group>
<field name="company_id" groups="base.group_multi_company" options="{'no_create': True}"/>
<field name="product_name"/>
<field name="product_code"/>
</group>
</group>
<p groups="product.group_purchase_pricelist" class="oe_grey">The prices below will only be taken into account when your pricelist is set as based on vendor prices.</p>
<field groups="product.group_purchase_pricelist" name="pricelist_ids">
@@ -6,17 +6,21 @@
<field name="model">product.template</field>
<field name="inherit_id" ref="product.product_template_form_view"/>
<field name="arch" type="xml">
<field name="company_id" position="after">
<field name="email_template_id"
<group name="email_template_and_project" position="attributes">
<attribute name="string">Miscellaneous</attribute>
<attribute name="attrs"></attribute>
</group>
<group name="email_template_and_project" position="inside">
<field name="email_template_id" String="Invoice Confirmation Email"
domain="[('model','=','product.template')]"
context="{
'form_view_ref':'product_email_template.email_template_form_simplified',
'default_model': 'product.template',
'default_subject': name,
'default_name': name,
}"
}"/>
/>
</field>
</group>
</field>
</record>
</data>
@@ -24,10 +24,10 @@
<record model="ir.ui.view" id="view_product_form_expiry">
<field name="name">product.normal.form</field>
<field name="model">product.template</field>
<field name="inherit_id" ref="product.product_template_form_view" />
<field name="inherit_id" ref="stock.view_template_property_form" />
<field name="arch" type="xml">
<group name="weight" position="after">
<group string="Dates">
<group name="stock_property" position="after">
<group name="expiry_and_lots" groups="stock.group_production_lot">
<field name="life_time" />
<field name="use_time" />
<field name="removal_time" />
@@ -7,13 +7,14 @@
<field name="priority">3</field>
<field name="inherit_id" ref="product.product_template_only_form_view" />
<field name="arch" type="xml">
<field name="standard_price" position="after">
<button name="%(action_view_compute_price_wizard)d" string="⇒ Update"
type="action" attrs="{'invisible': ['|', ('cost_method', '!=', 'standard'), ('bom_count', '=', 0)]}"
help="Compute the price of the product using products and operations of related bill of materials, for manufactured products only."
class="oe_link"
groups="stock_account.group_inventory_valuation"/>
</field>
<div name="standard_price_uom" position="after">
<button name="%(action_view_compute_price_wizard)d"
string="Compute from BOM" type="action"
attrs="{'invisible': ['|', ('cost_method', '!=', 'standard'), ('bom_count', '=', 0)]}"
help="Compute the price of the product using products and operations of related bill of materials, for manufactured products only."
class="oe_link oe_read_only"
colspan="2"/>
</div>
</field>
</record>
</data>
+1 -15
View File
@@ -584,21 +584,7 @@
<menuitem action="open_view_project_all" id="menu_projects" name="Dashboard" parent="base.menu_main_pm" sequence="1"/>
<record id="product_search_form_view_procurment_consume" model="ir.ui.view">
<field name="name">product.product.service.search</field>
<field name="model">product.template</field>
<field name="inherit_id" ref="product.product_template_search_view"/>
<field name="arch" type="xml">
<xpath expr="//filter[@name='services']" position="replace">
<filter string="Services" name="services" domain="[('type','=','service')]" invisible="context.get('consumable_services', False)"/>
</xpath>
<xpath expr="//filter[@name='consumable']" position="replace">
<filter string="Consumable" name="consumable" domain="[('type','=','consu')]" help="Consumable products" invisible="context.get('consumable_services', False)"/>
</xpath>
</field>
</record>
<record id="task_company" model="ir.ui.view">
<record id="task_company" model="ir.ui.view">
<field name="name">res.company.task.config</field>
<field name="model">res.company</field>
<field name="inherit_id" ref="base.view_company_form"/>
+5 -4
View File
@@ -721,7 +721,8 @@
<field name="arch" type="xml">
<div name="button_box" position="inside">
<button class="oe_stat_button" name="action_view_purchases" type="object"
icon="fa-shopping-cart">
icon="fa-shopping-cart"
groups="base.group_no_one">
<field string="Purchases" name="purchase_count" widget="statinfo"/>
</button>
</div>
@@ -736,7 +737,8 @@
<field name="arch" type="xml">
<div name="button_box" position="inside">
<button class="oe_stat_button" name="action_view_purchases" type="object"
icon="fa-shopping-cart">
icon="fa-shopping-cart"
groups="base.group_no_one">
<field string="Purchases" name="purchase_count" widget="statinfo"/>
</button>
</div>
@@ -748,10 +750,9 @@
<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="after">
<field name="supplier_taxes_id" position="after">
<label string="" colspan="2"/>
<field name="property_account_creditor_price_difference" domain="[('deprecated','=',False)]" attrs="{'readonly':[('purchase_ok', '=', 0)]}" />
<newline/>
</field>
</field>
</record>
@@ -30,7 +30,7 @@
<field name="model">product.template</field>
<field name="inherit_id" ref="product.product_template_form_view"/>
<field name="arch" type="xml">
<field name="product_manager" position="after">
<field name="categ_id" position="after">
<field name="intrastat_id"/>
</field>
</field>
+4 -2
View File
@@ -595,7 +595,8 @@
<field name="arch" type="xml">
<div name="button_box" position="inside">
<button class="oe_stat_button" name="action_view_sales"
type="object" icon="fa-usd">
type="object" icon="fa-usd"
groups="base.group_no_one">
<field string="Sales" name="sales_count" widget="statinfo" />
</button>
</div>
@@ -610,7 +611,8 @@
<field name="arch" type="xml">
<div name="button_box" position="inside">
<button class="oe_stat_button" name="action_view_sales"
type="object" icon="fa-usd">
type="object" icon="fa-usd"
groups="base.group_no_one">
<field string="Sales" name="sales_count" widget="statinfo" />
</button>
</div>
@@ -7,8 +7,8 @@
<field name="model">product.template</field>
<field name="inherit_id" ref="product.product_template_form_view"/>
<field name="arch" type="xml">
<xpath expr="//group[@name='sale_condition']" position="after">
<group name="contract" string="Contract" colspan="3">
<xpath expr="//group[@name='email_template_and_project']" position="before">
<group name="contract" string="Contract">
<field name="recurring_invoice" class="oe_inline"/>
</group>
</xpath>
@@ -16,11 +16,12 @@
<field name="model">product.template</field>
<field name="inherit_id" ref="product.product_template_form_view"/>
<field name="arch" type="xml">
<group name="procurement" position="after">
<group string="Project Management Information" attrs="{'invisible': [('type', '!=', 'service')]}">
<field name="auto_create_task"/>
<field name="project_id" attrs="{'invisible':['|', ('type','!=','service'), ('auto_create_task', '=', False)]}"/>
</group>
<group name="email_template_and_project" position="attributes">
<attribute name="string">Miscellaneous</attribute>
</group>
<group name="email_template_and_project" position="inside">
<field name="auto_create_task" attrs="{'invisible': [('type', '!=', 'service')]}"/>
<field name="project_id" attrs="{'invisible': ['|', ('type', '!=', 'service'), ('auto_create_task', '=', False)]}"/>
</group>
</field>
</record>
@@ -49,7 +50,7 @@
<field name="res_model">product.template</field>
<field name="view_mode">kanban,tree,form</field>
<field name="view_type">form</field>
<field name="search_view_id" ref="project.product_search_form_view_procurment_consume"/>
<field name="search_view_id" ref="product.product_template_search_view"/>
<field name="view_id" ref="product.product_template_kanban_view"/>
<field name="context">{'search_default_services': 1,'default_auto_create_task':True,'default_sale_ok':True,'default_purchase_ok':False,'default_type':'service'}</field>
<field name="help" type="html">
+1 -1
View File
@@ -56,6 +56,7 @@ Dashboard / Reports for Inventory Management will include:
'wizard/stock_return_picking_view.xml',
'wizard/make_procurement_view.xml',
'wizard/orderpoint_procurement_view.xml',
'report/report_stock_forecast.xml',
'stock_incoterms.xml',
'stock_report.xml',
'stock_view.xml',
@@ -70,7 +71,6 @@ Dashboard / Reports for Inventory Management will include:
'views/report_stockpicking_operations.xml',
'views/report_deliveryslip.xml',
'views/report_stockinventory.xml',
'report/report_stock_forecast.xml',
'stock_dashboard.xml',
'wizard/stock_immediate_transfer.xml',
'wizard/stock_backorder_confirmation.xml',
+4 -16
View File
@@ -481,14 +481,7 @@ class product_template(osv.osv):
result = mod_obj.xmlid_to_res_id(cr, uid, name, raise_if_not_found=True)
result = act_obj.read(cr, uid, [result], context=context)[0]
return result
def action_open_quants(self, cr, uid, ids, context=None):
products = self._get_products(cr, uid, ids, context=context)
result = self._get_act_window_dict(cr, uid, 'stock.product_open_quants', context=context)
result['domain'] = "[('product_id','in',[" + ','.join(map(str, products)) + "])]"
result['context'] = "{'search_default_locationgroup': 1, 'search_default_internal_loc': 1}"
return result
def action_view_orderpoints(self, cr, uid, ids, context=None):
products = self._get_products(cr, uid, ids, context=context)
result = self._get_act_window_dict(cr, uid, 'stock.product_open_orderpoint', context=context)
@@ -502,14 +495,9 @@ class product_template(osv.osv):
def action_view_stock_moves(self, cr, uid, ids, context=None):
products = self._get_products(cr, uid, ids, context=context)
result = self._get_act_window_dict(cr, uid, 'stock.act_product_stock_move_open', context=context)
if len(ids) == 1 and len(products) == 1:
ctx = "{'tree_view_ref':'stock.view_move_tree', \
'default_product_id': %s, 'search_default_product_id': %s}" \
% (products[0], products[0])
result['context'] = ctx
else:
result['domain'] = "[('product_id','in',[" + ','.join(map(str, products)) + "])]"
result['context'] = "{'tree_view_ref':'stock.view_move_tree'}"
if products:
result['context'] = "{'default_product_id': %d}" % products[0]
result['domain'] = "[('product_id.product_tmpl_id','in',[" + ','.join(map(str,ids)) + "])]"
return result
def write(self, cr, uid, ids, vals, context=None):
+136 -97
View File
@@ -82,18 +82,15 @@
<field name="model">product.template</field>
<field name="inherit_id" ref="product.product_template_search_view"/>
<field name="arch" type="xml">
<field name="product_variant_ids" position="before">
<field name="pricelist_id" position="after">
<separator/>
<field name="location_id" widget="selection" context="{'location': self}"/>
<field name="warehouse_id" widget="selection" context="{'warehouse': self}"/>
<separator/>
<filter name="real_stock_available" string="Available Products" domain="[('qty_available','&gt;',0)]"/>
<filter name="virtual_stock_available" string="Forecast Available Products" domain="[('virtual_available','&gt;',0)]"/>
<filter name="real_stock_exhausted" string="Exhausted Stock" domain="[('qty_available','&lt;=',0)]"/>
<filter name="virtual_stock_exhausted" string="Forecast Exhausted Stock" domain="[('virtual_available','&lt;=',0)]"/>
<filter name="real_stock_negative" string="Negative Stock" domain="[('qty_available','&lt;',0)]"/>
<filter name="virtual_stock_negative" string="Forecast Negative Stock" domain="[('virtual_available','&lt;',0)]"/>
</field>
<filter name="consumable" position="before">
<filter string="Products" domain="[('type','=','product')]" help="Stockable products"/>
</filter>
</field>
</record>
@@ -102,56 +99,27 @@
<field name="model">product.template</field>
<field name="inherit_id" ref="product.product_template_form_view"/>
<field name="arch" type="xml">
<group name="sale_condition" position="inside">
<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="status" position="before">
<group string="Stock and Expected Variations" attrs="{'invisible': [('type', '=', 'service')]}" groups="base.group_user">
<label for="qty_available"/>
<div>
<field name="qty_available" class="oe_inline"/>
<button name="%(action_view_change_product_quantity)d" string="⇒ Update"
type="action"
class="oe_link"/>
</div>
<label for="incoming_qty"/>
<div>
<field name="incoming_qty" class="oe_inline"/>
<button string="⇒ Request Procurement" name="%(stock.act_make_procurement)d" type="action" class="oe_link"/>
</div>
<field name="outgoing_qty"/>
<field name="virtual_available"/>
</group>
</group>
<group name="status" position="before">
<group name="lot" groups="stock.group_production_lot" string="Lots" attrs="{'invisible':[('type','=','service')]}">
<field name="tracking" on_change="onchange_tracking(tracking)" widget="radio"/>
</group>
</group>
<group name="weight" position="before">
<group name="store" groups="stock.group_locations" string="Counter-Part Locations Properties" attrs="{'invisible':[('type','=','service')]}">
<field name="weight" position="after">
<field name="tracking" on_change="onchange_tracking(tracking)" widget="radio" attrs="{'invisible':[('type', 'in', ['service', 'digital'])]}" groups="stock.group_production_lot"/>
</field>
<field name="company_id" position="after">
<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', '=', [])]}"/>
</field>
<group name="group_lots_and_weight" position="after">
<group 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')]"/>
</group>
</group>
<field name="product_manager" position="attributes">
<attribute name="context" translation="off">{'default_groups_ref': ['base.group_user', 'base.group_sale_manager', 'stock.group_stock_manager']}</attribute>
<field name="description_purchase" position="after">
<separator string="Description for Pickings" colspan="4"/>
<field name="description_picking" placeholder="Description for Pickings (Rack, Row and Case Information)" nolabel="1" colspan="4"/>
</field>
<group name="procurement" position="after" >
<group string="Supply Chain Information" attrs="{'invisible': [('type', '=', 'service')]}" groups="base.group_user">
<field name="route_ids" widget="many2many_checkboxes"/>
<field name="route_from_categ_ids" widget="many2many_tags" readonly="1"/>
</group>
</group>
</field>
</record>
<record model="ir.ui.view" id="product_template_kanban_stock_view">
<field name="name">Product Template Kanban Stock</field>
<field name="model">product.template</field>
@@ -207,36 +175,74 @@
</field>
</record>
<record id="product_product_view_form_easy_inherit_stock" model="ir.ui.view">
<field name="name">product.product.view.form.easy.inherit.stock</field>
<field name="model">product.product</field>
<field name="inherit_id" ref="product.product_variant_easy_edit_view"/>
<field name="arch" type="xml">
<sheet position="before">
<header>
<button name="%(action_view_change_product_quantity)d" string="Inventory Adjustement" type="action" groups="product.group_product_variant"/>
<button string="Procurement Request" name="%(stock.act_make_procurement)d" type="action" groups="product.group_product_variant"/>
</header>
</sheet>
</field>
</record>
<record model="ir.ui.view" id="product_form_view_procurement_button">
<field name="name">product.product.procurement</field>
<field name="model">product.product</field>
<field name="inherit_id" ref="product.product_normal_form_view"/>
<field name="arch" type="xml">
<div name="button_box" position="inside">
<button class="oe_stat_button"
name="%(product_open_quants)d"
icon="fa-building-o"
type="action" attrs="{'invisible':[('type', '=', 'service')]}" groups="stock.group_locations">
<field name="qty_available" widget="statinfo"/>
</button>
<button class="oe_stat_button" name= "%(act_product_stock_move_open)d" type="action" attrs="{'invisible':[('type', '=', 'service')]}" string="Moves" groups="stock.group_stock_user" icon="fa-arrows-v"/>
<button class="oe_stat_button" name="%(product_open_orderpoint)d" type="action"
attrs="{'invisible':['|',('type', '=', 'service'),('nbr_reordering_rules', '==', 1)]}" icon="fa-refresh">
<field name="nbr_reordering_rules" widget="statinfo"/>
</button>
<button class="oe_stat_button" name="%(product_open_orderpoint)d" type="action"
attrs="{'invisible':['|',('type', '=', 'service'),('nbr_reordering_rules', '!=', 1)]}" icon="fa-refresh">
<div class="o_form_field o_stat_info mr4">
<span class="o_stat_text">Min :</span>
<span class="o_stat_text">Max:</span>
</div>
<div class="o_form_field o_stat_info">
<span class="o_stat_value"><field name="reordering_min_qty"/></span>
<span class="o_stat_value"><field name="reordering_max_qty"/></span>
</div>
</button>
<button class="oe_stat_button" name="action_view_routes" type="object" icon="fa-cogs" attrs="{'invisible':[('type', '=', 'service')]}" groups="stock.group_adv_location" string="Routes"/>
</div>
<data>
<header position="inside">
<button string="Inventory Adjustement"
type="action"
name="%(action_view_change_product_quantity)d"
groups="product.group_product_variant"/>
<button string="Procurement Request"
type="action"
name="%(stock.act_make_procurement)d"
groups="product.group_product_variant"/>
</header>
<div name="button_box" position="inside">
<button class="oe_stat_button"
name="%(product_open_quants)d"
icon="fa-building-o"
type="action" attrs="{'invisible':[('type', '!=', 'service')]}"
groups="stock.group_locations">
<field name="qty_available" widget="statinfo"/>
</button>
<button string="Moves"
type="action"
name= "%(act_product_stock_move_open)d"
attrs="{'invisible':[('type', 'not in', ['product', 'consu'])]}"
class="oe_stat_button" icon="fa-arrows-v"
groups="stock.group_stock_user"/>
<button type="action"
name="%(product_open_orderpoint)d"
attrs="{'invisible':['|',('type', '!=', 'product'),('nbr_reordering_rules', '==', 1)]}"
class="oe_stat_button" icon="fa-refresh">
<field name="nbr_reordering_rules" widget="statinfo"/>
</button>
<button name="%(product_open_orderpoint)d" type="action"
attrs="{'invisible':['|',('type', '!=', ['product', 'consu']),('nbr_reordering_rules', '!=', 1)]}"
class="oe_stat_button" icon="fa-refresh">
<div class="o_form_field o_stat_info mr4">
<span class="o_stat_text">Min :</span>
<span class="o_stat_text">Max:</span>
</div>
<div class="o_form_field o_stat_info">
<span class="o_stat_value"><field name="reordering_min_qty"/></span>
<span class="o_stat_value"><field name="reordering_max_qty"/></span>
</div>
</button>
<button string="Routes" type="object"
name="action_view_routes"
attrs="{'invisible':[('type', '=', 'service')]}"
class="oe_stat_button" icon="fa-cogs" groups="stock.group_adv_location"/>
</div>
</data>
</field>
</record>
@@ -245,31 +251,64 @@
<field name="model">product.template</field>
<field name="inherit_id" ref="product.product_template_only_form_view"/>
<field name="arch" type="xml">
<div name="button_box" position="inside">
<button class="oe_stat_button"
name="action_open_quants"
icon="fa-building-o"
type="object" attrs="{'invisible':[('type', '=', 'service')]}" groups="stock.group_locations">
<field name="qty_available" widget="statinfo"/>
</button>
<button class="oe_stat_button" name= "action_view_stock_moves" type="object" attrs="{'invisible':[('type', '=', 'service')]}" string="Moves" groups="stock.group_stock_user" icon="fa-arrows-v"/>
<button class="oe_stat_button" name="action_view_orderpoints" type="object"
attrs="{'invisible':['|',('type', 'in', ('service','consu')),('nbr_reordering_rules', '==', 1)]}" icon="fa-refresh">
<field name="nbr_reordering_rules" widget="statinfo"/>
</button>
<button class="oe_stat_button" name="action_view_orderpoints" type="object"
attrs="{'invisible':['|',('type', 'in', ('service','consu')),('nbr_reordering_rules', '!=', 1)]}" icon="fa-refresh">
<div class="o_form_field o_stat_info mr4">
<span class="o_stat_text">Min :</span>
<span class="o_stat_text">Max:</span>
<data>
<header position="inside" >
<button name="%(action_view_change_product_quantity)d" string="Inventory Adjustement" type="action"/>
<button string="Procurement Request" name="%(stock.act_make_procurement)d" type="action"/>
</header>
<div name="button_box" position="inside">
<button type="object"
name="%(stock.product_template_open_quants)d"
attrs="{'invisible':[('type', '!=', 'product')]}"
class="oe_stat_button" icon="fa-building-o"
groups="stock.group_locations">
<field name="qty_available" widget="statinfo" string="On Hand"/>
</button>
<button type="action"
name="%(stock.action_stock_level_forecast_report)d"
attrs="{'invisible':[('type', '!=', 'product')]}"
class="oe_stat_button" icon="fa-building-o">
<field name="virtual_available" widget="statinfo" string="Forecasted Qty"/>
</button>
<button string="Traceability" type="object"
name= "action_view_stock_moves"
attrs="{'invisible':[('type', 'not in', ['product', 'consu'])]}"
class="oe_stat_button" icon="fa-arrows-v"
groups="stock.group_stock_user"/>
<button type="object"
name="action_view_orderpoints"
attrs="{'invisible':['|',('type', '!=', 'product'),('nbr_reordering_rules', '==', 1)]}"
class="oe_stat_button"
icon="fa-refresh">
<field name="nbr_reordering_rules" widget="statinfo"/>
</button>
<button type="object"
name="action_view_orderpoints"
attrs="{'invisible':['|',('type', '=', 'product'),('nbr_reordering_rules', '!=', 1)]}"
class="oe_stat_button" icon="fa-refresh">
<div class="o_form_field o_stat_info mr4">
<span class="o_stat_text">Min:</span>
<span class="o_stat_text">Max:</span>
</div>
<div class="o_form_field o_stat_info">
<span class="o_stat_value"><field name="reordering_min_qty"/></span>
<span class="o_stat_value"><field name="reordering_max_qty"/></span>
</div>
</button>
<button string="Routes" type="object"
name="action_view_routes"
attrs="{'invisible':[('type', '!=', ['product', 'consu'])]}"
class="oe_stat_button" icon="fa-cogs"
groups="stock.group_adv_location"/>
</div>
<group name="sale_condition" position="inside">
<label for="sale_delay"/>
<div>
<field name="sale_delay" attrs="{'readonly':[('sale_ok','=',False)]}" class="oe_inline" style="vertical-align:baseline"/> days
</div>
<div class="o_form_field o_stat_info">
<span class="o_stat_value"><field name="reordering_min_qty"/></span>
<span class="o_stat_value"><field name="reordering_max_qty"/></span>
</div>
</button>
<button class="oe_stat_button" name="action_view_routes" type="object" icon="fa-cogs" attrs="{'invisible':[('type', '=', 'service')]}" groups="stock.group_adv_location" string="Routes"/>
</div>
</group>
</data>
</field>
</record>
</data>
@@ -11,6 +11,7 @@ class report_stock_forecast(models.Model):
date = fields.Date(string='Date')
product_id = fields.Many2one('product.product', string='Product', readonly=True)
product_tmpl_id = fields.Many2one('product.template', string='Product', related='product_id.product_tmpl_id', readonly=True)
cumulative_quantity = fields.Float(string='Cumulative Quantity', readonly=True)
quantity = fields.Float(readonly=True)
@@ -29,6 +29,7 @@
<field name="arch" type="xml">
<search string="Stock Level forecast">
<field name="product_id"/>
<field name="product_tmpl_id"/>
<field name="date"/>
<group expand="1" string="Group By">
<filter string="Pivot" name="pivot_by" context="{'pivot_row_groupby': ['product_id'], 'pivot_column_groupby': ['date:week'],'pivot_measures': ['quantity']}"/>
@@ -44,10 +45,8 @@
<field name="view_type">form</field>
<field name="view_mode">pivot,graph</field>
<field name="search_view_id" ref="view_stock_level_forecast_filter"/>
<field name="context">{'search_default_pivot_by':1,'search_default_graph_by':1}</field>
<field name="context">{'search_default_pivot_by':1, 'search_default_graph_by':1, 'search_default_product_tmpl_id': active_id}</field>
<field name="view_id" ref="view_stock_level_forecast_pivot"/>
</record>
<menuitem action="action_stock_level_forecast_report" id="menu_report_product_forecast" parent="menu_warehouse_report" sequence="3" />
</odoo>
+2 -1
View File
@@ -54,7 +54,8 @@
<field name="help">Display the latest Inventories and Moves done on your products and easily sort them with specific filtering criteria. If you do frequent and partial inventories, you need this report in order to ensure that the stock of each product is controlled at least once a year. This also lets you find out which products have seen little move lately and may deserve special measures (discounted sale, quality control...)</field>
</record>
<menuitem parent="menu_warehouse_report" action="action_stock_line_date" id="menu_report_stock_line_date" sequence="2"/>
<menuitem parent="menu_warehouse_report" action="action_stock_line_date" id="menu_report_stock_line_date" sequence="2"
groups="base.group_no_one"/>
</data>
</openerp>
-12
View File
@@ -4535,18 +4535,6 @@ class stock_warehouse_orderpoint(osv.osv):
return False
return True
def action_view_proc_to_process(self, cr, uid, ids, context=None):
act_obj = self.pool.get('ir.actions.act_window')
mod_obj = self.pool.get('ir.model.data')
proc_ids = self.pool.get('procurement.order').search(cr, uid, [('orderpoint_id', 'in', ids), ('state', 'not in', ('done', 'cancel'))], context=context)
result = mod_obj.get_object_reference(cr, uid, 'procurement', 'do_view_procurements')
if not result:
return False
result = act_obj.read(cr, uid, [result[1]], context=context)[0]
result['domain'] = "[('id', 'in', [" + ','.join(map(str, proc_ids)) + "])]"
return result
_columns = {
'name': fields.char('Name', required=True, copy=False),
'active': fields.boolean('Active', help="If the active field is set to False, it will allow you to hide the orderpoint without removing it."),
+37 -34
View File
@@ -28,12 +28,9 @@
<menuitem id="menu_stock_inventory_control" name="Inventory Control" parent="menu_stock_root" sequence="4"/>
<menuitem
action="product.product_normal_action" id="menu_product_variant_config_stock" name="Products"
action="product.product_template_action_product" id="menu_product_variant_config_stock" name="Products"
parent="stock.menu_stock_inventory_control" sequence="1"/>
<menuitem
action="product.product_template_action" id="menu_product_template_config_stock"
parent="stock.menu_product_in_config_stock" sequence="1"/>
<menuitem
action="product.product_category_action_form" id="menu_product_category_config_stock"
parent="stock.menu_product_in_config_stock" sequence="2"/>
@@ -43,7 +40,6 @@
<menuitem
id="menu_stock_unit_measure_stock" name="Units of Measure"
parent="stock.menu_product_in_config_stock" sequence="35" groups="product.group_uom"/>
<record id="stock_inventory_line_tree" model="ir.ui.view">
<field name="name">stock.inventory.line.tree</field>
@@ -474,13 +470,13 @@
<field name="inherit_id" ref="product.product_category_form_view" />
<field name="arch" type="xml">
<xpath expr="//group[@name='parent']" position="inside">
<group string="Logistics" colspan="2">
<group string="Logistics">
<field name="route_ids" widget="many2many_tags"/>
<div class="oe_inline" colspan="2">
<p attrs="{'invisible':[('parent_id','=',False)]}">
The following routes will apply to the products in this category taking into account parent categories:
<field name="total_route_ids" nolabel="1" widget="many2many_tags"/>
The following routes will apply to the products in this category taking into account parent categories:
</p>
<field name="total_route_ids" nolabel="1" widget="many2many_tags"/>
</div>
<field name="removal_strategy_id" options="{'no_create': True}"/>
</group>
@@ -1489,8 +1485,6 @@
<field name="act_window_id" ref="action_move_form2"/>
</record>
<menuitem action="action_move_form2" id="menu_action_move_form2" parent="menu_stock_inventory_control" sequence="118" groups="base.group_no_one"/>
<!--
Receipt Picking (By Stock Move)
From stock_partial_move_view
@@ -1752,6 +1746,14 @@
<!-- Order Point -->
<record id="do_view_procurement_op" model="ir.actions.act_window">
<field name="name">Procurements</field>
<field name="res_model">procurement.order</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
<field name="domain">[('orderpoint_id','=',active_id)]</field>
</record>
<record id="view_warehouse_orderpoint_tree" model="ir.ui.view">
<field name="name">stock.warehouse.orderpoint.tree</field>
<field name="model">stock.warehouse.orderpoint</field>
@@ -1793,7 +1795,7 @@
<form string="Reordering Rules">
<sheet>
<div class="oe_button_box" name="button_box">
<button name="action_view_proc_to_process" type="object" string="Procurement Orders to Process"/>
<button name="%(stock.do_view_procurement_op)d" type="action" string="Procurements" class="oe_stat_button" icon="fa-refresh"/>
</div>
<group>
<group>
@@ -1841,6 +1843,10 @@
</p><p>You can define your minimum stock rules, so that Odoo will automatically create draft manufacturing orders or request for quotations according to the stock level. Once the virtual stock of a product (= stock on hand minus all confirmed orders and reservations) is below the minimum quantity, Odoo will generate a procurement request to increase the stock up to the maximum quantity.</p>
</field>
</record>
<menuitem
id="menu_reordering_rules_config"
action="action_orderpoint_form"
name="Reordering Rules" parent="menu_stock_inventory_control" sequence="2"/>
<act_window
context="{'search_default_warehouse_id': active_id, 'default_warehouse_id': active_id}"
@@ -1956,13 +1962,12 @@
<filter name="positive" string="Positive" domain="[('qty', '&gt;', 0.0)]"/>
</group>
<group expand='0' string='Group by...'>
<filter name="productgroup" string='Product' context="{'group_by' : 'product_id'}"/>
<filter string='Owner' context="{'group_by' : 'owner_id'}" groups="stock.group_tracking_owner"/>
<filter string='Lot' context="{'group_by' : 'lot_id'}" groups="stock.group_production_lot"/>
<filter name="locationgroup" string='Location' domain="[]" context="{'group_by' : 'location_id'}"/>
<filter string='Package' domain="[]" context="{'group_by' : 'package_id'}" groups="stock.group_tracking_lot"/>
<filter string='Packaging' domain="[]" context="{'group_by' : 'packaging_type_id'}" groups="stock.group_tracking_lot"/>
<filter string='Company' domain="[]" context="{'group_by' : 'company_id'}" groups="base.group_multi_company"/>
<filter string='Location' name="locationgroup" domain="[]" context="{'group_by': 'location_id'}"/>
<filter string='Product' name="productgroup" context="{'group_by': 'product_id'}"/>
<filter string='Owner' context="{'group_by': 'owner_id'}" groups="stock.group_tracking_owner"/>
<filter string='Lot' context="{'group_by': 'lot_id'}" groups="stock.group_production_lot"/>
<filter string='Package' domain="[]" context="{'group_by': 'package_id'}" groups="stock.group_tracking_lot"/>
<filter string='Company' domain="[]" context="{'group_by': 'company_id'}" groups="base.group_multi_company"/>
</group>
</search>
</field>
@@ -1977,15 +1982,6 @@
<field name="help">This analysis gives you a fast overview on the current stock level of your products and their current inventory value.</field>
</record>
<record model="ir.actions.act_window" id="action_quantsinv">
<field name="name">Current Inventory</field>
<field name="res_model">stock.quant</field>
<field name="view_type">form</field>
<field name="view_mode">pivot,graph</field>
<field name="context">{'search_default_internal_loc': 1}</field>
<field name="help">This analysis gives you a fast overview on the current stock level of your products and their current inventory value.</field>
</record>
<record model="ir.ui.view" id="view_stock_quant_form">
<field name="name">stock.quant.form</field>
<field name="model">stock.quant</field>
@@ -2065,13 +2061,13 @@
<menuitem action="action_procurement_compute" id="menu_procurement_compute" parent="menu_stock_sched" groups="base.group_no_one" sequence="2"/>
<menuitem action="procurement.action_compute_schedulers" id="menu_stock_proc_schedulers" parent="menu_stock_sched" sequence="1" groups="stock.group_stock_manager"/>
<menuitem id="menu_stock_procurement" name="Automatic Procurements" parent="stock.menu_stock_config_settings" sequence="5"/>
<menuitem id="menu_reordering_rules_config" action="action_orderpoint_form" name="Reordering Rules" parent="menu_stock_config_settings" sequence="3"/>
<menuitem id="stock.menu_warehouse_report" name="Reports" sequence="99" parent="stock.menu_stock_root" groups="group_stock_manager"/>
<menuitem action="procurement.procurement_order_action_exceptions" id="menu_stock_procurement_action" parent="stock.menu_warehouse_report" sequence="50" groups="stock.group_stock_manager"/>
<menuitem id="menu_quants" name="Quantitative Valuation" parent="menu_stock_inventory_control" sequence="120" action="quantsact" groups="base.group_no_one"/>
<menuitem action="procurement.procurement_order_action_exceptions" id="menu_stock_procurement_action" parent="stock.menu_warehouse_report" sequence="150" groups="stock.group_stock_manager"/>
<menuitem action="action_move_form2" id="menu_action_move_form2" parent="stock.menu_warehouse_report" sequence="130"/>
<menuitem id="menu_quants" name="Inventory Valuation" parent="stock.menu_warehouse_report" sequence="120" action="quantsact"/>
<menuitem id="menu_procurement_rules" name="Global Procurement Rules" parent="stock.menu_routes_config" action="procrules" groups="base.group_no_one" sequence="3"/>
<menuitem id="menu_stock_location_path" name="Global Push Rules" parent="stock.menu_routes_config" action="stolocpath" groups="base.group_no_one" sequence="4"/>
<menuitem action="action_quantsinv" id="menu_action_quants_inv" parent="stock.menu_stock_inventory_control" sequence="20"/>
<menuitem id="menu_pickingtype" name="Operations Types" parent="stock.menu_warehouse_config" action="action_picking_type_list" sequence="4" groups="stock.group_locations"/>
<record model="ir.actions.act_window" id="product_open_orderpoint">
<field name="context">{'default_product_id': active_id, 'search_default_product_id': active_id}</field>
@@ -2079,9 +2075,16 @@
<field name="res_model">stock.warehouse.orderpoint</field>
</record>
<record model="ir.actions.act_window" id="product_open_quants">
<field name="context">{'search_default_internal_loc': 1, 'search_default_product_id': active_id, 'search_default_locationgroup':1}</field>
<field name="name">Current Stock</field>
<record model="ir.actions.act_window" id="product_template_open_quants">
<field name="name">Stock On Hand</field>
<field name="context">{'search_default_internal_loc': 1, 'search_default_productgroup':1, 'search_default_locationgroup':1}</field>
<field name="domain">[('product_id.product_tmpl_id', '=', active_id)]</field>
<field name="res_model">stock.quant</field>
</record>
<record model="ir.actions.act_window" id="product_open_quants">
<field name="name">Stock On Hand</field>
<field name="context">{'search_default_internal_loc': 1, 'search_default_locationgroup':1}</field>
<field name="domain">[('product_id', '=', active_id)]</field>
<field name="res_model">stock.quant</field>
</record>
+20 -34
View File
@@ -2,29 +2,27 @@
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from openerp.osv import fields, osv, orm
from openerp.exceptions import UserError
from openerp.tools.translate import _
from openerp.osv import fields, osv
class make_procurement(osv.osv_memory):
_name = 'make.procurement'
_description = 'Make Procurements'
def onchange_product_id(self, cr, uid, ids, prod_id):
""" On Change of Product ID getting the value of related UoM.
@param self: The object pointer.
@param cr: A database cursor
@param uid: ID of the user currently logged in
@param ids: List of IDs selected
@param prod_id: Changed ID of Product
@return: A dictionary which gives the UoM of the changed Product
"""
product = self.pool.get('product.product').browse(cr, uid, prod_id)
return {'value': {'uom_id': product.uom_id.id}}
def onchange_product_id(self, cr, uid, ids, prod_id, context=None):
product = self.pool.get('product.product').browse(cr, uid, prod_id, context=context)
return {'value': {
'uom_id': product.uom_id.id,
'product_tmpl_id': product.product_tmpl_id.id,
'product_variant_count': product.product_tmpl_id.product_variant_count
}}
_columns = {
'qty': fields.float('Quantity', digits=(16,2), required=True),
'product_id': fields.many2one('product.product', 'Product', required=True, readonly=1),
'res_model': fields.char('Res Model'),
'product_id': fields.many2one('product.product', 'Product', required=True),
'product_tmpl_id': fields.many2one('product.template', 'Template', required=True),
'product_variant_count': fields.related('product_tmpl_id', 'product_variant_count', type='integer', string='Variant Number'),
'uom_id': fields.many2one('product.uom', 'Unit of Measure', required=True),
'warehouse_id': fields.many2one('stock.warehouse', 'Warehouse', required=True),
'date_planned': fields.date('Planned Date', required=True),
@@ -37,14 +35,7 @@ class make_procurement(osv.osv_memory):
}
def make_procurement(self, cr, uid, ids, context=None):
""" Creates procurement order for selected product.
@param self: The object pointer.
@param cr: A database cursor
@param uid: ID of the user currently logged in
@param ids: List of IDs selected
@param context: A standard dictionary
@return: A dictionary which loads Procurement form view.
"""
""" Creates procurement order for selected product. """
user = self.pool.get('res.users').browse(cr, uid, uid, context=context).login
wh_obj = self.pool.get('stock.warehouse')
procurement_obj = self.pool.get('procurement.order')
@@ -83,24 +74,14 @@ class make_procurement(osv.osv_memory):
}
def default_get(self, cr, uid, fields, context=None):
""" To get default values for the object.
@param self: The object pointer.
@param cr: A database cursor
@param uid: ID of the user currently logged in
@param fields: List of fields for which we want default values
@param context: A standard dictionary
@return: A dictionary which of fields with values.
"""
if context is None:
context = {}
record_id = context.get('active_id')
if context.get('active_model') == 'product.template':
product_ids = self.pool.get('product.product').search(cr, uid, [('product_tmpl_id', '=', context.get('active_id'))], context=context)
if len(product_ids) == 1:
if product_ids:
record_id = product_ids[0]
else:
raise UserError(_('Please use the Product Variant view to request a procurement.'))
res = super(make_procurement, self).default_get(cr, uid, fields, context=context)
@@ -119,3 +100,8 @@ class make_procurement(osv.osv_memory):
res['warehouse_id'] = warehouse_id[0] if warehouse_id else False
return res
def create(self, cr, uid, values, context=None):
if values.get('product_id'):
values.update(self.onchange_product_id(cr, uid, None, values['product_id'], context=context)['value'])
return super(make_procurement, self).create(cr, uid, values, context=context)
@@ -17,7 +17,12 @@
</p>
<group>
<field name="warehouse_id" groups="stock.group_locations"/>
<field name="product_id" on_change="onchange_product_id(product_id)"/>
<field name="product_tmpl_id" invisible="1"/>
<field name="product_variant_count" invisible="1"/>
<field name="product_id" on_change="onchange_product_id(product_id, context)"
widget="selection"
domain="[('product_tmpl_id', '=', product_tmpl_id)]"
attrs="{'readonly': [('product_variant_count', '=', 1)]}"/>
<label for="qty"/>
<div>
<field name="qty" class="oe_inline"/>
+20 -22
View File
@@ -1,17 +1,21 @@
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from openerp.osv import fields, osv, orm
from openerp.osv import fields, osv
import openerp.addons.decimal_precision as dp
from openerp.tools.translate import _
from openerp import tools
from openerp.exceptions import UserError, AccessError
class stock_change_product_qty(osv.osv_memory):
_name = "stock.change.product.qty"
_description = "Change Product Quantity"
_columns = {
'product_id' : fields.many2one('product.product', 'Product'),
'product_id': fields.many2one('product.product', 'Product', required=True),
'product_tmpl_id': fields.many2one('product.template', 'Template', required=True),
'product_variant_count': fields.related('product_tmpl_id', 'product_variant_count', type='integer', string='Variant Number'),
'new_quantity': fields.float('New Quantity on Hand', digits_compute=dp.get_precision('Product Unit of Measure'), required=True, help='This quantity is expressed in the Default Unit of Measure of the product.'),
'lot_id': fields.many2one('stock.production.lot', 'Serial Number', domain="[('product_id','=',product_id)]"),
'location_id': fields.many2one('stock.location', 'Location', required=True, domain="[('usage', '=', 'internal')]"),
@@ -22,23 +26,12 @@ class stock_change_product_qty(osv.osv_memory):
}
def default_get(self, cr, uid, fields, context):
""" To get default values for the object.
@param self: The object pointer.
@param cr: A database cursor
@param uid: ID of the user currently logged in
@param fields: List of fields for which we want default values
@param context: A standard dictionary
@return: A dictionary which of fields with values.
"""
res = super(stock_change_product_qty, self).default_get(cr, uid, fields, context=context)
if context.get('active_model') == 'product.template':
product_ids = self.pool.get('product.product').search(cr, uid, [('product_tmpl_id', '=', context.get('active_id'))], context=context)
if len(product_ids) == 1:
if product_ids:
res['product_id'] = product_ids[0]
else:
raise UserError(_('Please use the Product Variant view to update the product quantity.'))
if 'location_id' in fields:
location_id = res.get('location_id', False)
@@ -55,15 +48,20 @@ class stock_change_product_qty(osv.osv_memory):
res['location_id'] = location_id
return res
def create(self, cr, uid, values, context=None):
if values.get('product_id'):
values.update(self.onchange_product_id(cr, uid, None, values['product_id'], context=context)['value'])
return super(stock_change_product_qty, self).create(cr, uid, values, context=context)
def onchange_product_id(self, cr, uid, ids, prod_id, context=None):
product = self.pool.get('product.product').browse(cr, uid, prod_id)
return {'value': {
'product_tmpl_id': product.product_tmpl_id.id,
'product_variant_count': product.product_tmpl_id.product_variant_count
}}
def change_product_qty(self, cr, uid, ids, context=None):
""" Changes the Product Quantity by making a Physical Inventory.
@param self: The object pointer.
@param cr: A database cursor
@param uid: ID of the user currently logged in
@param ids: List of IDs selected
@param context: A standard dictionary
@return:
"""
""" Changes the Product Quantity by making a Physical Inventory. """
if context is None:
context = {}
@@ -7,7 +7,12 @@
<field name="arch" type="xml">
<form string="Update Product Quantity">
<group>
<field name="product_id" invisible="1"/>
<field name="product_tmpl_id" invisible="1"/>
<field name="product_variant_count" invisible="1"/>
<field name="product_id" on_change="onchange_product_id(product_id, context)"
widget="selection"
domain="[('product_tmpl_id', '=', product_tmpl_id)]"
attrs="{'readonly': [('product_variant_count', '=', 1)]}"/>
<field name="location_id" groups="stock.group_locations" on_change="onchange_location_id(location_id, product_id, context)"/>
<field name="new_quantity"/>
<field name="lot_id" context="{'search_default_product_id':product_id,'default_product_id':product_id}" groups="stock.group_production_lot"/>
+76 -13
View File
@@ -11,17 +11,43 @@ class product_template(osv.osv):
_name = 'product.template'
_inherit = 'product.template'
def _get_cost_method(self, cr, uid, ids, field, args, context=None):
res = {}
for product in self.browse(cr, uid, ids, context=context):
if product.property_cost_method:
res[product.id] = product.property_cost_method
else:
res[product.id] = product.categ_id.property_cost_method
return res
def _get_valuation_type(self, cr, uid, ids, field, args, context=None):
res = {}
for product in self.browse(cr, uid, ids, context=context):
if product.property_valuation:
res[product.id] = product.property_valuation
else:
res[product.id] = product.categ_id.property_valuation
return res
def _set_cost_method(self, cr, uid, ids, name, value, arg, context=None):
return self.write(cr, uid, ids, {'property_cost_method': value}, context=context)
def _set_valuation_type(self, cr, uid, ids, name, value, arg, context=None):
return self.write(cr, uid, ids, {'property_valuation': value}, context=context)
_columns = {
'valuation': fields.property(type='selection', selection=[('manual_periodic', 'Periodic (manual)'),
'property_valuation': fields.property(type='selection', selection=[('manual_periodic', 'Periodic (manual)'),
('real_time', 'Perpetual (automated)')], string='Inventory Valuation',
help="If perpetual valuation is enabled for a product, the system will automatically create journal entries corresponding to stock moves, with product price as specified by the 'Costing Method'" \
"The inventory variation account set on the product category will represent the current inventory value, and the stock input and stock output account will hold the counterpart moves for incoming and outgoing products."
, required=True, copy=True),
'cost_method': fields.property(type='selection', selection=[('standard', 'Standard Price'), ('average', 'Average Price'), ('real', 'Real Price')],
, copy=True),
'valuation': fields.function(_get_valuation_type, fnct_inv=_set_valuation_type, type='char'), # TDE FIXME: store it ?
'property_cost_method': fields.property(type='selection', selection=[('standard', 'Standard Price'), ('average', 'Average Price'), ('real', 'Real Price')],
help="""Standard Price: The cost price is manually updated at the end of a specific period (usually once a year).
Average Price: The cost price is recomputed at each incoming shipment and used for the product valuation.
Real Price: The cost price displayed is the price of the last outgoing product (will be use in case of inventory loss for example).""",
string="Costing Method", required=True, copy=True),
string="Costing Method", copy=True),
'cost_method': fields.function(_get_cost_method, fnct_inv=_set_cost_method, type='char'), # TDE FIXME: store it ?
'property_stock_account_input': fields.property(
type='many2one',
relation='account.account',
@@ -39,13 +65,21 @@ class product_template(osv.osv):
}
_defaults = {
'valuation': 'manual_periodic',
'property_valuation': 'manual_periodic',
}
def onchange_type(self, cr, uid, ids, type):
res = super(product_template, self).onchange_type(cr, uid, ids, type)
if type in ('consu', 'service'):
res = {'value': {'valuation': 'manual_periodic'}}
def create(self, cr, uid, vals, context=None):
if vals.get('cost_method'):
vals['property_cost_method'] = vals.pop('cost_method')
if vals.get('valuation'):
vals['property_valuation'] = vals.pop('valuation')
return super(product_template, self).create(cr, uid, vals, context=context)
def onchange_type(self, cr, uid, ids, type, context=None):
res = super(product_template, self).onchange_type(cr, uid, ids, type, context=context)
if type != 'product':
value = res.setdefault('value', dict())
value['property_valuation'] = 'manual_periodic'
return res
@api.multi
@@ -130,14 +164,43 @@ class product_template(osv.osv):
class product_product(osv.osv):
_inherit = 'product.product'
def onchange_type(self, cr, uid, ids, type):
res = super(product_product, self).onchange_type(cr, uid, ids, type)
if type not in ['product']:
res = {'value': {'valuation': 'manual_periodic'}}
def onchange_type(self, cr, uid, ids, type, context=None):
res = super(product_product, self).onchange_type(cr, uid, ids, type, context=context)
if type != 'product':
value = res.setdefault('value', dict())
value['property_valuation'] = 'manual_periodic'
return res
class product_category(osv.osv):
_inherit = 'product.category'
_columns = {
'property_valuation': fields.property(
type='selection',
selection=[('manual_periodic', 'Periodic (manual)'),
('real_time', 'Perpetual (automated)')],
string='Inventory Valuation',
required=True, copy=True,
help="If perpetual valuation is enabled for a product, the system "
"will automatically create journal entries corresponding to "
"stock moves, with product price as specified by the 'Costing "
"Method'. The inventory variation account set on the product "
"category will represent the current inventory value, and the "
"stock input and stock output account will hold the counterpart "
"moves for incoming and outgoing products."),
'property_cost_method': fields.property(
type='selection',
selection=[('standard', 'Standard Price'),
('average', 'Average Price'),
('real', 'Real Price')],
string="Costing Method",
required=True, copy=True,
help="Standard Price: The cost price is manually updated at the end "
"of a specific period (usually once a year).\nAverage Price: "
"The cost price is recomputed at each incoming shipment and "
"used for the product valuation.\nReal Price: The cost price "
"displayed is the price of the last outgoing product (will be "
"used in case of inventory loss for example)."""),
'property_stock_journal': fields.property(
relation='account.journal',
type='many2one',
+31 -23
View File
@@ -8,13 +8,17 @@
<field name="inherit_id" ref="account.view_category_property_form"/>
<field name="arch" type="xml">
<data>
<group name="account_property" position="after">
<group name="account_stock_property" string="Account Stock Properties" colspan="2">
<group name="parent" position="inside">
<group name="account_stock_property" string="Account Stock Properties">
<field name="property_stock_account_input_categ_id" domain="[('deprecated', '=', False)]"/>
<field name="property_stock_account_output_categ_id" domain="[('deprecated', '=', False)]"/>
<field name="property_stock_valuation_account_id" domain="[('deprecated', '=', False)]"/>
<field name="property_stock_journal"/>
</group>
<group string="Inventory Valuation">
<field name="property_cost_method" groups="stock_account.group_inventory_valuation" />
<field name="property_valuation"/>
</group>
</group>
</data>
</field>
@@ -25,34 +29,38 @@
<field name="model">product.template</field>
<field name="inherit_id" ref="product.product_template_form_view"/>
<field name="arch" type="xml">
<xpath expr="//group[@name='standard_price']" position="replace">
<field name="cost_method" groups="stock_account.group_inventory_valuation" attrs="{'invisible': [('type','=','service')]}"/>
<label string="Cost Price" for="standard_price" align="1.0" groups="base.group_user" attrs="{'invisible':[('product_variant_count','>',1)]}"/>
<div groups="base.group_user" attrs="{'invisible':[('product_variant_count','>',1)]}">
<field name="standard_price" attrs="{'readonly':['&amp;', ('valuation','=','real_time'), ('cost_method', 'in', ['standard', 'average'])]}" class="oe_inline" nolabel="1"/>
<data>
<field name="list_price" position="after">
<field name="valuation" invisible="1"/>
<field name="cost_method" invisible="1"/>
<field name="property_cost_method" groups="stock_account.group_inventory_valuation" invisible="1"/>
</field>
<field name="standard_price" position="replace">
<field name="standard_price" attrs="{'readonly':['&amp;', ('valuation','=','real_time'), ('cost_method', 'in', ['standard', 'average'])]}" class="oe_inline"/>
</field>
<field name="currency_id" position="after">
<label string="/" class="oe_inline" groups="product.group_uom"/>
<field name="uom_rel_id" class="oe_inline" groups="product.group_uom"/>
<button name="%(action_view_change_standard_price)d" string="- update"
type="action" attrs="{'invisible':['|', ('valuation','!=', 'real_time'), ('cost_method', 'not in', ['standard', 'average'])]}"
class="oe_link" groups="stock_account.group_inventory_valuation"/>
</field>
<div name="standard_price_uom" position="after">
<button string="Compute from average price" type="action"
name="%(action_view_change_standard_price)d"
attrs="{'invisible':['|',('valuation','!=', 'real_time'), ('cost_method', 'not in', ['standard', 'average'])]}"
class="oe_link oe_read_only" colspan="2"
groups="stock_account.group_inventory_valuation"/>
</div>
</xpath>
<xpath expr="//group[@name='properties']" position="before">
<group groups="stock_account.group_inventory_valuation" attrs="{'invisible': [('type','=','service')]}">
<separator string="Inventory Valuation" attrs="{'invisible':[('type', 'in', ('service', 'consu'))]}" colspan="4"/>
<group colspan="2" col="2">
<field name="valuation" attrs="{'invisible':[('type', 'in', ('service', 'consu'))]}"/>
</group>
<group colspan="2" col="2">
<field name="property_stock_account_input" attrs="{'invisible':[('valuation', '!=', 'real_time')]}"
<group name="accounting" position="inside">
<group name="property_inventory_valuation" groups="stock_account.group_inventory_valuation" attrs="{'invisible': [('type','=','service')]}">
<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')]}"
<field name="property_stock_account_output"
attrs="{'invisible':[ ('valuation', '!=', 'real_time')]}"
domain="[('deprecated', '=', False)]"/>
</group>
</group>
<newline/>
</xpath>
</data>
</field>
</record>
</data>
+16 -3
View File
@@ -4,13 +4,26 @@
<record forcecreate="True" id="default_cost_method" model="ir.property">
<field name="name">Cost Method Property</field>
<field name="fields_id" search="[('model', '=', 'product.template'), ('name', '=', 'cost_method')]"/>
<field name="value">standard</field>
<field name="fields_id" ref="field_product_template_property_cost_method"/>
<field name="value" eval="False" />
<field name="type">selection</field>
</record>
<record forcecreate="True" id="default_valuation" model="ir.property">
<field name="name">Valuation Property</field>
<field name="fields_id" search="[('model', '=', 'product.template'), ('name', '=', 'valuation')]"/>
<field name="fields_id" ref="field_product_template_property_valuation"/>
<field name="value" eval="False" />
<field name="type">selection</field>
</record>
<record forcecreate="True" id="default_category_cost_method" model="ir.property">
<field name="name">Cost Method Property</field>
<field name="fields_id" ref="field_product_category_property_cost_method"/>
<field name="value">standard</field>
<field name="type">selection</field>
</record>
<record forcecreate="True" id="default_category_valuation" model="ir.property">
<field name="name">Valuation Property</field>
<field name="fields_id" ref="field_product_category_property_valuation"/>
<field name="value">manual_periodic</field>
<field name="type">selection</field>
</record>
+6 -13
View File
@@ -7,19 +7,12 @@
<field name="model">product.template</field>
<field name="inherit_id" ref="product.product_template_form_view"/>
<field name="arch" type="xml">
<div name="options" position="inside">
<div>
<field name="landed_cost_ok"/>
<label for="landed_cost_ok"/>
</div>
</div>
<group name="properties" position="before">
<group attrs="{'invisible':[('landed_cost_ok','=',False)]}">
<group colspan="2" col="2">
<field name="split_method"/>
</group>
</group>
</group>
<group name="accounting" position="inside">
<group>
<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>
</group>
</field>
</record>
+12 -14
View File
@@ -43,20 +43,18 @@
<field name="model">product.template</field>
<field name="inherit_id" ref="product.product_template_form_view"/>
<field name="arch" type="xml">
<notebook position="inside">
<page string="Warnings">
<group string="Warning when Selling this Product">
<field name="sale_line_warn"/>
<field name="sale_line_warn_msg"
attrs="{'required':[('sale_line_warn','!=','no-message')],'readonly':[('sale_line_warn','=','no-message')]}"/>
</group>
<group string="Warning when Purchasing this Product">
<field name="purchase_line_warn"/>
<field name="purchase_line_warn_msg"
attrs="{'required':[('purchase_line_warn','!=','no-message')],'readonly':[('purchase_line_warn','=','no-message')]}"/>
</group>
</page>
</notebook>
<group name="description" position="after">
<group string="Warning when Selling this Product" colspan="2">
<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 string="Warning when Purchasing this Product" colspan="2">
<field name="purchase_line_warn" nolabel="1"/>
<field name="purchase_line_warn_msg" colspan="3" nolabel="1"
attrs="{'required':[('purchase_line_warn','!=','no-message')],'readonly':[('purchase_line_warn','=','no-message')]}"/>
</group>
</group>
</field>
</record>
+7 -8
View File
@@ -19,14 +19,13 @@
<field name="inherit_id" ref="product.product_template_form_view"/>
<field name="arch" type="xml">
<!-- add state field in header -->
<group name="website_and_pos" position="inside">
<group name="website" string="Website">
<group name="email_template_and_project" position="before">
<group name="website" string="Website" >
<field name="website_url" invisible="1"/>
<field name="public_categ_ids" widget="many2many_tags"/>
<field name="public_categ_ids" widget="many2many_tags" string="Website Categories"/>
<field name="alternative_product_ids" widget="many2many_tags"/>
<field name="accessory_product_ids" widget="many2many_tags"/>
<field name="website_style_ids" widget="many2many_tags"/>
<field name="website_sequence"/>
<field name="website_style_ids" widget="many2many_tags" groups="base.group_no_one"/>
</group>
</group>
<div name="button_box" position="inside">
@@ -40,10 +39,10 @@
<!-- Product attribute -->
<record id="variants_template_tree_view" model="ir.ui.view">
<field name="name">variants.template.tree</field>
<record id="product_attribute_value_view_tree_inherit_website_sale" model="ir.ui.view">
<field name="name">product.attribute.value.view.tree.inherit.website.sale</field>
<field name="model">product.attribute.value</field>
<field name="inherit_id" ref="product.variants_template_tree_view"/>
<field name="inherit_id" ref="product.product_attribute_value_view_tree"/>
<field name="arch" type="xml">
<field name="name" position="after">
<field name="color"/>
@@ -14,16 +14,4 @@
</field>
</record>
<record model="ir.ui.view" id="product_product_view_inherit_digital">
<field name="name">product.product.view.inherit.digital</field>
<field name="model">product.product</field>
<field name="inherit_id" ref="product.product_normal_form_view" />
<field name="arch" type="xml">
<xpath expr="//group[@name='weight']" position="attributes">
<attribute name="invisible">[('type', 'in', ['service', 'digital'])]</attribute>
</xpath>
</field>
</record>
</odoo>