Availability |
Odoo Online
Odoo.sh
On Premise
|
Odoo Apps Dependencies |
•
Sales (sale_management)
• Discuss (mail) • Invoicing (account) |
Lines of code | 66 |
Technical Name |
customer_sequence |
License | AGPL-3 |
Website | https://cybrosys.com/ |
Versions | 10.0 11.0 12.0 13.0 14.0 15.0 16.0 17.0 18.0 |
Customer Sequence
Give unique code to each customer.
Explore This Module
Overview
Features
Available in Odoo 14.0 Community and Enterprise.
Unique code can be given to customers and suppliers based on company.
Screenshots
Give the starting number of code.
You can give separate starting for each company if it is a multi company.
Unique code on customer
Create a customer and the code will generate automatically as defined in the company form.
Related Products
Our Services
Odoo Customization
Odoo Implementation
Odoo Support
Hire Odoo Developer
Odoo Integration
Odoo Migration
Odoo Consultancy
Odoo Implementation
Odoo Licensing Consultancy
Our Industries
Trading
Easily procure and sell your products
POS
Easy configuration and convivial experience
Education
A platform for educational management
Manufacturing
Plan, track and schedule your operations
E-commerce & Website
Mobile friendly, awe-inspiring product pages
Service Management
Keep track of services and invoice
Restaurant
Run your bar or restaurant methodically
Hotel Management
An all-inclusive hotel management application
Support
Say hi to us on WhatsApp!
+91 86068 27707
Please log in to comment on this module
Report comment
Any abuse of this reporting system will be penalizedThere are no ratings yet!
from odoo import models, fields, api
class ResPartner(models.Model):
_inherit = 'res.partner'
unique_id = fields.Char(string='Unique Id', help="The Unique Sequence no", readonly=True, default='/')
@api.model_create_multi
def create(self, values):
res = super(ResPartner, self).create(values)
company_seq = self.env.company
if res.unique_id == '/':
if company_seq.next_code:
if company_seq.next_code
company_seq.write({'next_code': company_seq.next_code + 10000})
res.unique_id = "{}{}".format(company_seq.id,company_seq.next_code + 1)
res.name = "[{}{}]{}".format(company_seq.id,company_seq.next_code + 1,str(res.name))
company_seq.write({'next_code': company_seq.next_code + 1})
else:
res.unique_id = "{}{}".format(company_seq.id,10000)
res.name = "[{}{}]{}".format(company_seq.id,10000,str(res.name))
company_seq.write({'next_code': 10001})
return res
i found one row bug. Resolved top
Odoo 16 in not working this app. I changed same code lines. I added company id and 10000+ start customer sequence number. New model code bottom
# -*- coding: utf-8 -*-
#############################################################################
#
# Cybrosys Technologies Pvt. Ltd.
#
# Copyright (C) 2020-TODAY Cybrosys Technologies()
# Author: Midilaj ()
#
# 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 .
#
#############################################################################
from odoo import models, fields, api
class ResPartner(models.Model):
_inherit = 'res.partner'
unique_id = fields.Char(string='Unique Id', help="The Unique Sequence no", readonly=True, default='/')
@api.model_create_multi
def create(self, values):
res = super(ResPartner, self).create(values)
company_seq = self.env.company
if res.unique_id == '/':
if company_seq.next_code:
if company_seq.next_code
company_seq.write({'next_code': company_seq.next_code + 10000})
res.unique_id = "{}{}".format(company_seq.id,company_seq.next_code + 1)
res.name = "[{}{}]{}".format(company_seq.id,10000,str(res.name))
company_seq.write({'next_code': company_seq.next_code + 1})
else:
res.unique_id = "{}{}".format(company_seq.id,10000)
res.name = "[{}{}]{}".format(company_seq.id,10000,str(res.name))
company_seq.write({'next_code': 10001})
return res