Skip to content
Permalink
Browse files

[IMP] stock and mrp : Usability improvements

	- Removed "Assembly station 1" from everywhere and replaced it with "Assemmbly Line 1". Renamed "Assembly station 2" to "Assembly Line 2".
	- Operations field on BOM will be hidden when advanced routes are not active.
	- Hide sequence field in form view in BOM and added a widget handle in list view.
	- Hide field "Manufacturing readiness" in MO when WO aren't active.
	- Added a domain in PLM in Lot/Serial Numbers to show only variants of the product.
	- Removed red and green colors from Traceability Report.
	- Renamed "Cost" to "Value" on products.
	- Changed tooltip of "weight for shipping" in shipping information in inventory.
This commit is related to task id: 1943397
  • Loading branch information...
hdh-odoo committed Feb 27, 2019
1 parent 9ea4fef commit 946e654c19aefb9647ec841eadbca51079c68d94
@@ -82,7 +82,7 @@ def _compute_weight_uom_name(self):
weight_uom_name = fields.Char(string='Weight unit of measure label', compute='_compute_weight_uom_name', readonly=True, default=_get_default_weight_uom)
package_ids = fields.Many2many('stock.quant.package', compute='_compute_packages', string='Packages')
weight_bulk = fields.Float('Bulk Weight', compute='_compute_bulk_weight')
shipping_weight = fields.Float("Weight for Shipping", compute='_compute_shipping_weight', help="Total weight of the packages and products which are not in a package. That's the weight used to compute the cost of the shipping.")
shipping_weight = fields.Float("Weight for Shipping", compute='_compute_shipping_weight', help="Total weight of products, packages included. Weight used to compute the cost of the shipping.")
is_return_picking = fields.Boolean(compute='_compute_return_picking')
return_label_ids = fields.One2many('ir.attachment', compute='_compute_return_label')

@@ -13,15 +13,6 @@

<!-- Resource: mrp.workcenter -->

<record id="mrp_workcenter_0" model="mrp.workcenter">
<field name="name">Assembly Station 1</field>
<field name="resource_calendar_id" ref="resource.resource_calendar_std"/>
<field name="capacity">5</field>
<field name="time_start">10</field>
<field name="time_stop">8</field>
<field name="time_efficiency">87</field>
</record>

<record id="mrp_workcenter_3" model="mrp.workcenter">
<field name="name">Assembly Line 1</field>
<field name="resource_calendar_id" ref="resource.resource_calendar_std"/>
@@ -33,7 +24,7 @@
</record>

<record id="mrp_workcenter_2" model="mrp.workcenter">
<field name="name">Assemble Station 2</field>
<field name="name">Assembly Line 2</field>
<field name="resource_calendar_id" ref="resource.resource_calendar_std"/>
</record>

@@ -62,7 +53,7 @@

<record id="mrp_routing_workcenter_0" model="mrp.routing.workcenter">
<field name="routing_id" ref="mrp_routing_0"/>
<field name="workcenter_id" ref="mrp_workcenter_0"/>
<field name="workcenter_id" ref="mrp_workcenter_3"/>
<field name="name">Manual Assembly</field>
<field name="time_cycle">60</field>
<field name="sequence">5</field>
@@ -71,7 +62,7 @@

<record id="mrp_routing_workcenter_1" model="mrp.routing.workcenter">
<field name="routing_id" ref="mrp_routing_1"/>
<field name="workcenter_id" ref="mrp_workcenter_0"/>
<field name="workcenter_id" ref="mrp_workcenter_3"/>
<field name="name">Long time assembly</field>
<field name="time_cycle">180</field>
<field name="sequence">15</field>
@@ -80,7 +71,7 @@

<record id="mrp_routing_workcenter_3" model="mrp.routing.workcenter">
<field name="routing_id" ref="mrp_routing_1"/>
<field name="workcenter_id" ref="mrp_workcenter_0"/>
<field name="workcenter_id" ref="mrp_workcenter_3"/>
<field name="name">Testing</field>
<field name="time_cycle">60</field>
<field name="sequence">10</field>
@@ -644,21 +635,21 @@
<!-- OEE -->

<record id="mrp_workcenter_efficiency_0" model="mrp.workcenter.productivity">
<field name="workcenter_id" ref="mrp_workcenter_0"/>
<field name="workcenter_id" ref="mrp_workcenter_3"/>
<field name="loss_id" ref="block_reason7"/>
<field name="date_start" eval="(datetime.now() - relativedelta(days=5)).strftime('%Y-%m-%d %H:%M:%S')"/>
<field name="date_end" eval="(datetime.now() - relativedelta(days=2)).strftime('%Y-%m-%d %H:%M:%S')"/>
</record>

<record id="mrp_workcenter_efficiency_1" model="mrp.workcenter.productivity">
<field name="workcenter_id" ref="mrp_workcenter_0"/>
<field name="workcenter_id" ref="mrp_workcenter_3"/>
<field name="loss_id" ref="block_reason0"/>
<field name="date_start" eval="(datetime.now() - timedelta(hours=5)).strftime('%Y-%m-%d %H:%M:%S')"/>
<field name="date_end" eval="(datetime.now() - timedelta(hours=3)).strftime('%Y-%m-%d %H:%M:%S')"/>
</record>

<record id="mrp_workcenter_efficiency_2" model="mrp.workcenter.productivity">
<field name="workcenter_id" ref="mrp_workcenter_0"/>
<field name="workcenter_id" ref="mrp_workcenter_3"/>
<field name="loss_id" ref="block_reason1"/>
<field name="date_start" eval="(datetime.now() - timedelta(days=5, hours=4)).strftime('%Y-%m-%d %H:%M:%S')"/>
<field name="date_end" eval="(datetime.now() - timedelta(days=5, hours=3)).strftime('%Y-%m-%d %H:%M:%S')"/>
@@ -72,11 +72,11 @@
<page string="Miscellaneous">
<group>
<group>
<field name="sequence"/>
<field name="sequence" invisible="1"/>
</group>
<group>
<field name="ready_to_produce" attrs="{'invisible': [('type','=','phantom')]}" string="Manufacturing Readiness"/>
<field name="picking_type_id" attrs="{'invisible': [('type','=','phantom')]}" string="Operation"/>
<field name="ready_to_produce" attrs="{'invisible': [('type','=','phantom')]}" string="Manufacturing Readiness" groups="mrp.group_mrp_routings"/>
<field name="picking_type_id" attrs="{'invisible': [('type','=','phantom')]}" groups="stock.group_adv_location" string="Operation"/>
</group>
</group>
</page>
@@ -95,7 +95,7 @@
<field name="arch" type="xml">
<tree string="Bill of Materials" default_order="product_tmpl_id">
<field name="active" invisible="1"/>
<field name="sequence" invisible="1"/>
<field name="sequence" widget="handle"/>
<field name="product_tmpl_id"/>
<field name="code"/>
<field name="product_id" groups="product.group_product_variant"/>
@@ -300,7 +300,7 @@
<div class="o_row col-5 pl-0">
<field name="lst_price" widget='monetary' options="{'currency_field': 'currency_id', 'field_digits': True}" attrs="{'readonly': [('product_variant_count', '&gt;', 1)]}"/>
</div>
<field name="standard_price" widget='monetary' options="{'currency_field': 'currency_id'}"/>
<field string="Value" name="standard_price" widget='monetary' options="{'currency_field': 'currency_id'}"/>
<field name="currency_id" invisible='1'/>
</group>
</group>
@@ -652,11 +652,11 @@ def action_open_product_lot(self):
self.ensure_one()
action = self.env.ref('stock.action_production_lot_form').read()[0]
action['domain'] = [('product_id.product_tmpl_id', '=', self.id)]
action['context'] = {'template_id': self.id, 'operator': '='}
if self.product_variant_count == 1:
action['context'] = {
'default_product_id': self.product_variant_id.id,
}

return action

class ProductCategory(models.Model):
@@ -13,9 +13,6 @@
<tr t-att-data-unfold="a['unfoldable']" t-att-data-parent_id="a['parent_id']" t-att-data-id="a['id']" t-att-data-model_id="a['model_id']" t-att-data-model="a['model']" t-att-data-lot_name="a['lot_name']" t-att-data-lot_id="a['lot_id']" t-att-class="trclass">
<t t-set="tdclass" t-value="''" />
<t t-set="spanclass" t-value="''" />
<t t-set="span_color" t-value="'color: #666666;'"/>
<t t-if="a['usage'] == 'in'"><t t-set="span_color" t-value="'color: #3c763d;'"/></t>
<t t-if="a['usage'] == 'out'"><t t-set="span_color" t-value="'color: #a94442;'"/></t>
<t t-if="a.get('unfoldable')"><t t-set="tdclass" t-value="'o_stock_reports_unfoldable'" /></t>
<t t-if="not a.get('unfoldable')"><t t-set="spanclass" t-value="'o_stock_reports_nofoldable'" /></t>
<t t-set="column" t-value="0" />
@@ -41,7 +38,7 @@
</span>
</t>
<t t-else="">
<span t-att-style="span_color">
<span>
<t t-raw="c"/>
</span>
</t>
@@ -25,7 +25,7 @@
</div>
<group name="main_group">
<group>
<field name="product_id" help="Product this lot/serial number contains. You cannot change it anymore if it has already been moved."/>
<field name="product_id" domain="[('product_tmpl_id.id', context.get('operator', '!='), context.get('template_id', False))]" help="Product this lot/serial number contains. You cannot change it anymore if it has already been moved." />
<label for="product_qty"/>
<div class="o_row">
<field name="product_qty"/>

0 comments on commit 946e654

Please sign in to comment.
You can’t perform that action at this time.