@ -0,0 +1,8 @@ |
|||
# -*- coding: utf-8 -*- |
|||
############################################################################## |
|||
# |
|||
# Cybrosys Technologies Pvt. Ltd. |
|||
# Copyright (C) 2017-TODAY Cybrosys Technologies(<https://www.cybrosys.com>). |
|||
# Maintainer: Cybrosys Technologies (<https://www.cybrosys.com>) |
|||
############################################################################## |
|||
import models |
@ -0,0 +1,43 @@ |
|||
# -*- coding: utf-8 -*- |
|||
############################################################################## |
|||
# |
|||
# Cybrosys Technologies Pvt. Ltd. |
|||
# Copyright (C) 2017-TODAY Cybrosys Technologies(<https://www.cybrosys.com>). |
|||
# Author: fasluca(<https://www.cybrosys.com>) |
|||
# 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 <http://www.gnu.org/licenses/>. |
|||
# |
|||
############################################################################## |
|||
{ |
|||
'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 |
|||
} |
@ -0,0 +1,8 @@ |
|||
# -*- coding: utf-8 -*- |
|||
############################################################################## |
|||
# |
|||
# Cybrosys Technologies Pvt. Ltd. |
|||
# Copyright (C) 2017-TODAY Cybrosys Technologies(<https://www.cybrosys.com>). |
|||
# Maintainer: Cybrosys Technologies (<https://www.cybrosys.com>) |
|||
############################################################################## |
|||
import mrp_production |
@ -0,0 +1,46 @@ |
|||
# -*- coding: utf-8 -*- |
|||
############################################################################## |
|||
# |
|||
# Cybrosys Technologies Pvt. Ltd. |
|||
# Copyright (C) 2017-TODAY Cybrosys Technologies(<https://www.cybrosys.com>). |
|||
# Maintainer: Cybrosys Technologies (<https://www.cybrosys.com>) |
|||
############################################################################## |
|||
|
|||
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' |
After Width: | Height: | Size: 63 KiB |
After Width: | Height: | Size: 47 KiB |
After Width: | Height: | Size: 178 KiB |
After Width: | Height: | Size: 102 KiB |
After Width: | Height: | Size: 50 KiB |
After Width: | Height: | Size: 7.5 KiB |
After Width: | Height: | Size: 35 KiB |
@ -0,0 +1,95 @@ |
|||
<section class="oe_container oe_dark"> |
|||
<div class="oe_row oe_spaced"> |
|||
<h2 class="oe_slogan">Draft Manufacturing Order</h2> |
|||
<h4 class="oe_slogan"><a href="https://www.cybrosys.com">Cybrosys Technologies</a></h4> |
|||
</div> |
|||
</section> |
|||
|
|||
<section class="oe_container"> |
|||
<div class="oe_row oe_spaced"> |
|||
<h2 class="oe_slogan" style="color:#875A7B;">Draft State in Manufacturing Order</h2> |
|||
<h3 class="oe_slogan"> |
|||
Provides a new state 'Draft' as default. So that users can manage a manufacturing order more easily. |
|||
</h3> |
|||
</div> |
|||
|
|||
<div class="oe_row oe_spaced"> |
|||
<h4>By Default in Odoo,</h4> |
|||
</div> |
|||
|
|||
<div class="oe_container"> |
|||
<div class="oe_row oe_spaced"> |
|||
<div> |
|||
<ul> |
|||
<li style="list-style:none !important;"><span style="color:green;"> ★</span> When we create a MO, that directly becomes 'Confirmed'.</li> |
|||
<li style="list-style:none !important;"><span style="color:green;"> ★</span> Changing Product Or Any Other Related Details Like Quantity, BoM Is Not Possible After Saving The Manufacturing Order.</li> |
|||
</ul> |
|||
</div> |
|||
<div> |
|||
<div class="oe_demo oe_picture oe_screenshot"> |
|||
<img src="MO_default.png"> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
|
|||
<div class="oe_row oe_spaced"> |
|||
<h4>Using this module,</h4> |
|||
</div> |
|||
|
|||
<div class="oe_container"> |
|||
<div class="oe_row oe_spaced"> |
|||
<div> |
|||
<ul> |
|||
<li style="list-style:none !important;"><span style="color:green;"> ★</span> Newly Created Manufacturing Orders Will Be In 'Draft' State.</li> |
|||
<li style="list-style:none !important;"><span style="color:green;"> ★</span> User Can Change The Product, Quantity, etc.. On This State.</li> |
|||
<li style="list-style:none !important;"><span style="color:green;"> ★</span> A New Button 'Confirm' Is Added To Confirm The Manufacturing Order.</li> |
|||
<li style="list-style:none !important;"><span style="color:green;"> ★</span> Sequence Number Will Not Be Generated Until Confirmation Of Manufacturing Order.</li> |
|||
</ul> |
|||
</div> |
|||
<div> |
|||
<div class="oe_demo oe_picture oe_screenshot"> |
|||
<img src="MO_new.png"> |
|||
</div> |
|||
</div> |
|||
<div> |
|||
<ul> |
|||
<li style="list-style:none !important;"><span style="color:green;"> ★</span> User can delete manufacturing order in 'Draft' state.</li> |
|||
</ul> |
|||
</div> |
|||
<div> |
|||
<div class="oe_demo oe_picture oe_screenshot"> |
|||
<img src="delete_warning.png"> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
|
|||
</section> |
|||
|
|||
<section class="oe_container oe_dark"> |
|||
<h2 class="oe_slogan" style="margin-top:20px;" >Need Any Help?</h2> |
|||
<div class="oe_slogan" style="margin-top:10px !important;"> |
|||
<div> |
|||
<a class="btn btn-primary btn-lg mt8" |
|||
style="color: #FFFFFF !important;border-radius: 0;" href="https://www.cybrosys.com"><i |
|||
class="fa fa-envelope"></i> Email </a> <a |
|||
class="btn btn-primary btn-lg mt8" style="color: #FFFFFF !important;border-radius: 0;" |
|||
href="https://www.cybrosys.com/contact/"><i |
|||
class="fa fa-phone"></i> Contact Us </a> <a |
|||
class="btn btn-primary btn-lg mt8" style="color: #FFFFFF !important;border-radius: 0;" |
|||
href="https://www.cybrosys.com/odoo-customization-and-installation/"><i |
|||
class="fa fa-check-square"></i> Request Customization </a> |
|||
</div> |
|||
<br> |
|||
<img src="cybro_logo.png" style="width: 190px; margin-bottom: 20px;" class="center-block"> |
|||
<div> |
|||
<a href="https://twitter.com/cybrosys" target="_blank"><i class="fa fa-2x fa-twitter" style="color:white;background: #00a0d1;width:35px;"></i></a></td> |
|||
<a href="https://www.linkedin.com/company/cybrosys-technologies-pvt-ltd" target="_blank"><i class="fa fa-2x fa-linkedin" style="color:white;background: #31a3d6;width:35px;padding-left: 3px;"></i></a></td> |
|||
<a href="https://www.facebook.com/cybrosystechnologies" target="_blank"><i class="fa fa-2x fa-facebook" style="color:white;background: #3b5998;width:35px;padding-left: 8px;"></i></a></td> |
|||
<a href="https://plus.google.com/106641282743045431892/about" target="_blank"><i class="fa fa-2x fa-google-plus" style="color:white;background: #c53c2c;width:35px;padding-left: 3px;"></i></a></td> |
|||
<a href="https://in.pinterest.com/cybrosys" target="_blank"><i class="fa fa-2x fa-pinterest" style="color:white;background: #ac0f18;width:35px;padding-left: 3px;"></i></a></td> |
|||
</div> |
|||
</div> |
|||
</section> |
|||
|
@ -0,0 +1,54 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<odoo> |
|||
<data> |
|||
<record id="mrp_production_form_view" model="ir.ui.view"> |
|||
<field name="name">mrp.production.form</field> |
|||
<field name="model">mrp.production</field> |
|||
<field name="inherit_id" ref="mrp.mrp_production_form_view"/> |
|||
<field name="arch" type="xml"> |
|||
<button name="button_mark_done" position="before"> |
|||
<button name="action_confirm" attrs="{'invisible': [('state', '!=', 'draft')]}" string="Confirm" type="object" class="oe_highlight"/> |
|||
</button> |
|||
<button name="%(mrp.action_change_production_qty)d" position="attributes"> |
|||
<attribute name="attrs">{'invisible': [('state','in',['draft','done'])]}</attribute> |
|||
</button> |
|||
</field> |
|||
</record> |
|||
|
|||
<record id="view_mrp_production_filter_extend" model="ir.ui.view"> |
|||
<field name="name">mrp.production.select</field> |
|||
<field name="model">mrp.production</field> |
|||
<field name="inherit_id" ref="mrp.view_mrp_production_filter"/> |
|||
<field name="arch" type="xml"> |
|||
<xpath expr="//filter[@name='todo']" position="replace"> |
|||
<filter string="To Do" name="todo" domain="[('state','in',('draft','confirmed', 'planned','progress'))]" |
|||
help="Manufacturing Orders which are in confirmed state."/> |
|||
</xpath> |
|||
</field> |
|||
</record> |
|||
|
|||
<record id="mrp.mrp_production_action" model="ir.actions.act_window"> |
|||
<field name="name">Manufacturing Orders</field> |
|||
<field name="type">ir.actions.act_window</field> |
|||
<field name="res_model">mrp.production</field> |
|||
<field name="view_type">form</field> |
|||
<field name="view_mode">tree,kanban,form,calendar,pivot,graph</field> |
|||
<field name="view_id" eval="False"/> |
|||
<field name="search_view_id" ref="view_mrp_production_filter_extend"/> |
|||
<field name="context">{'search_default_todo': True}</field> |
|||
<field name="help" type="html"> |
|||
<p class="oe_view_nocontent_create"> |
|||
Click to create a manufacturing order. |
|||
</p><p> |
|||
A manufacturing order, based on a bill of materials, will |
|||
consume raw materials and produce finished products. |
|||
</p><p> |
|||
Manufacturing orders are usually proposed automatically based |
|||
on customer requirements or automated rules like the minimum |
|||
stock rule. |
|||
</p> |
|||
</field> |
|||
</record> |
|||
|
|||
</data> |
|||
</odoo> |