[ADD] Added sequence on Stock Landed Cost and added Landed Cost type Configuration view and improved product view
bzr revid: mka@tinyerp.com-20140425104945-1vfv217uy1xhbnmx
This commit is contained in:
parent
f402240ade
commit
440ddae7f8
|
@ -38,6 +38,7 @@
|
||||||
],
|
],
|
||||||
'data': [
|
'data': [
|
||||||
'security/ir.model.access.csv',
|
'security/ir.model.access.csv',
|
||||||
|
'stock_landed_costs_sequence.xml',
|
||||||
'product_view.xml',
|
'product_view.xml',
|
||||||
'stock_landed_costs_view.xml',
|
'stock_landed_costs_view.xml',
|
||||||
'stock_landed_costs_data.xml',
|
'stock_landed_costs_data.xml',
|
||||||
|
|
|
@ -12,8 +12,7 @@
|
||||||
<label for="landed_cost_ok"/>
|
<label for="landed_cost_ok"/>
|
||||||
</div>
|
</div>
|
||||||
<xpath expr="//group[@name='properties']" position="before">
|
<xpath expr="//group[@name='properties']" position="before">
|
||||||
<group>
|
<group attrs="{'invisible':[('landed_cost_ok','=',False)]}">
|
||||||
<separator string="Split Method" colspan="4"/>
|
|
||||||
<group colspan="2" col="2">
|
<group colspan="2" col="2">
|
||||||
<field name="split_method"/>
|
<field name="split_method"/>
|
||||||
</group>
|
</group>
|
||||||
|
|
|
@ -82,7 +82,7 @@ class stock_landed_cost(osv.osv):
|
||||||
return {'value': result}
|
return {'value': result}
|
||||||
|
|
||||||
_columns = {
|
_columns = {
|
||||||
'name': fields.char('Name', size=256, required=True, states={'done': [('readonly', True)]}, track_visibility='always'),
|
'name': fields.char('Name', size=256, track_visibility='always', readonly=True),
|
||||||
'date': fields.date('Date', required=True, states={'done': [('readonly', True)]}, track_visibility='onchange'),
|
'date': fields.date('Date', required=True, states={'done': [('readonly', True)]}, track_visibility='onchange'),
|
||||||
'picking_ids': fields.many2many('stock.picking', string='Pickings', states={'done': [('readonly', True)]}),
|
'picking_ids': fields.many2many('stock.picking', string='Pickings', states={'done': [('readonly', True)]}),
|
||||||
'cost_lines': fields.one2many('stock.landed.cost.lines', 'cost_id', 'Cost Lines', states={'done': [('readonly', True)]}),
|
'cost_lines': fields.one2many('stock.landed.cost.lines', 'cost_id', 'Cost Lines', states={'done': [('readonly', True)]}),
|
||||||
|
@ -100,6 +100,7 @@ class stock_landed_cost(osv.osv):
|
||||||
}
|
}
|
||||||
|
|
||||||
_defaults = {
|
_defaults = {
|
||||||
|
'name': lambda obj, cr, uid, context: obj.pool.get('ir.sequence').get(cr, uid, 'stock.landed.cost'),
|
||||||
'state': 'draft',
|
'state': 'draft',
|
||||||
'date': fields.date.context_today,
|
'date': fields.date.context_today,
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,16 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<openerp>
|
||||||
|
<data noupdate="1">
|
||||||
|
<record id="seq_type_stock_landed_costs" model="ir.sequence.type">
|
||||||
|
<field name="name">Stock Landed Costs</field>
|
||||||
|
<field name="code">stock.landed.cost</field>
|
||||||
|
</record>
|
||||||
|
<record id="seq_stock_landed_costs" model="ir.sequence">
|
||||||
|
<field name="name">Stock Landed Costs</field>
|
||||||
|
<field name="code">stock.landed.cost</field>
|
||||||
|
<field name="prefix">LC/%(year)s/</field>
|
||||||
|
<field name="padding">4</field>
|
||||||
|
</record>
|
||||||
|
</data>
|
||||||
|
</openerp>
|
||||||
|
|
|
@ -158,5 +158,144 @@
|
||||||
<menuitem name="Landed Costs" parent="stock.menu_stock_root" id="menu_stock_landed_cost_main" sequence="1"/>
|
<menuitem name="Landed Costs" parent="stock.menu_stock_root" id="menu_stock_landed_cost_main" sequence="1"/>
|
||||||
<menuitem action="action_stock_landed_cost" name="Landed Costs" parent="menu_stock_landed_cost_main" id="menu_stock_landed_cost" sequence="1"/>
|
<menuitem action="action_stock_landed_cost" name="Landed Costs" parent="menu_stock_landed_cost_main" id="menu_stock_landed_cost" sequence="1"/>
|
||||||
|
|
||||||
|
<!-- Stock Landed Cost Type View -->
|
||||||
|
<record id="view_stock_landed_cost_type_form" model="ir.ui.view">
|
||||||
|
<field name="name">stock.landed.cost.type.form</field>
|
||||||
|
<field name="model">product.product</field>
|
||||||
|
<field name="arch" type="xml">
|
||||||
|
<form string="Landed Costs" version="7.0">
|
||||||
|
<sheet>
|
||||||
|
<field name="is_only_child" invisible="1"/>
|
||||||
|
<field name="image_medium" widget="image" class="oe_avatar oe_left"
|
||||||
|
attrs="{'readonly': [('is_only_child', '=', False)]}"/>
|
||||||
|
<div class="oe_title">
|
||||||
|
<div class="oe_edit_only">
|
||||||
|
<label for="name" name='label_name' string="Product Name"
|
||||||
|
attrs="{'invisible': [('is_only_child', '=', False)]}"/>
|
||||||
|
<label for="name" name='label_name' string="Product Template"
|
||||||
|
attrs="{'invisible': [('is_only_child', '=', True)]}"/>
|
||||||
|
</div>
|
||||||
|
<h1>
|
||||||
|
<field name="name" class="oe_inline"
|
||||||
|
attrs="{'required': [('is_only_child', '=', True)],
|
||||||
|
'invisible': [('is_only_child', '=', False)]}"/>
|
||||||
|
<field name="product_tmpl_id" class="oe_inline" readonly="1" required="0"
|
||||||
|
attrs="{'invisible': [('is_only_child', '=', True)]}"/>
|
||||||
|
<span groups="product.group_product_variant"
|
||||||
|
attrs="{'invisible': [('is_only_child', '=', True), ('variants', '=', False)]}">
|
||||||
|
- <field name="variants" placeholder="Variant Name" class="oe_inline"/>
|
||||||
|
</span>
|
||||||
|
</h1>
|
||||||
|
<span attrs="{'invisible': [('is_only_child', '=', True)]}">
|
||||||
|
<p>Generic product settings are managed on
|
||||||
|
<button name="open_product_template" type="object" string="the template" class="oe_link"/>
|
||||||
|
</p>
|
||||||
|
</span>
|
||||||
|
<label for="categ_id" class="oe_edit_only"/>
|
||||||
|
<h2><field name="categ_id" attrs="{'readonly': [('is_only_child', '=', False)]}"/></h2>
|
||||||
|
<label for="public_categ_id" class="oe_edit_only"/>
|
||||||
|
<h3><field name="public_categ_id" attrs="{'readonly': [('is_only_child', '=', False)]}"/></h3>
|
||||||
|
<div name="options" groups="base.group_user">
|
||||||
|
<field name="sale_ok"/>
|
||||||
|
<label for="sale_ok"/>
|
||||||
|
<field name="landed_cost_ok"/>
|
||||||
|
<label for="landed_cost_ok"/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="oe_right oe_button_box" name="buttons">
|
||||||
|
</div>
|
||||||
|
<notebook>
|
||||||
|
<page string="Information">
|
||||||
|
<group>
|
||||||
|
<group>
|
||||||
|
<field name="uom_po_id" invisible="1"/>
|
||||||
|
<field name="type"
|
||||||
|
attrs="{'invisible': [('is_only_child', '=', False)]}"/>
|
||||||
|
<field name="uom_id" on_change="onchange_uom(uom_id,uom_po_id)" groups="product.group_uom"
|
||||||
|
attrs="{'invisible': [('is_only_child', '=', False)]}"/>
|
||||||
|
<field name="lst_price" string="Public Sale Price"
|
||||||
|
attrs="{'readonly': [('is_only_child', '=', False)]}"/>
|
||||||
|
<field name="price_extra"
|
||||||
|
attrs="{'invisible': [('is_only_child', '=', True)]}"/>
|
||||||
|
<field name="split_method" attrs="{'invisible':[('landed_cost_ok','=',False)]}"/>
|
||||||
|
|
||||||
|
</group>
|
||||||
|
<group>
|
||||||
|
<field name="default_code"/>
|
||||||
|
<label for="ean13"/>
|
||||||
|
<div name="ean">
|
||||||
|
<field name="ean13" placeholder="e.g. 5901234123457"/>
|
||||||
|
</div>
|
||||||
|
<field name="company_id" groups="base.group_multi_company" widget="selection"
|
||||||
|
attrs="{'invisible': [('is_only_child', '=', False)]}"/>
|
||||||
|
<field name="active" />
|
||||||
|
|
||||||
|
</group>
|
||||||
|
</group>
|
||||||
|
<group colspan="2" col="4">
|
||||||
|
<field name="taxes_id" widget="many2many_tags"/>
|
||||||
|
<field name="supplier_taxes_id" widget="many2many_tags"/>
|
||||||
|
</group>
|
||||||
|
<field name="description" placeholder="describe the product characteristics..."
|
||||||
|
attrs="{'readonly': [('is_only_child', '=', False)]}"/>
|
||||||
|
</page>
|
||||||
|
</notebook>
|
||||||
|
</sheet>
|
||||||
|
<div class="oe_chatter">
|
||||||
|
<field name="message_follower_ids" widget="mail_followers"/>
|
||||||
|
<field name="message_ids" widget="mail_thread"/>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
</field>
|
||||||
|
</record>
|
||||||
|
|
||||||
|
<!-- Stock Landed Cost Type Tree View -->
|
||||||
|
<record id="stock_landed_cost_tree_view" model="ir.ui.view">
|
||||||
|
<field name="name">product.product.tree</field>
|
||||||
|
<field name="model">product.product</field>
|
||||||
|
<field name="arch" type="xml">
|
||||||
|
<tree string="Products">
|
||||||
|
<field name="default_code"/>
|
||||||
|
<field name="name"/>
|
||||||
|
<field name="split_method"/>
|
||||||
|
<field name="lst_price"/>
|
||||||
|
</tree>
|
||||||
|
</field>
|
||||||
|
</record>
|
||||||
|
<record id="stock_landed_cost_type_action" model="ir.actions.act_window">
|
||||||
|
<field name="name">Products</field>
|
||||||
|
<field name="type">ir.actions.act_window</field>
|
||||||
|
<field name="res_model">product.product</field>
|
||||||
|
<field name="domain">[('landed_cost_ok','=',True)]</field>
|
||||||
|
<field name="view_type">form</field>
|
||||||
|
<field name="view_mode">tree,form</field>
|
||||||
|
<field name="context">{'default_landed_cost_ok': True}</field>
|
||||||
|
<field name="search_view_id" ref="product.product_search_form_view"/>
|
||||||
|
<field name="help" type="html">
|
||||||
|
<p class="oe_view_nocontent_create">
|
||||||
|
Click to define a new product.
|
||||||
|
</p><p>
|
||||||
|
You must define a product for everything you buy or sell,
|
||||||
|
whether it's a physical product, a consumable or service.
|
||||||
|
</p>
|
||||||
|
</field>
|
||||||
|
</record>
|
||||||
|
|
||||||
|
<record id="stock_landed_cost_type_action1" model="ir.actions.act_window.view">
|
||||||
|
<field eval="1" name="sequence"/>
|
||||||
|
<field name="view_mode">tree</field>
|
||||||
|
<field name="view_id" ref="stock_landed_cost_tree_view"/>
|
||||||
|
<field name="act_window_id" ref="stock_landed_cost_type_action"/>
|
||||||
|
</record>
|
||||||
|
|
||||||
|
<record id="stock_landed_cost_type_action2" model="ir.actions.act_window.view">
|
||||||
|
<field eval="2" name="sequence"/>
|
||||||
|
<field name="view_mode">form</field>
|
||||||
|
<field name="view_id" ref="view_stock_landed_cost_type_form"/>
|
||||||
|
<field name="act_window_id" ref="stock_landed_cost_type_action"/>
|
||||||
|
</record>
|
||||||
|
|
||||||
|
<menuitem action="stock_landed_cost_type_action" name="Landed Cost Type" parent="stock.menu_stock_configuration" id="menu_stock_landed_cost_type" sequence="1"/>
|
||||||
|
|
||||||
</data>
|
</data>
|
||||||
</openerp>
|
</openerp>
|
||||||
|
|
Loading…
Reference in New Issue