[IMP]Product: sale_delay, loc_rack, loc_row, loc_case fields move from product to stock and purchase_ok field move from product to purchase and related views and data updated

bzr revid: mma@tinyerp.com-20121003064840-0zsgb6ntp4yfc46z
This commit is contained in:
Mayur Maheshwari (OpenERP) 2012-10-03 12:18:40 +05:30
parent b6254d631a
commit 8306d9226e
12 changed files with 124 additions and 78 deletions

View File

@ -14,8 +14,8 @@
<field name="taxes_id" colspan="2" attrs="{'readonly':[('sale_ok','=',0)]}" widget="many2many_tags"/>
</group>
<group>
<field name="property_account_expense" domain="[('type','&lt;&gt;','view'),('type','&lt;&gt;','consolidation')]" attrs="{'readonly':[('purchase_ok','=',0)]}"/>
<field name="supplier_taxes_id" colspan="2" attrs="{'readonly':[('purchase_ok','=',0)]}" widget="many2many_tags"/>
<field name="property_account_expense" domain="[('type','&lt;&gt;','view'),('type','&lt;&gt;','consolidation')]" />
<field name="supplier_taxes_id" colspan="2" widget="many2many_tags"/>
</group>
</group>
</page>

View File

@ -6,10 +6,10 @@
<field name="model">product.product</field>
<field name="inherit_id" ref="product.product_normal_form_view" />
<field name="arch" type="xml">
<field name="purchase_ok" position="before">
<div name="options" position="inside">
<field name="event_ok" on_change="onchange_event_ok(event_ok, context)"/>
<label for="event_ok"/>
</field>
</div>
<field name='default_code' position='before'>
<field name="event_type_id" attrs="{'readonly': [('event_ok', '=', False)]}"/>
</field>

View File

@ -195,10 +195,10 @@
<field name="model">product.product</field>
<field name="inherit_id" ref="product.product_normal_form_view"/>
<field name="arch" type="xml">
<field name="purchase_ok" position="before">
<div name="options" position="inside">
<field name="hr_expense_ok" on_change="on_change_hr_expense_ok(hr_expense_ok)"/>
<label for="hr_expense_ok"/>
</field>
</div>
</field>
</record>

View File

@ -282,7 +282,6 @@ class product_template(osv.osv):
'description_sale': fields.text('Sale Description',translate=True),
'type': fields.selection([('product','Stockable Product'),('consu', 'Consumable'),('service','Service')], 'Product Type', required=True, help="Will change the way procurements are processed. Consumable are product where you don't manage stock."),
'supply_method': fields.selection([('produce','Manufacture'),('buy','Buy')], 'Supply Method', required=True, help="Produce will generate production order or tasks, according to the product type. Buy will trigger purchase orders when requested."),
'sale_delay': fields.float('Customer Lead Time', help="This is the average delay in days between the confirmation of the customer order and the delivery of the finished products. It's the time you promise to your customers."),
'produce_delay': fields.float('Manufacturing Lead Time', help="Average delay in days to produce this product. This is only for the production order and, if it is a multi-level bill of material, it's only for the level of this product. Different lead times will be summed for all levels and purchase orders."),
'procure_method': fields.selection([('make_to_stock','Make to Stock'),('make_to_order','Make to Order')], 'Procurement Method', required=True, help="'Make to Stock': When needed, take from the stock or wait until re-supplying. 'Make to Order': When needed, purchase or produce for the procurement request."),
'rental': fields.boolean('Can be Rent'),
@ -296,7 +295,6 @@ class product_template(osv.osv):
help="Standard Price: the cost price is fixed and recomputed periodically (usually at the end of the year), Average Price: the cost price is recomputed at each reception of products."),
'warranty': fields.float('Warranty'),
'sale_ok': fields.boolean('Can be Sold', help="Determines if the product can be visible in the list of product within a selection from a sale order line."),
'purchase_ok': fields.boolean('Can be Purchased', help="Determine if the product is visible in the list of products within a selection from a purchase order line."),
'state': fields.selection([('',''),
('draft', 'In Development'),
('sellable','Normal'),
@ -311,9 +309,6 @@ class product_template(osv.osv):
' uos = uom * coeff'),
'mes_type': fields.selection((('fixed', 'Fixed'), ('variable', 'Variable')), 'Measure Type', required=True),
'seller_ids': fields.one2many('product.supplierinfo', 'product_id', 'Partners'),
'loc_rack': fields.char('Rack', size=16),
'loc_row': fields.char('Row', size=16),
'loc_case': fields.char('Case', size=16),
'company_id': fields.many2one('res.company', 'Company', select=1),
}
@ -356,9 +351,7 @@ class product_template(osv.osv):
'supply_method': lambda *a: 'buy',
'standard_price': lambda *a: 0.0,
'sale_ok': lambda *a: 1,
'sale_delay': lambda *a: 7,
'produce_delay': lambda *a: 1,
'purchase_ok': lambda *a: 1,
'procure_method': lambda *a: 'make_to_stock',
'uom_id': _get_uom_id,
'uom_po_id': _get_uom_id,

View File

@ -197,7 +197,6 @@ parameter) will see those record just disappear.
<field name="name">Service</field>
<field name="categ_id" ref="product.product_category_all"/>
<field name="type">service</field>
<field eval="False" name="purchase_ok"/>
</record>
</data>
</openerp>

View File

@ -12,9 +12,7 @@
<filter string="Services" icon="terp-accessories-archiver" domain="[('type','=','service')]"/>
<filter string="Products" icon="terp-accessories-archiver" domain="['|',('type','=','product'),('type','=','consu')]" help="Both stockable and consumable products"/>
<separator/>
<filter name="filter_to_purchase" string="To Purchase" icon="terp-accessories-archiver+" domain="[('purchase_ok', '=', 1)]"/>
<filter string="Can be Sold" name="filter_to_sell" icon="terp-accessories-archiver-minus" domain="[('sale_ok','=',1)]"/>
<filter name="filter_to_purchase" string="Can be Purchased" icon="terp-accessories-archiver+" domain="[('purchase_ok', '=', 1)]"/>
<field name="categ_id" operator="child_of"/>
<group expand="0" string="Context...">
<field name="pricelist_id" context="{'pricelist': self}" groups="product.group_sale_pricelist"/>
@ -73,8 +71,6 @@
<div name="options" groups="base.group_user">
<field name="sale_ok"/>
<label for="sale_ok"/>
<field name="purchase_ok"/>
<label for="purchase_ok"/>
</div>
</div>
<div class="oe_right oe_button_box" name="buttons">
@ -144,13 +140,7 @@
<field name="state"/>
<field name="product_manager"/>
</group>
<group name="store" string="Storage Localisation">
<field name="company_id" groups="base.group_multi_company" widget="selection"/>
<field name="loc_rack" attrs="{'invisible':[('type','=','service')]}"/>
<field name="loc_row" attrs="{'invisible':[('type','=','service')]}"/>
<field name="loc_case" attrs="{'invisible':[('type','=','service')]}"/>
</group>
<group groups="product.group_stock_packaging" string="Weights">
<group name="Weights" groups="product.group_stock_packaging" string="Weights">
<field digits="(14, 3)" name="volume" attrs="{'readonly':[('type','=','service')]}"/>
<field name="weight" attrs="{'readonly':[('type','=','service')]}"/>
<field name="weight_net" attrs="{'readonly':[('type','=','service')]}"/>
@ -160,10 +150,6 @@
<page string="Sales" attrs="{'readonly':[('sale_ok','=',0)]}">
<group name="sale">
<group string="Sale Conditions">
<label for="sale_delay"/>
<div>
<field name="sale_delay" class="oe_inline"/> days
</div>
<label for="warranty"/>
<div>
<field name="warranty" class="oe_inline"/> months
@ -715,7 +701,6 @@
<group>
<group string="Product Type">
<field name="sale_ok"/>
<field name="purchase_ok"/>
</group>
<group string="Procurement">
<field name="type"/>
@ -728,19 +713,11 @@
<field name="standard_price" attrs="{'readonly':[('cost_method','=','average')]}"/>
<field name="cost_method"/>
</group>
<group string="Weights">
<field digits="(14, 3)" name="volume" attrs="{'readonly':[('type','=','service')]}"/>
<field digits="(14, 3)" name="weight" attrs="{'readonly':[('type','=','service')]}"/>
<field digits="(14, 3)" name="weight_net" attrs="{'readonly':[('type','=','service')]}"/>
</group>
<group name="status" string="Status">
<field name="categ_id"/>
<field name="state"/>
<field name="product_manager"/>
</group>
</group>
<group name="uom" string="Unit of Measure">
<field name="uom_id" on_change="onchange_uom(uom_id,uom_po_id)" groups="product.group_uom"/>
<field name="uom_po_id"/>
@ -756,18 +733,12 @@
<page string="Procurement &amp; Locations">
<group>
<group name="delay" string="Delays">
<field name="sale_delay" attrs="{'readonly':[('sale_ok','=',0)]}"/>
<label for="produce_delay"/>
<div>
<field name="produce_delay" class="oe_inline"/> days
</div>
<field name="warranty"/>
</group>
<group name="store" string="Storage Localisation">
<field name="loc_rack"/>
<field name="loc_row"/>
<field name="loc_case"/>
</group>
</group>
</page>

View File

@ -19,9 +19,9 @@
<record model="ir.ui.view" id="view_product_form_expiry">
<field name="name">product.normal.form</field>
<field name="model">product.product</field>
<field name="inherit_id" ref="product.product_normal_form_view" />
<field name="inherit_id" ref="stock.view_normal_procurement_locations_form" />
<field name="arch" type="xml">
<group name="inventory">
<group name="Weights" position="after">
<group string="Dates">
<field name="life_time" />
<field name="use_time" />

View File

@ -1106,4 +1106,16 @@ class mail_mail(osv.osv):
return super(mail_mail, self)._postprocess_sent_message(cr, uid, mail=mail, context=context)
mail_mail()
class product_template(osv.osv):
_name = 'product.template'
_inherit = 'product.template'
_columns = {
'purchase_ok': fields.boolean('Can be Purchased', help="Determine if the product is visible in the list of products within a selection from a purchase order line."),
}
_defaults = {
'purchase_ok': lambda *a: 1,
}
product_template()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -14,6 +14,9 @@
<field eval="80.0" name="schedule_range"/>
</record>
<record id="product.product_product_consultant" model="product.product">
<field eval="False" name="purchase_ok"/>
</record>
</data>
</openerp>

View File

@ -589,6 +589,10 @@
<field name="model">product.product</field>
<field name="inherit_id" ref="product.product_normal_form_view"/>
<field name="arch" type="xml">
<div name="options" position="inside">
<field name="purchase_ok"/>
<label for="purchase_ok"/>
</div>
<group name="procurement" position="after">
<separator string="Suppliers"/>
<field name="seller_ids" context="{'uom_id': uom_id}"/>
@ -609,5 +613,45 @@
</group>
</field>
</record>
<record id="product_search_form_view_purchase" model="ir.ui.view">
<field name="name">product.search.stock.form</field>
<field name="model">product.product</field>
<field name="inherit_id" ref="product.product_search_form_view"/>
<field name="arch" type="xml">
<filter name="filter_to_sell" position="before">
<filter name="filter_to_purchase" string="To Purchase" icon="terp-accessories-archiver+" domain="[('purchase_ok', '=', 1)]"/>
</filter>
<filter name="filter_to_sell" position="after">
<filter name="filter_to_purchase" string="Can be Purchased" icon="terp-accessories-archiver+" domain="[('purchase_ok', '=', 1)]"/>
</filter>
</field>
</record>
<record id="view_template_purchase_ok_form" model="ir.ui.view">
<field name="name">product.template.purchase.ok.form.inherit</field>
<field name="model">product.template</field>
<field name="inherit_id" ref="product.product_template_form_view"/>
<field name="arch" type="xml">
<field name="sale_ok" position="after">
<field name="purchase_ok"/>
</field>
</field>
</record>
<record id="view_product_account_purchase_ok_form" model="ir.ui.view">
<field name="name">product.account.purchase.ok.form.inherit</field>
<field name="model">product.product</field>
<field name="inherit_id" ref="account.product_normal_form_view"/>
<field name="arch" type="xml">
<field name="property_account_expense" position="replace" >
<field name="property_account_expense" domain="[('type','&lt;&gt;','view'),('type','&lt;&gt;','consolidation')]" attrs="{'readonly':[('purchase_ok','=',0)]}" />
</field>
<field name="supplier_taxes_id" position="replace" >
<field name="supplier_taxes_id" colspan="2" widget="many2many_tags" attrs="{'readonly':[('purchase_ok','=',0)]}"/>
</field>
</field>
</record>
</data>
</openerp>

View File

@ -513,8 +513,15 @@ class product_template(osv.osv):
string='Stock Output Account', view_load=True,
help="When doing real-time inventory valuation, counterpart journal items for all outgoing stock moves will be posted in this account, unless "
"there is a specific valuation account set on the destination location. When not set on the product, the one from the product category is used."),
'sale_delay': fields.float('Customer Lead Time', help="This is the average delay in days between the confirmation of the customer order and the delivery of the finished products. It's the time you promise to your customers."),
'loc_rack': fields.char('Rack', size=16),
'loc_row': fields.char('Row', size=16),
'loc_case': fields.char('Case', size=16),
}
_defaults = {
'sale_delay': lambda *a: 7,
}
product_template()
class product_category(osv.osv):

View File

@ -35,6 +35,16 @@
<field name="model">product.template</field>
<field name="inherit_id" ref="product.product_template_form_view"/>
<field name="arch" type="xml">
<group name="delay" position="inside">
<field name="sale_delay" attrs="{'readonly':[('sale_ok','=',False)]}"/>
</group>
<group name="delay" position="after">
<group name="store" string="Storage Localisation">
<field name="loc_rack"/>
<field name="loc_row"/>
<field name="loc_case"/>
</group>
</group>
<page position="after" string="Information">
<page string="Properties">
<group string="Counter-Part Locations Properties" groups="stock.group_locations">
@ -65,12 +75,45 @@
<field name="active"/>
</group>
</group>
<group name="inventory" position="inside">
<group name="store" groups="stock.group_locations" string="Counter-Part Locations Properties">
<field name="property_stock_procurement" attrs="{'readonly':[('type','=','service')]}" domain="[('usage','=','procurement')]"/>
<field name="property_stock_production" attrs="{'readonly':[('type','=','service')]}" domain="[('usage','=','production')]"/>
<field name="property_stock_inventory" attrs="{'readonly':[('type','=','service')]}" domain="[('usage','=','inventory')]"/>
<xpath expr="//group[@string='Sale Conditions']" position="inside">
<label for="sale_delay"/>
<div>
<field name="sale_delay" class="oe_inline"/> days
</div>
</xpath>
<group name="status" position="before" version="7.0">
<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>
<field name="incoming_qty" class="oe_inline"/>
<field name="outgoing_qty" class="oe_inline"/>
<field name="virtual_available" class="oe_inline"/>
</group>
<group name="lot" groups="stock.group_tracking_lot,stock.group_production_lot" string="Lots">
<field name="track_production" groups="stock.group_production_lot"/>
<field name="track_incoming" groups="stock.group_tracking_lot"/>
<field name="track_outgoing" groups="stock.group_tracking_lot"/>
</group>
</group>
<group name="status" position="after" version="7.0">
<group name="store" string="Storage Localisation">
<field name="company_id" groups="base.group_multi_company" widget="selection"/>
<field name="loc_rack" attrs="{'invisible':[('type','=','service')]}"/>
<field name="loc_row" attrs="{'invisible':[('type','=','service')]}"/>
<field name="loc_case" attrs="{'invisible':[('type','=','service')]}"/>
</group>
</group>
<group name="Weights" position="after">
<group name="store" groups="stock.group_locations" string="Counter-Part Locations Properties">
<field name="property_stock_procurement" attrs="{'readonly':[('type','=','service')]}" domain="[('usage','=','procurement')]"/>
<field name="property_stock_production" attrs="{'readonly':[('type','=','service')]}" domain="[('usage','=','production')]"/>
<field name="property_stock_inventory" attrs="{'readonly':[('type','=','service')]}" domain="[('usage','=','inventory')]"/>
</group>
</group>
</field>
</record>
@ -116,32 +159,6 @@
</field>
</record>
<record id="view_normal_stock_property_form" model="ir.ui.view">
<field name="name">product.normal.stock.form.inherit</field>
<field name="model">product.product</field>
<field name="inherit_id" ref="product.product_normal_form_view"/>
<field name="arch" type="xml">
<group name="status" position="before" version="7.0">
<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>
<field name="incoming_qty" class="oe_inline"/>
<field name="outgoing_qty" class="oe_inline"/>
<field name="virtual_available" class="oe_inline"/>
</group>
<group name="lot" groups="stock.group_tracking_lot,stock.group_production_lot" string="Lots">
<field name="track_production" groups="stock.group_production_lot"/>
<field name="track_incoming" groups="stock.group_tracking_lot"/>
<field name="track_outgoing" groups="stock.group_tracking_lot"/>
</group>
</group>
</field>
</record>
<record id="action_receive_move" model="ir.actions.act_window">
<field name="name">Receptions</field>