diff --git a/mrp_production_draft/__init__.py b/mrp_production_draft/__init__.py new file mode 100644 index 000000000..4cd9270a1 --- /dev/null +++ b/mrp_production_draft/__init__.py @@ -0,0 +1,8 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2017-TODAY Cybrosys Technologies(). +# Maintainer: Cybrosys Technologies () +############################################################################## +import models diff --git a/mrp_production_draft/__manifest__.py b/mrp_production_draft/__manifest__.py new file mode 100644 index 000000000..5b0ff2b94 --- /dev/null +++ b/mrp_production_draft/__manifest__.py @@ -0,0 +1,43 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2017-TODAY Cybrosys Technologies(). +# Author: fasluca() +# you can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. +# +# It is forbidden to publish, distribute, sublicense, or sell copies +# of the Software or modified copies of the Software. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# GENERAL PUBLIC LICENSE (LGPL v3) along with this program. +# If not, see . +# +############################################################################## +{ + 'name': 'Draft Manufacturing Order', + 'version': '10.0.1.0', + 'summary': 'Draft State in Manufacturing Order', + 'description': """ + This module provides a draft state for manufacturing order instead of default first stage 'confirmed'. + """, + 'author': 'Cybrosys Techno Solutions', + 'company': 'Cybrosys Techno Solutions', + 'website': "https://cybrosys.com/", + 'category': 'Manufacturing', + 'depends': ['mrp'], + 'data': [ + 'views/mrp_production_view.xml', + ], + 'demo': [], + 'images': ['static/description/banner.jpg'], + 'license': 'LGPL-3', + 'installable': True, + 'application': False +} diff --git a/mrp_production_draft/models/__init__.py b/mrp_production_draft/models/__init__.py new file mode 100644 index 000000000..150459d9e --- /dev/null +++ b/mrp_production_draft/models/__init__.py @@ -0,0 +1,8 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2017-TODAY Cybrosys Technologies(). +# Maintainer: Cybrosys Technologies () +############################################################################## +import mrp_production diff --git a/mrp_production_draft/models/mrp_production.py b/mrp_production_draft/models/mrp_production.py new file mode 100644 index 000000000..32aeba95f --- /dev/null +++ b/mrp_production_draft/models/mrp_production.py @@ -0,0 +1,46 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2017-TODAY Cybrosys Technologies(). +# Maintainer: Cybrosys Technologies () +############################################################################## + +from odoo import api, models, fields, _ +from odoo.exceptions import UserError + +from odoo.addons.mrp.models.mrp_production import MrpProduction as mp + + +class MrpProduction(models.Model): + _inherit = 'mrp.production' + + state = fields.Selection([ + ('draft', 'Draft'), + ('confirmed', 'Confirmed'), + ('planned', 'Planned'), + ('progress', 'In Progress'), + ('done', 'Done'), + ('cancel', 'Cancelled')], string='State', + copy=False, default='draft', track_visibility='onchange') + + @api.model + def create(self, values): + production = super(mp, self).create(values) + return production + + @api.multi + def unlink(self): + if any(production.state not in ['draft', 'cancel'] for production in self): + raise UserError(_('Cannot delete a manufacturing order not in draft or cancel state')) + return super(MrpProduction, self).unlink() + + @api.multi + def action_confirm(self): + if not self.name or self.name == _('New'): + self.name = self.env['ir.sequence'].next_by_code('mrp.production') or _('New') + print self.name + if not self.procurement_group_id: + self.procurement_group_id = self.env["procurement.group"].create({'name': self.name}).id + self._generate_moves() + self.state = 'confirmed' diff --git a/mrp_production_draft/static/description/MO_default.png b/mrp_production_draft/static/description/MO_default.png new file mode 100644 index 000000000..062b417ab Binary files /dev/null and b/mrp_production_draft/static/description/MO_default.png differ diff --git a/mrp_production_draft/static/description/MO_new.png b/mrp_production_draft/static/description/MO_new.png new file mode 100644 index 000000000..a0a5f0435 Binary files /dev/null and b/mrp_production_draft/static/description/MO_new.png differ diff --git a/mrp_production_draft/static/description/banner.gif b/mrp_production_draft/static/description/banner.gif new file mode 100644 index 000000000..f4f53468a Binary files /dev/null and b/mrp_production_draft/static/description/banner.gif differ diff --git a/mrp_production_draft/static/description/banner.jpg b/mrp_production_draft/static/description/banner.jpg new file mode 100644 index 000000000..0343a6b59 Binary files /dev/null and b/mrp_production_draft/static/description/banner.jpg differ diff --git a/mrp_production_draft/static/description/cybro_logo.png b/mrp_production_draft/static/description/cybro_logo.png new file mode 100644 index 000000000..bb309114c Binary files /dev/null and b/mrp_production_draft/static/description/cybro_logo.png differ diff --git a/mrp_production_draft/static/description/delete_warning.png b/mrp_production_draft/static/description/delete_warning.png new file mode 100644 index 000000000..0394de602 Binary files /dev/null and b/mrp_production_draft/static/description/delete_warning.png differ diff --git a/mrp_production_draft/static/description/icon.png b/mrp_production_draft/static/description/icon.png new file mode 100644 index 000000000..34fb91887 Binary files /dev/null and b/mrp_production_draft/static/description/icon.png differ diff --git a/mrp_production_draft/static/description/index.html b/mrp_production_draft/static/description/index.html new file mode 100644 index 000000000..3d1991647 --- /dev/null +++ b/mrp_production_draft/static/description/index.html @@ -0,0 +1,95 @@ +
+
+

Draft Manufacturing Order

+

Cybrosys Technologies

+
+
+ +
+
+

Draft State in Manufacturing Order

+

+ Provides a new state 'Draft' as default. So that users can manage a manufacturing order more easily. +

+
+ +
+

By Default in Odoo,

+
+ +
+
+
+
    +
  •    When we create a MO, that directly becomes 'Confirmed'.
  • +
  •    Changing Product Or Any Other Related Details Like Quantity, BoM Is Not Possible After Saving The Manufacturing Order.
  • +
+
+
+
+ +
+
+
+
+ +
+

Using this module,

+
+ +
+
+
+
    +
  •    Newly Created Manufacturing Orders Will Be In 'Draft' State.
  • +
  •    User Can Change The Product, Quantity, etc.. On This State.
  • +
  •    A New Button 'Confirm' Is Added To Confirm The Manufacturing Order.
  • +
  •    Sequence Number Will Not Be Generated Until Confirmation Of Manufacturing Order.
  • +
+
+
+
+ +
+
+
+
    +
  •    User can delete manufacturing order in 'Draft' state.
  • +
+
+
+
+ +
+
+
+
+ +
+ +
+

Need Any Help?

+ +
+ diff --git a/mrp_production_draft/views/mrp_production_view.xml b/mrp_production_draft/views/mrp_production_view.xml new file mode 100644 index 000000000..d83557b38 --- /dev/null +++ b/mrp_production_draft/views/mrp_production_view.xml @@ -0,0 +1,54 @@ + + + + + mrp.production.form + mrp.production + + + + + + + + + mrp.production.select + mrp.production + + + + + + + + + + Manufacturing Orders + ir.actions.act_window + mrp.production + form + tree,kanban,form,calendar,pivot,graph + + + {'search_default_todo': True} + +

+ Click to create a manufacturing order. +

+ A manufacturing order, based on a bill of materials, will + consume raw materials and produce finished products. +

+ Manufacturing orders are usually proposed automatically based + on customer requirements or automated rules like the minimum + stock rule. +

+
+
+ +
+
\ No newline at end of file