diff options
| author | Hetashree Chauhan <hch@odoo.com> | 2019-07-31 10:10:48 +0000 |
|---|---|---|
| committer | svs-odoo <svs@odoo.com> | 2019-08-14 12:13:27 +0000 |
| commit | cdc8bf4bb1d6f0b817285f4926a5807f7f6b1e14 (patch) | |
| tree | e9eb09f6d59a8942eac7c30c5fecdb29e2ee7e23 /addons | |
| parent | 699a4614effbc35b527185fe8ad7cdb6e5b52c12 (diff) | |
[IMP] mrp, maintenance: back to basics
Modify tree view for MRP Production
Modify form view and tree view for Unbuild orders
Add group by for Bill of Materials
By default show line shart when opening MRP Production report
Modify view for Work Orders
Modify view for Work Centers
Modify view for Routings
Modify view for Maintenance Request
Modify view for Bill of Materials
task-2042304
closes - https://github.com/odoo/odoo/pull/35482
Diffstat (limited to 'addons')
| -rw-r--r-- | addons/hr_maintenance/views/maintenance_views.xml | 3 | ||||
| -rw-r--r-- | addons/maintenance/models/maintenance.py | 1 | ||||
| -rw-r--r-- | addons/maintenance/views/maintenance_views.xml | 8 | ||||
| -rw-r--r-- | addons/mrp/models/mrp_routing.py | 3 | ||||
| -rw-r--r-- | addons/mrp/models/mrp_unbuild.py | 2 | ||||
| -rw-r--r-- | addons/mrp/models/mrp_workcenter.py | 4 | ||||
| -rw-r--r-- | addons/mrp/static/src/js/mrp.js | 2 | ||||
| -rw-r--r-- | addons/mrp/views/mrp_bom_views.xml | 13 | ||||
| -rw-r--r-- | addons/mrp/views/mrp_production_views.xml | 10 | ||||
| -rw-r--r-- | addons/mrp/views/mrp_routing_views.xml | 6 | ||||
| -rw-r--r-- | addons/mrp/views/mrp_unbuild_views.xml | 3 | ||||
| -rw-r--r-- | addons/mrp/views/stock_move_views.xml | 2 | ||||
| -rw-r--r-- | addons/mrp/wizard/mrp_product_produce_views.xml | 2 |
13 files changed, 32 insertions, 27 deletions
diff --git a/addons/hr_maintenance/views/maintenance_views.xml b/addons/hr_maintenance/views/maintenance_views.xml index 97be6402b91..68043e17aed 100644 --- a/addons/hr_maintenance/views/maintenance_views.xml +++ b/addons/hr_maintenance/views/maintenance_views.xml @@ -25,7 +25,8 @@ <field name="inherit_id" ref="maintenance.hr_equipment_request_view_form"/> <field name="arch" type="xml"> <xpath expr="//field[@name='owner_user_id']" position="replace"> - <field name="employee_id" string="Created By"/> + <field name="employee_id" string="Created By" + options="{'no_create_edit': True, 'no_open': True}"/> </xpath> </field> </record> diff --git a/addons/maintenance/models/maintenance.py b/addons/maintenance/models/maintenance.py index d7ed713ac5c..e4c5099381c 100644 --- a/addons/maintenance/models/maintenance.py +++ b/addons/maintenance/models/maintenance.py @@ -298,6 +298,7 @@ class MaintenanceRequest(models.Model): schedule_date = fields.Datetime('Scheduled Date', help="Date the maintenance team plans the maintenance. It should not differ much from the Request Date. ") maintenance_team_id = fields.Many2one('maintenance.team', string='Team', required=True, default=_get_default_team_id) duration = fields.Float(help="Duration in hours.") + done = fields.Boolean(related='stage_id.done') def archive_equipment_request(self): self.write({'archive': True}) diff --git a/addons/maintenance/views/maintenance_views.xml b/addons/maintenance/views/maintenance_views.xml index 8ec616e2388..7b3e9446d3f 100644 --- a/addons/maintenance/views/maintenance_views.xml +++ b/addons/maintenance/views/maintenance_views.xml @@ -65,19 +65,19 @@ <field name="kanban_state" class="oe_inline" widget="state_selection"/> </div> <div class="oe_title"> - <label for="name" class="oe_edit_only" string="Name"/> + <label for="name" class="oe_edit_only" string="Title"/> <h1> <field name="name" placeholder="Maintenance Request"/> </h1> </div> <group> <group> - <field name="owner_user_id" string="Requested By"/> - <field name="company_id" groups="base.group_multi_company" options="{'no_create': True}"/> + <field name="owner_user_id" string="Requested By" invisible="1"/> <field name="equipment_id" context="{'default_category_id':category_id}"/> <field name="category_id" groups="maintenance.group_equipment_manager" attrs="{'invisible': [('equipment_id', '=', False)]}"/> <field name="request_date" readonly="True"/> - <field name="close_date" groups="base.group_no_one" readonly="True"/> + <field name="done" invisible="1"/> + <field name="close_date" attrs="{'invisible': [('done', '!=', True)]}" readonly="True"/> <field name="archive" invisible="1"/> <field name="maintenance_type" widget="radio"/> </group> diff --git a/addons/mrp/models/mrp_routing.py b/addons/mrp/models/mrp_routing.py index 81087282593..026b075b7a3 100644 --- a/addons/mrp/models/mrp_routing.py +++ b/addons/mrp/models/mrp_routing.py @@ -69,8 +69,7 @@ class MrpRoutingWorkcenter(models.Model): workorder_count = fields.Integer("# Work Orders", compute="_compute_workorder_count") batch = fields.Selection([ ('no', 'Once all products are processed'), - ('yes', 'Once a minimum number of products is processed')], string='Next Operation', - help="Set 'no' to schedule the next work order after the previous one. Set 'yes' to produce after the quantity set in 'Quantity To Process' has been produced.", + ('yes', 'Once some products are processed')], string='Start Next Operation', default='no', required=True) batch_size = fields.Float('Quantity to Process', default=1.0) workorder_ids = fields.One2many('mrp.workorder', 'operation_id', string="Work Orders") diff --git a/addons/mrp/models/mrp_unbuild.py b/addons/mrp/models/mrp_unbuild.py index 35058090c9b..75589b1d590 100644 --- a/addons/mrp/models/mrp_unbuild.py +++ b/addons/mrp/models/mrp_unbuild.py @@ -80,6 +80,8 @@ class MrpUnbuild(models.Model): if self.product_id: self.bom_id = self.env['mrp.bom']._bom_find(product=self.product_id) self.product_uom_id = self.product_id.uom_id.id + return {'domain': {'mo_id': [('state', '=', 'done'), ('product_id', '=', self.product_id.id)]}} + return {'domain': {'mo_id': [('state', '=', 'done')]}} @api.constrains('product_qty') def _check_qty(self): diff --git a/addons/mrp/models/mrp_workcenter.py b/addons/mrp/models/mrp_workcenter.py index 0ba916335fb..9748e6042ed 100644 --- a/addons/mrp/models/mrp_workcenter.py +++ b/addons/mrp/models/mrp_workcenter.py @@ -25,7 +25,7 @@ class MrpWorkcenter(models.Model): help="Description of the Work Center.") capacity = fields.Float( 'Capacity', default=1.0, - help="Number of pieces that can be produced in parallel.") + help="Number of pieces that can be produced in parallel. In case the work center has a capacity of 5 and you have to produce 10 units on your work order, the usual operation time will be multiplied by 2.") sequence = fields.Integer( 'Sequence', default=1, required=True, help="Gives the sequence order when displaying a list of work centers.") @@ -53,7 +53,7 @@ class MrpWorkcenter(models.Model): 'Productive Time', compute='_compute_productive_time', help='Productive hours over the last month', digits=(16, 2)) oee = fields.Float(compute='_compute_oee', help='Overall Equipment Effectiveness, based on the last month') - oee_target = fields.Float(string='OEE Target', help="OEE Target in percentage", default=90) + oee_target = fields.Float(string='OEE Target', help="Overall Effective Efficiency Target in percentage", default=90) performance = fields.Integer('Performance', compute='_compute_performance', help='Performance over the last month') workcenter_load = fields.Float('Work Center Load', compute='_compute_workorder_count') alternative_workcenter_ids = fields.Many2many( diff --git a/addons/mrp/static/src/js/mrp.js b/addons/mrp/static/src/js/mrp.js index 22abd2b0d91..990c419b2c5 100644 --- a/addons/mrp/static/src/js/mrp.js +++ b/addons/mrp/static/src/js/mrp.js @@ -36,7 +36,7 @@ var SetBulletStatus = AbstractField.extend({ this._super.apply(this, arguments); var bullet_class = this.classes[this.value] || 'default'; if (this.value) { - var title = this.value === 'waiting' ? _t('Waiting Materials') : _t('Ready to produce'); + var title = this.value === 'waiting' ? _t('Waiting Materials') : ''; this.$el.attr({'title': title, 'style': 'display:inline'}); this.$el.removeClass('text-success text-danger text-default'); this.$el.html($('<span>' + title + '</span>').addClass('badge badge-' + bullet_class)); diff --git a/addons/mrp/views/mrp_bom_views.xml b/addons/mrp/views/mrp_bom_views.xml index 05d04ad810f..2af174b2f67 100644 --- a/addons/mrp/views/mrp_bom_views.xml +++ b/addons/mrp/views/mrp_bom_views.xml @@ -16,7 +16,7 @@ <sheet> <div class="oe_button_box" name="button_box"> <button name="%(action_report_mrp_bom)d" type="action" - class="oe_stat_button" icon="fa-bars" string="Structure & Cost" attrs="{'invisible': [('bom_line_ids', '=', [])]}"/> + class="oe_stat_button" icon="fa-bars" string="Structure & Cost"/> </div> <widget name="web_ribbon" text="Archived" bg_color="bg-danger" attrs="{'invisible': [('active', '=', True)]}"/> <group> @@ -110,16 +110,16 @@ <field name="name">mrp.bom.tree</field> <field name="model">mrp.bom</field> <field name="arch" type="xml"> - <tree string="Bill of Materials" default_order="product_tmpl_id"> + <tree string="Bill of Materials"> <field name="active" invisible="1"/> - <field name="sequence" invisible="1"/> + <field name="sequence" widget="handle"/> <field name="product_tmpl_id"/> <field name="code" optional="show"/> <field name="product_id" groups="product.group_product_variant" optional="show"/> + <field name="type"/> + <field name="company_id" groups="base.group_multi_company" optional="show"/> <field name="product_qty" optional="show"/> <field name="product_uom_id" groups="uom.group_uom" optional="show" string="Unit of Measure"/> - <field name="type" optional="hide"/> - <field name="company_id" groups="base.group_multi_company" optional="show"/> <field name="routing_id" groups="mrp.group_mrp_routings" optional="show"/> </tree> </field> @@ -164,7 +164,7 @@ <filter string="Normal" name="normal" domain="[('type', '=', 'normal')]"/> <group expand="0" string="Group By..."> <filter string="Product" name="product" domain="[]" context="{'group_by':'product_tmpl_id'}"/> - <filter string='Default Unit of Measure' name="default_unit_of_measure" domain="[]" context="{'group_by' : 'product_uom_id'}"/> + <filter string='BoM Type' name="group_by_type" domain="[]" context="{'group_by' : 'type'}"/> <filter string="Routings" name="routings" domain="[]" context="{'group_by':'routing_id'}"/> </group> </search> @@ -177,6 +177,7 @@ <field name="domain">[]</field> <!-- force empty --> <field name="view_mode">tree,kanban,form</field> <field name="search_view_id" ref="view_mrp_bom_filter"/> + <field name="context">{'search_default_group_by_type': True}</field> <field name="help" type="html"> <p class="o_view_nocontent_smiling_face"> Create a bill of materials diff --git a/addons/mrp/views/mrp_production_views.xml b/addons/mrp/views/mrp_production_views.xml index 2bf94654de2..fcb506bb741 100644 --- a/addons/mrp/views/mrp_production_views.xml +++ b/addons/mrp/views/mrp_production_views.xml @@ -11,14 +11,14 @@ <field name="name"/> <field name="date_planned_start" optional="show"/> <field name="product_id" optional="show"/> - <field name="product_qty" sum="Total Qty" string="Quantity" optional="show"/> <field name="product_uom_id" string="Unit of Measure" options="{'no_open':True,'no_create':True}" groups="uom.group_uom" optional="show"/> <field name="bom_id" optional="hide"/> <field name="origin" optional="show"/> <field name="user_id" optional="hide"/> <field name="routing_id" groups="mrp.group_mrp_routings" optional="show"/> - <field name="state" optional="show"/> <field name="reservation_state" optional="show"/> + <field name="product_qty" sum="Total Qty" string="Quantity" optional="show"/> + <field name="state" optional="show"/> <field name="company_id" groups="base.group_multi_company" optional="show"/> <field name="activity_exception_decoration" widget="activity_exception"/> </tree> @@ -309,7 +309,7 @@ <field name="name">mrp.production.graph</field> <field name="model">mrp.production</field> <field name="arch" type="xml"> - <graph string="Manufacturing Orders"> + <graph string="Manufacturing Orders" type="line"> <field name="date_deadline"/> </graph> </field> @@ -373,7 +373,9 @@ <field name="domain">[('picking_type_id.active', '=', True)]</field> <field name="help" type="html"> <p class="o_view_nocontent_smiling_face"> - Create a new manufacturing order + Create a new manufacturing order <br/> + </p><p> + Produce finished products and consume components based on bill of materials. </p> </field> </record> diff --git a/addons/mrp/views/mrp_routing_views.xml b/addons/mrp/views/mrp_routing_views.xml index fcc4783eda4..b67865f424a 100644 --- a/addons/mrp/views/mrp_routing_views.xml +++ b/addons/mrp/views/mrp_routing_views.xml @@ -10,8 +10,7 @@ <field name="sequence" widget="handle"/> <field name="name"/> <field name="workcenter_id"/> - <field name="time_cycle" widget="float_time"/> - <field name="company_id" options="{'no_create': True}" groups="base.group_multi_company"/> + <field name="time_cycle" widget="float_time" string="Duration (minutes)" sum="Total Duration"/> </tree> </field> </record> @@ -25,7 +24,6 @@ <group name="description"> <field name="name"/> <field name="workcenter_id"/> - <field name="company_id" options="{'no_create': True}" groups="base.group_multi_company"/> <field name="sequence" groups="base.group_no_one"/> </group><group name="workorder"> <field name="workorder_count" invisible="1"/> @@ -43,7 +41,7 @@ <field name="time_cycle" invisible="1"/> </group> <group> - <field name="batch"/> + <field name="batch" widget="radio"/> <field name="batch_size" attrs="{'invisible': [('batch', '=', 'no')]}"/> </group> </group> diff --git a/addons/mrp/views/mrp_unbuild_views.xml b/addons/mrp/views/mrp_unbuild_views.xml index 1ba87f5c151..04187cdc477 100644 --- a/addons/mrp/views/mrp_unbuild_views.xml +++ b/addons/mrp/views/mrp_unbuild_views.xml @@ -125,7 +125,7 @@ </div> </group> <group> - <field name="mo_id" domain="[('state','=','done')]"/> + <field name="mo_id"/> <field name="location_id" options="{'no_create': True}" groups="stock.group_stock_multi_locations" domain="[('usage','=','internal')]"/> <field name="location_dest_id" options="{'no_create': True}" groups="stock.group_stock_multi_locations" domain="[('usage','=','internal')]"/> <field name="has_tracking" invisible="1"/> @@ -150,6 +150,7 @@ <field name="name"/> <field name="product_id"/> <field name="bom_id"/> + <field name="mo_id"/> <field name="lot_id" groups="stock.group_production_lot"/> <field name="product_qty"/> <field name="product_uom_id" groups="uom.group_uom"/> diff --git a/addons/mrp/views/stock_move_views.xml b/addons/mrp/views/stock_move_views.xml index fdbeeedc487..1fb4c2248fd 100644 --- a/addons/mrp/views/stock_move_views.xml +++ b/addons/mrp/views/stock_move_views.xml @@ -52,7 +52,7 @@ <tree editable="bottom" decoration-success="product_uom_qty==qty_done" decoration-danger="(product_uom_qty > 0) and (qty_done>product_uom_qty)"> <field name="lot_id" attrs="{'column_invisible': [('parent.has_tracking', '=', 'none')]}" domain="[('product_id', '=', parent.product_id)]" context="{'default_product_id': parent.product_id}"/> <field name="lot_produced_ids" widget="many2many_tags" options="{'no_open': True, 'no_create': True}" domain="[('id', 'in', parent.order_finished_lot_ids)]" invisible="not context.get('final_lots')"/> - <field name="product_uom_qty" string="Reserved" readonly="1"/> + <field name="product_uom_qty" string="Reserved" readonly="1" optional="show"/> <field name="qty_done"/> <field name="workorder_id" invisible="1"/> <field name="product_id" invisible="1"/> diff --git a/addons/mrp/wizard/mrp_product_produce_views.xml b/addons/mrp/wizard/mrp_product_produce_views.xml index c22ed6a3646..00542f06747 100644 --- a/addons/mrp/wizard/mrp_product_produce_views.xml +++ b/addons/mrp/wizard/mrp_product_produce_views.xml @@ -33,7 +33,7 @@ <field name="product_tracking" invisible="1"/> <field name="lot_id" attrs="{'readonly': [('product_tracking', '=', 'none')]}" context="{'default_product_id': product_id, 'active_mo_id': parent.production_id}" domain="[('product_id', '=', product_id)]" groups="stock.group_production_lot"/> <field name="qty_to_consume" readonly="1" force_save="1"/> - <field name="qty_reserved" readonly="1" force_save="1"/> + <field name="qty_reserved" readonly="1" force_save="1" optional="show"/> <field name="qty_done"/> <field name="product_uom_id" readonly="1" force_save="1" groups="uom.group_uom"/> <field name="move_id" invisible="1"/> |
