[IMP] Update views and production_delay and track_production should go to product_template
This commit is contained in:
parent
2dfd5e70a8
commit
bdda11ab40
|
@ -561,10 +561,10 @@
|
|||
</field>
|
||||
</record>
|
||||
|
||||
<record id="view_mrp_product_form_inherited" model="ir.ui.view">
|
||||
<record id="view_mrp_product_template_form_inherited" model="ir.ui.view">
|
||||
<field name="name">product.form.mrp.inherited</field>
|
||||
<field name="model">product.product</field>
|
||||
<field name="inherit_id" ref="stock.product_form_view_procurement_button"/>
|
||||
<field name="model">product.template</field>
|
||||
<field name="inherit_id" ref="stock.view_template_property_form"/>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//group[@name='lot']" position="inside">
|
||||
<field name="track_production" groups="stock.group_production_lot" attrs="{'invisible': [('track_all', '=', True)]}"/>
|
||||
|
|
|
@ -41,10 +41,17 @@ class product_template(osv.osv):
|
|||
return res
|
||||
|
||||
_columns = {
|
||||
"bom_ids": fields.one2many('mrp.bom', 'product_tmpl_id','Bill of Materials'),
|
||||
'produce_delay': fields.float('Manufacturing Lead Time', help="Average delay in days to produce this product. In the case of multi-level BOM, the manufacturing lead times of the components will be added."),
|
||||
'track_production': fields.boolean('Track Manufacturing Lots', help="Forces to specify a Serial Number for all moves containing this product and generated by a Manufacturing Order"),
|
||||
'bom_ids': fields.one2many('mrp.bom', 'product_tmpl_id','Bill of Materials'),
|
||||
'bom_count': fields.function(_bom_orders_count, string='# Bill of Material', type='integer', multi="_bom_order_count"),
|
||||
'mo_count': fields.function(_bom_orders_count_mo, string='# Manufacturing Orders', type='integer'),
|
||||
}
|
||||
|
||||
_defaults = {
|
||||
"produce_delay": 1,
|
||||
}
|
||||
|
||||
def copy(self, cr, uid, id, default=None, context=None):
|
||||
if not default:
|
||||
default = {}
|
||||
|
@ -63,15 +70,8 @@ class product_product(osv.osv):
|
|||
return res
|
||||
|
||||
_columns = {
|
||||
"produce_delay": fields.float('Manufacturing Lead Time', help="Average delay in days to produce this product. In the case of multi-level BOM, the manufacturing lead times of the components will be added."),
|
||||
'track_production': fields.boolean('Track Manufacturing Lots', help="Forces to specify a Serial Number for all moves containing this product and generated by a Manufacturing Order"),
|
||||
'mo_count': fields.function(_bom_orders_count, string='# Manufacturing Orders', type='integer'),
|
||||
}
|
||||
|
||||
_defaults = {
|
||||
"produce_delay": 1,
|
||||
}
|
||||
|
||||
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
|
|
@ -1465,9 +1465,5 @@ class account_invoice_line(osv.Model):
|
|||
readonly=True),
|
||||
}
|
||||
|
||||
class product_template(osv.osv):
|
||||
_inherit = "product.template"
|
||||
|
||||
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
|
|
@ -111,6 +111,13 @@
|
|||
<field name="loc_case"/>
|
||||
</group>
|
||||
</group>
|
||||
<group name="status" position="before">
|
||||
<group name="lot" groups="stock.group_production_lot" string="Lots">
|
||||
<field name="track_all" groups="stock.group_production_lot"/>
|
||||
<field name="track_incoming" groups="stock.group_production_lot" attrs="{'invisible': [('track_all', '=', True)]}"/>
|
||||
<field name="track_outgoing" groups="stock.group_production_lot" attrs="{'invisible': [('track_all', '=', True)]}"/>
|
||||
</group>
|
||||
</group>
|
||||
<group name="weight" position="before">
|
||||
<group name="store" groups="stock.group_locations" string="Counter-Part Locations Properties">
|
||||
<field name="property_stock_procurement" attrs="{'readonly':[('type','=','service')]}" domain="[('usage','=','procurement')]"/>
|
||||
|
@ -192,13 +199,6 @@
|
|||
<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">
|
||||
<group name="lot" groups="stock.group_production_lot" string="Lots">
|
||||
<field name="track_all" groups="stock.group_production_lot"/>
|
||||
<field name="track_incoming" groups="stock.group_production_lot" attrs="{'invisible': [('track_all', '=', True)]}"/>
|
||||
<field name="track_outgoing" groups="stock.group_production_lot" attrs="{'invisible': [('track_all', '=', True)]}"/>
|
||||
</group>
|
||||
</group>
|
||||
<xpath expr="//div[@name='buttons']" position="inside">
|
||||
<button class="oe_stat_button"
|
||||
name="%(product_open_quants)d"
|
||||
|
|
|
@ -722,33 +722,6 @@
|
|||
<notebook>
|
||||
<page string="Products">
|
||||
<separator string="Stock Moves" attrs="{'invisible': [('pack_operation_exist', '=', False)]}"/>
|
||||
<!--
|
||||
<field name="move_lines" context="{'address_in_id': partner_id, 'form_view_ref':'stock.view_move_picking_form', 'tree_view_ref':'stock.view_move_picking_tree', 'default_picking_type_id': picking_type_id,'default_picking_id': active_id}"/>
|
||||
<group>
|
||||
<group col="3">
|
||||
<separator string="Quantities Done" attrs="{'invisible': [('pack_operation_exist', '=', False)]}"/>
|
||||
</group>
|
||||
<group col="1">
|
||||
<field name="pack_operation_exist" invisible="1"/>
|
||||
<button name="action_pack" string="Create Package" type="object" attrs="{'invisible': ['|',('pack_operation_exist', '=', False),('state', 'not in', ('draft','assigned','partially_available','confirmed'))]}" class="oe_link oe_right oe_inline" groups="product.group_stock_packaging"/>
|
||||
<button name="do_split" string="Create Draft Backorder" groups="base.group_no_one" type="object" attrs="{'invisible': ['|',('pack_operation_exist', '=', False),('state','not in',('assigned', 'partially_available'))]}" class="oe_link oe_right oe_inline"/>
|
||||
<button name="recheck_availability" string="Recheck Availability" type="object" attrs="{'invisible': ['|',('pack_operation_exist', '=', False),('state','not in',('assigned', 'partially_available'))]}" groups="stock.group_stock_user" class="oe_link oe_right oe_inline"/>
|
||||
</group>
|
||||
</group>
|
||||
<field name="pack_operation_ids" attrs="{'invisible': [('pack_operation_exist', '=', False)]}" context="{'default_owner_id': owner_id, 'default_location_id': location_id, 'default_location_dest_id': location_dest_id}">
|
||||
<tree editable="top">
|
||||
<field name="location_id"/>
|
||||
<field name="product_id" on_change='product_id_change(product_id, product_uom_id, product_qty, context)'/>
|
||||
<field name="product_uom_id" groups="product.group_uom" on_change='on_change_tests(product_id, product_uom_id, product_qty, context)'/>
|
||||
<field name="lot_id" domain="[('product_id','=?', product_id)]" context="{'product_id': product_id}" groups="stock.group_production_lot"/>
|
||||
<field name="package_id" groups="stock.group_tracking_lot"/>
|
||||
<field name="owner_id" groups="stock.group_tracking_owner"/>
|
||||
<field name="product_qty" attrs="{'required': [('product_id', '!=', False)]}" on_change='on_change_tests(product_id, product_uom_id, product_qty, context)'/>
|
||||
<field name="location_dest_id"/>
|
||||
<field name="result_package_id" groups="stock.group_tracking_lot"/>
|
||||
</tree>
|
||||
</field>
|
||||
-->
|
||||
<field name="move_lines" context="{'address_in_id': partner_id, 'form_view_ref':'stock.view_move_picking_form', 'tree_view_ref':'stock.view_move_picking_tree', 'default_picking_type_id': picking_type_id,'default_picking_id': active_id}"/>
|
||||
<field name="pack_operation_exist" invisible="1"/>
|
||||
<field name="note" placeholder="Add an internal note..." class="oe_inline"/>
|
||||
|
|
Loading…
Reference in New Issue