[MERGE] merged jco's feature branch clearing the packages and logistic units concepts
bzr revid: qdp-launchpad@openerp.com-20140404131637-a23gqw42132q6ig5
This commit is contained in:
commit
4254056188
|
@ -214,10 +214,14 @@ class product_uom(osv.osv):
|
|||
|
||||
class product_ul(osv.osv):
|
||||
_name = "product.ul"
|
||||
_description = "Shipping Unit"
|
||||
_description = "Logistic Unit"
|
||||
_columns = {
|
||||
'name' : fields.char('Name', select=True, required=True, translate=True),
|
||||
'type' : fields.selection([('unit','Unit'),('pack','Pack'),('box', 'Box'), ('pallet', 'Pallet')], 'Type', required=True),
|
||||
'height': fields.float('Height', help='The height of the package'),
|
||||
'width': fields.float('Width', help='The width of the package'),
|
||||
'length': fields.float('Length', help='The length of the package'),
|
||||
'weight': fields.float('Empty Package Weight'),
|
||||
}
|
||||
|
||||
|
||||
|
@ -724,7 +728,7 @@ class product_product(osv.osv):
|
|||
'is_only_child': fields.function(
|
||||
_is_only_child, type='boolean', string='Sole child of the parent template'),
|
||||
'ean13': fields.char('EAN13 Barcode', size=13, help="International Article Number used for product identification."),
|
||||
'packaging': fields.one2many('product.packaging', 'product_id', 'Logistical Units', help="Gives the different ways to package the same product. This has no impact on the picking order and is mainly used if you use the EDI module."),
|
||||
'packaging': fields.one2many('product.packaging', 'product_id', 'Packaging', help="Gives the different ways to package the same product. This has no impact on the picking order and is mainly used if you use the EDI module."),
|
||||
'price_extra': fields.float('Variant Price Extra', digits_compute=dp.get_precision('Product Price'), help="Price Extra: Extra price for the variant on sale price. eg. 200 price extra, 1000 + 200 = 1200."),
|
||||
'price_margin': fields.float('Variant Price Margin', digits_compute=dp.get_precision('Product Price'), help="Price Margin: Margin in percentage amount on sale price for the variant. eg. 10 price margin, 1000 * 1.1 = 1100."),
|
||||
'pricelist_id': fields.dummy(string='Pricelist', relation='product.pricelist', type='many2one'),
|
||||
|
@ -937,8 +941,9 @@ class product_packaging(osv.osv):
|
|||
'name' : fields.text('Description'),
|
||||
'qty' : fields.float('Quantity by Package',
|
||||
help="The total number of products you can put by pallet or box."),
|
||||
'ul' : fields.many2one('product.ul', 'Type of Package', required=True),
|
||||
'ul' : fields.many2one('product.ul', 'Package Logistic Unit', required=True),
|
||||
'ul_qty' : fields.integer('Package by layer', help='The number of packages by layer'),
|
||||
'ul_container': fields.many2one('product.ul', 'Pallet Logistic Unit'),
|
||||
'rows' : fields.integer('Number of Layers', required=True,
|
||||
help='The number of layers on a pallet or box'),
|
||||
'product_id' : fields.many2one('product.product', 'Product', select=1, ondelete='cascade', required=True),
|
||||
|
@ -946,13 +951,8 @@ class product_packaging(osv.osv):
|
|||
'code' : fields.char('Code', help="The code of the transport unit."),
|
||||
'weight': fields.float('Total Package Weight',
|
||||
help='The weight of a full package, pallet or box.'),
|
||||
'weight_ul': fields.float('Empty Package Weight'),
|
||||
'height': fields.float('Height', help='The height of the package'),
|
||||
'width': fields.float('Width', help='The width of the package'),
|
||||
'length': fields.float('Length', help='The length of the package'),
|
||||
}
|
||||
|
||||
|
||||
def _check_ean_key(self, cr, uid, ids, context=None):
|
||||
for pack in self.browse(cr, uid, ids, context=context):
|
||||
res = check_ean(pack.ean)
|
||||
|
|
|
@ -171,8 +171,8 @@
|
|||
attrs="{'readonly': [('is_only_child', '=', False)]}"/>
|
||||
</group>
|
||||
</group>
|
||||
<field name="packaging" groups="product.group_stock_packaging"
|
||||
attrs="{'readonly': [('is_only_child', '=', False)]}">
|
||||
<separator string="Packages" groups="product.group_stock_packaging"/>
|
||||
<field name="packaging" groups="product.group_stock_packaging" attrs="{'readonly': [('is_only_child', '=', False)]}">
|
||||
<form string="Packaging" version="7.0">
|
||||
<group col="4">
|
||||
<field name="ean"/>
|
||||
|
@ -180,15 +180,11 @@
|
|||
<newline/>
|
||||
<field name="qty"/>
|
||||
<field name="ul"/>
|
||||
<field name="weight_ul"/>
|
||||
<separator colspan="4" string="Palletization"/>
|
||||
<field name="ul_qty"/>
|
||||
<field name="ul_container" domain="[('type', '=', 'pallet')]" context="{'default_type': 'pallet'}"/>
|
||||
<field name="rows"/>
|
||||
<field name="weight"/>
|
||||
<separator colspan="4" string="Pallet Dimension"/>
|
||||
<field name="height"/>
|
||||
<field name="width"/>
|
||||
<field name="length"/>
|
||||
</group>
|
||||
<separator colspan="4" string="Description"/>
|
||||
<field name="name"/>
|
||||
|
@ -579,11 +575,17 @@
|
|||
<field name="name">product.ul.form.view</field>
|
||||
<field name="model">product.ul</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Packaging" version="7.0">
|
||||
<form string="Logistic Units" version="7.0">
|
||||
<group>
|
||||
<field name="name"/>
|
||||
<field name="type"/>
|
||||
</group>
|
||||
<group>
|
||||
<field name="height"/>
|
||||
<field name="width"/>
|
||||
<field name="length"/>
|
||||
<field name="weight"/>
|
||||
</group>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
@ -591,25 +593,25 @@
|
|||
<field name="name">product.ul.tree</field>
|
||||
<field name="model">product.ul</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="Packaging">
|
||||
<tree string="Logistic Units">
|
||||
<field name="name"/>
|
||||
<field name="type"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
<record id="product_ul_form_action" model="ir.actions.act_window">
|
||||
<field name="name">Packaging</field>
|
||||
<field name="name">Logistic Units</field>
|
||||
<field name="type">ir.actions.act_window</field>
|
||||
<field name="res_model">product.ul</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
<field name="help" type="html">
|
||||
<p class="oe_view_nocontent_create">
|
||||
Click to add a new packaging type.
|
||||
Click to add a new Logistic Unit
|
||||
</p><p>
|
||||
The packaging type define the dimensions as well as the number
|
||||
of products per package. This will ensure salesperson sell the
|
||||
right number of products according to the package selected.
|
||||
The logistic unit defines the container used for the package.
|
||||
It has a type (e.g. pallet, box, ...) and you can specify its
|
||||
size.
|
||||
</p>
|
||||
</field>
|
||||
</record>
|
||||
|
@ -625,6 +627,7 @@
|
|||
<field name="ean"/>
|
||||
<field name="qty"/>
|
||||
<field name="ul"/>
|
||||
<field name="ul_container"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
|
@ -642,15 +645,11 @@
|
|||
<newline/>
|
||||
<field name="qty"/>
|
||||
<field name="ul"/>
|
||||
<field name="weight_ul"/>
|
||||
<separator colspan="4" string="Palletization"/>
|
||||
<field name="ul_qty"/>
|
||||
<field name="rows"/>
|
||||
<field name="ul_container"/>
|
||||
<field name="weight"/>
|
||||
<separator colspan="4" string="Pallet Dimension"/>
|
||||
<field name="height"/>
|
||||
<field name="width"/>
|
||||
<field name="length"/>
|
||||
<separator colspan="4" string="Other Info"/>
|
||||
<field colspan="4" name="name"/>
|
||||
</group>
|
||||
|
|
|
@ -19,6 +19,7 @@
|
|||
<field name="categ_id" search="[]" model="product.category"/>
|
||||
<field name="image" type="base64" file="product_expiry/static/img/product_product_jambon-image.jpg"/>
|
||||
</record>
|
||||
|
||||
<record id="product_package_jambon" model="product.packaging">
|
||||
<field name="name">box of 10</field>
|
||||
<field name="qty">12</field>
|
||||
|
@ -28,7 +29,6 @@
|
|||
<field name="product_id" ref="product_product_jambon" />
|
||||
<field name="ean"></field>
|
||||
<field name="weight">10</field>
|
||||
<field name="weight_ul">240</field>
|
||||
</record>
|
||||
|
||||
<record id="product_product_from" model="product.product">
|
||||
|
@ -57,7 +57,6 @@
|
|||
<field name="product_id" ref="product_product_from" />
|
||||
<field name="ean"></field>
|
||||
<field name="weight">10</field>
|
||||
<field name="weight_ul">240</field>
|
||||
</record>
|
||||
|
||||
<record id="product_product_pain" model="product.product">
|
||||
|
@ -86,7 +85,6 @@
|
|||
<field name="product_id" ref="product_product_pain" />
|
||||
<field name="ean"></field>
|
||||
<field name="weight">10</field>
|
||||
<field name="weight_ul">240</field>
|
||||
</record>
|
||||
|
||||
<record id="product_product_lait" model="product.product">
|
||||
|
@ -115,7 +113,6 @@
|
|||
<field name="product_id" ref="product_product_lait" />
|
||||
<field name="ean"></field>
|
||||
<field name="weight">10</field>
|
||||
<field name="weight_ul">240</field>
|
||||
</record>
|
||||
</data>
|
||||
</openerp>
|
||||
|
|
|
@ -3506,7 +3506,8 @@ class stock_package(osv.osv):
|
|||
'complete_name': fields.function(_complete_name, type='char', string="Package Name",),
|
||||
'parent_left': fields.integer('Left Parent', select=1),
|
||||
'parent_right': fields.integer('Right Parent', select=1),
|
||||
'packaging_id': fields.many2one('product.packaging', 'Type of Packaging'),
|
||||
'packaging_id': fields.many2one('product.packaging', 'Packaging', help="This field should be completed only if everything inside the package share the same product, otherwise it doesn't really makes sense."),
|
||||
'ul_id': fields.many2one('product.ul', 'Logistic Unit'),
|
||||
'location_id': fields.function(_get_package_info, type='many2one', relation='stock.location', string='Location', multi="package",
|
||||
store={
|
||||
'stock.quant': (_get_packages, ['location_id'], 10),
|
||||
|
|
|
@ -1716,8 +1716,8 @@
|
|||
<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' icon="terp-stock_symbol-selection" domain="[]" context="{'group_by' : 'location_id'}"/>
|
||||
<filter string='Packaging' icon="terp-stock_symbol-selection" domain="[]" context="{'group_by' : 'package_id'}" groups="stock.group_tracking_lot"/>
|
||||
<filter string='Packaging Type' icon="terp-stock_symbol-selection" domain="[]" context="{'group_by' : 'packaging_type_id'}" groups="stock.group_tracking_lot"/>
|
||||
<filter string='Package' icon="terp-stock_symbol-selection" domain="[]" context="{'group_by' : 'package_id'}" groups="stock.group_tracking_lot"/>
|
||||
<filter string='Packaging' icon="terp-stock_symbol-selection" domain="[]" context="{'group_by' : 'packaging_type_id'}" groups="stock.group_tracking_lot"/>
|
||||
<filter string='Company' icon="terp-go-home" domain="[]" context="{'group_by' : 'company_id'}" groups="base.group_multi_company"/>
|
||||
</group>
|
||||
</search>
|
||||
|
@ -1933,7 +1933,8 @@
|
|||
</div>
|
||||
<group>
|
||||
<group>
|
||||
<field name="packaging_id"/>
|
||||
<field name="ul_id"/>
|
||||
<field name="packaging_id"/>
|
||||
<field name='company_id' groups="base.group_multi_company"/>
|
||||
<field name='owner_id' groups="stock.group_tracking_owner"/>
|
||||
</group>
|
||||
|
@ -1941,7 +1942,6 @@
|
|||
<field name="location_id"/>
|
||||
<field name="parent_id"/>
|
||||
</group>
|
||||
|
||||
</group>
|
||||
<notebook>
|
||||
<page string="Content">
|
||||
|
@ -1962,6 +1962,7 @@
|
|||
<field name="children_ids">
|
||||
<tree string="Contained Packages">
|
||||
<field name="complete_name"/>
|
||||
<field name="ul_id"/>
|
||||
<field name="packaging_id"/>
|
||||
<field name="location_id"/>
|
||||
</tree>
|
||||
|
@ -1969,7 +1970,6 @@
|
|||
</page>
|
||||
</notebook>
|
||||
</sheet>
|
||||
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
@ -1982,6 +1982,7 @@
|
|||
<field name="arch" type="xml">
|
||||
<tree string="Package">
|
||||
<field name="complete_name"/>
|
||||
<field name="ul_id"/>
|
||||
<field name="packaging_id"/>
|
||||
<field name="location_id"/>
|
||||
<field name="company_id"/>
|
||||
|
@ -1991,11 +1992,12 @@
|
|||
<record id="quant_package_search_view" model="ir.ui.view">
|
||||
<field name="name">stock.quant.package.search</field>
|
||||
<field name="model">stock.quant.package</field>
|
||||
<field eval="10" name="priority"/>
|
||||
<field eval="10" name="priority"/>
|
||||
<field name="arch" type="xml">
|
||||
<search string="Package">
|
||||
<field name="name" string="Package Name"/>
|
||||
<field name="location_id"/>
|
||||
<field name="ul_id"/>
|
||||
<field name="packaging_id"/>
|
||||
<group expand='0' string='Group by...'>
|
||||
<filter string='Location' icon="terp-stock_symbol-selection" domain="[]" context="{'group_by' : 'location_id'}"/>
|
||||
|
|
Loading…
Reference in New Issue