mirror of
https://github.com/bringout/oca-crm.git
synced 2026-04-19 11:52:02 +02:00
Add oca-crm submodule with 26 CRM modules
🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
parent
0e924979be
commit
0608132c9e
1296 changed files with 142509 additions and 0 deletions
|
|
@ -0,0 +1,4 @@
|
|||
#############################################################################
|
||||
# For copyright and license notices, see __manifest__.py file in root directory
|
||||
##############################################################################
|
||||
from . import crm_lead
|
||||
|
|
@ -0,0 +1,26 @@
|
|||
##############################################################################
|
||||
# For copyright and license notices, see __manifest__.py file in root directory
|
||||
##############################################################################
|
||||
|
||||
from odoo import _, api, fields, models
|
||||
|
||||
|
||||
class CrmLead(models.Model):
|
||||
_inherit = "crm.lead"
|
||||
|
||||
code = fields.Char(
|
||||
string="Lead Number", required=True, default="/", readonly=True, copy=False
|
||||
)
|
||||
|
||||
_sql_constraints = [
|
||||
("crm_lead_unique_code", "UNIQUE (code)", _("The code must be unique!")),
|
||||
]
|
||||
|
||||
@api.model_create_multi
|
||||
def create(self, vals_list):
|
||||
for vals in vals_list:
|
||||
if vals.get("code", "/") == "/":
|
||||
vals["code"] = self.env.ref(
|
||||
"crm_lead_code.sequence_lead", raise_if_not_found=False
|
||||
).next_by_id()
|
||||
return super().create(vals_list)
|
||||
Loading…
Add table
Add a link
Reference in a new issue