@ -0,0 +1,49 @@ |
|||
.. image:: https://img.shields.io/badge/licence-LGPL--3-green.svg |
|||
:target: https://www.gnu.org/licenses/lgpl-3.0-standalone.html |
|||
:alt: License: LGPL-3 |
|||
|
|||
Generate Lot/Serial Number From Manufacturing Order |
|||
=================================================== |
|||
Automatically generate Serial/Lot from Manufacturing Order. The user can set the lot/serial number sequence both globally and by product. |
|||
|
|||
Configuration |
|||
============= |
|||
* No additional configuration is needed. |
|||
|
|||
Company |
|||
------- |
|||
* `Cybrosys Techno Solutions <https://cybrosys.com/>`__ |
|||
|
|||
License |
|||
------- |
|||
Lesser General Public License, Version 3 (LGPL v3). |
|||
(https://www.gnu.org/licenses/lgpl-3.0-standalone.html) |
|||
|
|||
Credits |
|||
------- |
|||
* Developers : (V16) Jumana Jabin MP, |
|||
(V17) Jumana Haseen, |
|||
(V18) Ammu Raj |
|||
Contact: odoo@cybrosys.com |
|||
|
|||
Contacts |
|||
-------- |
|||
* Mail Contact : odoo@cybrosys.com |
|||
* Website : https://cybrosys.com |
|||
|
|||
Bug Tracker |
|||
----------- |
|||
Bugs are tracked on GitHub Issues. In case of trouble, please check there if your issue has already been reported. |
|||
|
|||
Maintainer |
|||
========== |
|||
.. image:: https://cybrosys.com/images/logo.png |
|||
:target: https://cybrosys.com |
|||
|
|||
This module is maintained by Cybrosys Technologies. |
|||
|
|||
For support and more information, please visit `Our Website <https://cybrosys.com/>`__ |
|||
|
|||
Further information |
|||
=================== |
|||
HTML Description: `<static/description/index.html>`__ |
@ -0,0 +1,22 @@ |
|||
# -*- coding: utf-8 -*- |
|||
############################################################################# |
|||
# |
|||
# Cybrosys Technologies Pvt. Ltd. |
|||
# |
|||
# Copyright (C) 2025-TODAY Cybrosys Technologies(<https://www.cybrosys.com>) |
|||
# Author: Ammu Raj (odoo@cybrosys.com) |
|||
# |
|||
# You can modify it under the terms of the GNU LESSER |
|||
# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. |
|||
# |
|||
# 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 |
|||
# (LGPL v3) along with this program. |
|||
# If not, see <http://www.gnu.org/licenses/>. |
|||
# |
|||
############################################################################# |
|||
from . import models |
@ -0,0 +1,44 @@ |
|||
# -*- coding: utf-8 -*- |
|||
############################################################################# |
|||
# |
|||
# Cybrosys Technologies Pvt. Ltd. |
|||
# |
|||
# Copyright (C) 2025-TODAY Cybrosys Technologies(<https://www.cybrosys.com>) |
|||
# Author: Ammu Raj (odoo@cybrosys.com) |
|||
# |
|||
# You can modify it under the terms of the GNU LESSER |
|||
# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. |
|||
# |
|||
# 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 |
|||
# (LGPL v3) along with this program. |
|||
# If not, see <http://www.gnu.org/licenses/>. |
|||
# |
|||
############################################################################# |
|||
{ |
|||
'name': 'Generate Lot/Serial Number From Manufacturing Order', |
|||
'version': '18.0.1.0.0', |
|||
'category': 'Manufacturing', |
|||
'summary': """Auto generate Serial/lot from manufacturing order.""", |
|||
'description': """Automatically generates lot/serial number for product |
|||
while confirming the manufacturing order. User can set lot/seral number |
|||
sequence in product wise and global wise.""", |
|||
'author': 'Cybrosys Techno Solutions', |
|||
'company': 'Cybrosys Techno Solutions', |
|||
'maintainer': 'Cybrosys Techno Solutions', |
|||
'website': 'https://www.cybrosys.com', |
|||
'depends': ['mrp', 'stock'], |
|||
'data': [ |
|||
'views/res_config_settings_views.xml', |
|||
'views/product_template_views.xml', |
|||
], |
|||
'images': ['static/description/banner.jpg'], |
|||
'license': 'LGPL-3', |
|||
'installable': True, |
|||
'auto_install': False, |
|||
'application': False, |
|||
} |
@ -0,0 +1,6 @@ |
|||
## Module <serial_no_from_mo> |
|||
|
|||
#### 07.02.2025 |
|||
#### Version 18.0.1.0.0 |
|||
##### ADD |
|||
- Initial Commit for Generate Lot/Serial Number From Manufacturing Order |
@ -0,0 +1,24 @@ |
|||
# -*- coding: utf-8 -*- |
|||
############################################################################# |
|||
# |
|||
# Cybrosys Technologies Pvt. Ltd. |
|||
# |
|||
# Copyright (C) 2025-TODAY Cybrosys Technologies(<https://www.cybrosys.com>) |
|||
# Author: Ammu Raj (odoo@cybrosys.com) |
|||
# |
|||
# You can modify it under the terms of the GNU LESSER |
|||
# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. |
|||
# |
|||
# 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 |
|||
# (LGPL v3) along with this program. |
|||
# If not, see <http://www.gnu.org/licenses/>. |
|||
# |
|||
############################################################################# |
|||
from . import mrp_production |
|||
from . import product_template |
|||
from . import res_config_settings |
@ -0,0 +1,87 @@ |
|||
# -*- coding: utf-8 -*- |
|||
############################################################################# |
|||
# |
|||
# Cybrosys Technologies Pvt. Ltd. |
|||
# |
|||
# Copyright (C) 2025-TODAY Cybrosys Technologies(<https://www.cybrosys.com>) |
|||
# AuthorAmmu Raj (odoo@cybrosys.com) |
|||
# |
|||
# You can modify it under the terms of the GNU LESSER |
|||
# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. |
|||
# |
|||
# 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 |
|||
# (LGPL v3) along with this program. |
|||
# If not, see <http://www.gnu.org/licenses/>. |
|||
# |
|||
############################################################################# |
|||
from odoo import models |
|||
|
|||
|
|||
class MrpProduction(models.Model): |
|||
"""Manufacturing Production model for managing production orders. |
|||
This model represents a production order and includes functionality for |
|||
confirming the production, generating serial/lot numbers, and other |
|||
related operations.""" |
|||
_inherit = "mrp.production" |
|||
|
|||
def action_confirm(self): |
|||
""" Confirm the production order and generate serial/lot numbers. |
|||
This method is called when the production order is confirmed. |
|||
It checks the tracking type of the product and the serial_selection |
|||
configuration parameter to determine the generation of serial/lot |
|||
numbers. It generates the numbers based on the global configuration or |
|||
product-specific configuration.""" |
|||
parms = self.env['ir.config_parameter'].sudo() |
|||
for rec in self: |
|||
if rec.product_id.tracking in ['serial', 'lot']: |
|||
if parms.get_param( |
|||
'serial_no_from_mo.serial_selection') == 'global': |
|||
digit = int(parms.get_param('serial_no_from_mo.digit')) |
|||
prefix = parms.get_param('serial_no_from_mo.prefix') |
|||
seq = self.env['ir.sequence'].sudo().search( |
|||
[('code', '=', 'mrp.production.sequence')]) |
|||
if seq: |
|||
seq.write({'prefix': prefix, |
|||
'padding': digit |
|||
}) |
|||
if not seq: |
|||
self.env['ir.sequence'].create( |
|||
{'name': 'Mrp Production', |
|||
'implementation': 'standard', |
|||
'code': 'mrp.production.sequence', |
|||
'prefix': prefix, 'padding': digit}) |
|||
serial_id = self.env['stock.lot'].create( |
|||
{'name': self.env['ir.sequence'].sudo().next_by_code( |
|||
'mrp.production.sequence'), |
|||
'product_id': rec.product_id.id, |
|||
'company_id': rec.company_id.id, |
|||
}) |
|||
else: |
|||
seq = self.env['ir.sequence'].sudo().search( |
|||
[('code', '=', rec.product_id.name)]) |
|||
if seq: |
|||
seq.write({ |
|||
'prefix': rec.product_id.product_tmpl_id.prefix, |
|||
'padding': rec.product_id.product_tmpl_id.digit, |
|||
}) |
|||
if not seq: |
|||
self.env['ir.sequence'].create({ |
|||
'name': 'Mrp Production', |
|||
'implementation': 'standard', |
|||
'code': rec.product_id.name, |
|||
'prefix': rec.product_id.product_tmpl_id.prefix, |
|||
'padding': rec.product_id.product_tmpl_id.digit |
|||
}) |
|||
serial_id = self.env['stock.lot'].create( |
|||
{'name': self.env['ir.sequence'].sudo().next_by_code( |
|||
rec.product_id.name), |
|||
'product_id': rec.product_id.id, |
|||
'company_id': rec.company_id.id, |
|||
}) |
|||
rec.lot_producing_id = serial_id |
|||
return super().action_confirm() |
@ -0,0 +1,33 @@ |
|||
# -*- coding: utf-8 -*- |
|||
############################################################################# |
|||
# |
|||
# Cybrosys Technologies Pvt. Ltd. |
|||
# |
|||
# Copyright (C) 2025-TODAY Cybrosys Technologies(<https://www.cybrosys.com>) |
|||
# Author: Ammu Raj (odoo@cybrosys.com) |
|||
# |
|||
# You can modify it under the terms of the GNU LESSER |
|||
# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. |
|||
# |
|||
# 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 |
|||
# (LGPL v3) along with this program. |
|||
# If not, see <http://www.gnu.org/licenses/>. |
|||
# |
|||
############################################################################# |
|||
from odoo import fields, models |
|||
|
|||
|
|||
class ProductTemplate(models.Model): |
|||
""" This model extends the base `product.template` model to add custom |
|||
fields for specifying the number of digits and prefix for the product.""" |
|||
_inherit = 'product.template' |
|||
|
|||
digit = fields.Integer(string="Number of Digits", |
|||
help="Specify the desired number of digits.") |
|||
prefix = fields.Char(string="Prefix", |
|||
help="Enter a prefix value if needed.") |
@ -0,0 +1,49 @@ |
|||
# -*- coding: utf-8 -*- |
|||
############################################################################# |
|||
# |
|||
# Cybrosys Technologies Pvt. Ltd. |
|||
# |
|||
# Copyright (C) 2025-TODAY Cybrosys Technologies(<https://www.cybrosys.com>) |
|||
# Author: Ammu Raj (odoo@cybrosys.com) |
|||
# |
|||
# You can modify it under the terms of the GNU LESSER |
|||
# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. |
|||
# |
|||
# 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 |
|||
# (LGPL v3) along with this program. |
|||
# If not, see <http://www.gnu.org/licenses/>. |
|||
# |
|||
############################################################################# |
|||
from odoo import fields, models |
|||
|
|||
|
|||
class ResConfigSettings(models.TransientModel): |
|||
""" Res Config Settings model for managing configuration settings. |
|||
This model extends the base `res.config.settings` model to add |
|||
custom fields for configuring serial number selection method, |
|||
number of digits, and prefix. """ |
|||
_inherit = 'res.config.settings' |
|||
|
|||
serial_selection = fields.Selection( |
|||
[('global', 'Global'), ('product_wise', 'Product Wise')], |
|||
string="Choose Method", |
|||
help="Select the method for generating serial numbers: global or" |
|||
" product-wise.", |
|||
config_parameter='serial_no_from_mo.serial_selection') |
|||
digit = fields.Integer(string="Number of Digits", |
|||
help="Specify the number of digits to use for the " |
|||
"serial numbers.", |
|||
config_parameter='serial_no_from_mo.digit', ) |
|||
prefix = fields.Char(string="Prefix", |
|||
help="Specify the prefix to be added to the serial" |
|||
"numbers.", |
|||
config_parameter='serial_no_from_mo.prefix', ) |
|||
is_serial_selection = fields.Boolean( |
|||
string="Serial number Selection Method", |
|||
help="Enable or disable the serial number selection method.", |
|||
config_parameter='serial_no_from_mo.is_serial_selection') |
After Width: | Height: | Size: 2.2 KiB |
After Width: | Height: | Size: 28 KiB |
After Width: | Height: | Size: 628 KiB |
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 210 KiB |
After Width: | Height: | Size: 209 KiB |
After Width: | Height: | Size: 109 KiB |
After Width: | Height: | Size: 495 B |
After Width: | Height: | Size: 1.0 KiB |
After Width: | Height: | Size: 624 B |
After Width: | Height: | Size: 136 KiB |
After Width: | Height: | Size: 214 KiB |
After Width: | Height: | Size: 36 KiB |
After Width: | Height: | Size: 3.6 KiB |
After Width: | Height: | Size: 310 B |
After Width: | Height: | Size: 929 B |
After Width: | Height: | Size: 1.3 KiB |
After Width: | Height: | Size: 3.3 KiB |
After Width: | Height: | Size: 1.4 KiB |
After Width: | Height: | Size: 17 KiB |
After Width: | Height: | Size: 542 B |
After Width: | Height: | Size: 576 B |
After Width: | Height: | Size: 733 B |
After Width: | Height: | Size: 4.3 KiB |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 4.0 KiB |
After Width: | Height: | Size: 1.7 KiB |
After Width: | Height: | Size: 738 KiB |
After Width: | Height: | Size: 2.2 KiB |
After Width: | Height: | Size: 911 B |
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 600 B |
After Width: | Height: | Size: 673 B |
After Width: | Height: | Size: 2.0 KiB |
After Width: | Height: | Size: 462 B |
After Width: | Height: | Size: 2.1 KiB |
After Width: | Height: | Size: 926 B |
After Width: | Height: | Size: 9.0 KiB |
After Width: | Height: | Size: 23 KiB |
After Width: | Height: | Size: 7.0 KiB |
After Width: | Height: | Size: 878 B |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 653 B |
After Width: | Height: | Size: 800 B |
After Width: | Height: | Size: 905 B |
After Width: | Height: | Size: 189 KiB |
After Width: | Height: | Size: 4.3 KiB |
After Width: | Height: | Size: 839 B |
After Width: | Height: | Size: 1.7 KiB |
After Width: | Height: | Size: 5.9 KiB |
After Width: | Height: | Size: 1.6 KiB |
After Width: | Height: | Size: 34 KiB |
After Width: | Height: | Size: 26 KiB |
After Width: | Height: | Size: 3.8 KiB |
After Width: | Height: | Size: 23 KiB |
After Width: | Height: | Size: 1.9 KiB |
After Width: | Height: | Size: 2.3 KiB |
After Width: | Height: | Size: 427 B |
After Width: | Height: | Size: 627 B |
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 988 B |
After Width: | Height: | Size: 3.7 KiB |
After Width: | Height: | Size: 5.0 KiB |
After Width: | Height: | Size: 875 B |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 90 KiB |
After Width: | Height: | Size: 716 KiB |
After Width: | Height: | Size: 88 KiB |
After Width: | Height: | Size: 713 KiB |
After Width: | Height: | Size: 90 KiB |
After Width: | Height: | Size: 770 KiB |
After Width: | Height: | Size: 94 KiB |
After Width: | Height: | Size: 65 KiB |
After Width: | Height: | Size: 91 KiB |
After Width: | Height: | Size: 72 KiB |
After Width: | Height: | Size: 81 KiB |
After Width: | Height: | Size: 156 KiB |
After Width: | Height: | Size: 880 KiB |
After Width: | Height: | Size: 154 KiB |
After Width: | Height: | Size: 10 KiB |
@ -0,0 +1,23 @@ |
|||
<?xml version="1.0" encoding="UTF-8"?> |
|||
<odoo> |
|||
<!-- This XML defines a view form for the product.template model in Odoo. |
|||
It modifies the product template form view to include additional fields. --> |
|||
<record id="product_template_form_view" model="ir.ui.view"> |
|||
<field name="name">product.template.view.form.inherit.serial.no.from.mo |
|||
</field> |
|||
<field name="model">product.template</field> |
|||
<field name="inherit_id" ref="product.product_template_form_view"/> |
|||
<field name="arch" type="xml"> |
|||
<xpath expr="//group[@name='group_lots_and_weight']" position="inside"> |
|||
<label for="digit" invisible="tracking == 'none'"/> |
|||
<div invisible="tracking == 'none'"> |
|||
<field name="digit"/> |
|||
</div> |
|||
<label for="prefix" invisible="tracking == 'none'"/> |
|||
<div invisible="tracking == 'none'"> |
|||
<field name="prefix"/> |
|||
</div> |
|||
</xpath> |
|||
</field> |
|||
</record> |
|||
</odoo> |
@ -0,0 +1,62 @@ |
|||
<?xml version="1.0" encoding="UTF-8"?> |
|||
<odoo> |
|||
<!-- This XML configuration extends the Odoo settings view for Manufacturing |
|||
Configuration. It introduces a new section for Serial Number Selection |
|||
settings. --> |
|||
<record id="res_config_settings_view_form" model="ir.ui.view"> |
|||
<field name="name"> |
|||
res.config.settings.view.form.inherit.serial.no.from.mo |
|||
</field> |
|||
<field name="model">res.config.settings</field> |
|||
<field name="inherit_id" ref="mrp.res_config_settings_view_form"/> |
|||
<field name="arch" type="xml"> |
|||
<setting id="process_mrp_barcodes" position="before"> |
|||
<div class="o_setting_box" id="serial_no_sel"> |
|||
<div class="o_setting_left_pane"> |
|||
<field name="is_serial_selection"/> |
|||
</div> |
|||
<div class="o_setting_right_pane"> |
|||
<label for="is_serial_selection" |
|||
string="Serial Number Selection"/> |
|||
<div class="text-muted">Allow manufacturing users to |
|||
add lot/serial sequences |
|||
</div> |
|||
<br/> |
|||
<label for="serial_selection" |
|||
invisible="is_serial_selection == False"/> |
|||
<br/> |
|||
<br/> |
|||
<field name="serial_selection" widget="radio" |
|||
invisible="is_serial_selection == False"/> |
|||
<div class="mt16" |
|||
invisible="serial_selection != 'global'"> |
|||
<br/> |
|||
<label class="o_form_label o_light_label" |
|||
for="digit" |
|||
invisible="is_serial_selection == False"/> |
|||
<br/> |
|||
<field name="digit" |
|||
invisible="is_serial_selection == False"/> |
|||
</div> |
|||
<div class="mt16" |
|||
invisible="serial_selection != 'global'"> |
|||
<br/> |
|||
<label class="o_form_label o_light_label" |
|||
for="prefix" |
|||
invisible="is_serial_selection == False"/> |
|||
<br/> |
|||
<field name="prefix" |
|||
invisible="is_serial_selection == False"/> |
|||
</div> |
|||
<div class="mt8" |
|||
invisible="serial_selection != 'product_wise'"> |
|||
<button name="%(product.product_template_action)d" |
|||
icon="fa-arrow-right" type="action" |
|||
string="Products" class="btn-link"/> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</setting> |
|||
</field> |
|||
</record> |
|||
</odoo> |