mirror of
https://gitlab.com/sonalarora/tra_backend.git
synced 2025-12-17 10:19:09 +02:00
work on laundary mgt
This commit is contained in:
@@ -9,13 +9,14 @@
|
||||
'description': """
|
||||
This module contains all the common features of Laundary Management.
|
||||
""",
|
||||
'depends': ['sale','sale_timesheet'],
|
||||
'depends': ['sale','sale_timesheet','crm'],
|
||||
'data': [
|
||||
'security/ir.model.access.csv',
|
||||
'data/ir_sequence_data.xml',
|
||||
'views/sale_views.xml',
|
||||
'views/sale_views.xml',
|
||||
'views/project_task_view.xml',
|
||||
'views/crm_lead_view.xml',
|
||||
],
|
||||
'demo': [
|
||||
],
|
||||
|
||||
@@ -2,3 +2,4 @@
|
||||
# Part of Odoo. See LICENSE file for full copyright and licensing details.
|
||||
|
||||
from . import sale
|
||||
from . import crm_lead
|
||||
|
||||
Binary file not shown.
BIN
laundary_mgt/models/__pycache__/crm_lead.cpython-36.pyc
Normal file
BIN
laundary_mgt/models/__pycache__/crm_lead.cpython-36.pyc
Normal file
Binary file not shown.
Binary file not shown.
38
laundary_mgt/models/crm_lead.py
Normal file
38
laundary_mgt/models/crm_lead.py
Normal file
@@ -0,0 +1,38 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Part of Odoo. See LICENSE file for full copyright and licensing details.
|
||||
|
||||
import logging
|
||||
import threading
|
||||
from psycopg2 import sql
|
||||
from datetime import datetime, timedelta, date
|
||||
from dateutil.relativedelta import relativedelta
|
||||
|
||||
from odoo import api, fields, models, tools, SUPERUSER_ID
|
||||
from odoo.tools.translate import _
|
||||
from odoo.tools import email_re, email_split
|
||||
from odoo.exceptions import UserError, AccessError
|
||||
from odoo.addons.phone_validation.tools import phone_validation
|
||||
from collections import OrderedDict, defaultdict
|
||||
|
||||
|
||||
|
||||
|
||||
class Lead(models.Model):
|
||||
_inherit = "crm.lead"
|
||||
|
||||
create_task = fields.Boolean(string='create task', default=False, copy=False)
|
||||
|
||||
def action_create_task(self):
|
||||
for rec in self:
|
||||
rec.create_task = True
|
||||
task_ids = self.env['project.task'].create({
|
||||
'project_id': 2,
|
||||
'partner_id': rec.partner_id.id,
|
||||
'user_id': '',
|
||||
'name': rec.name,
|
||||
'crm_id':self.id,
|
||||
'is_fsm':True,
|
||||
|
||||
})
|
||||
|
||||
|
||||
@@ -70,6 +70,7 @@ class ProjectTask(models.Model):
|
||||
color = fields.Many2one('color.type', string='Color', related='sale_line_id.color')
|
||||
tracking_code = fields.Char(string='Tracking Code',related='sale_line_id.tracking_code')
|
||||
remark = fields.Text('Remark',copy=False, related='sale_line_id.remark')
|
||||
crm_id = fields.Many2one('crm.lead', string='Crm Id')
|
||||
|
||||
class Project(models.Model):
|
||||
_inherit = "project.project"
|
||||
@@ -85,4 +86,4 @@ class Project(models.Model):
|
||||
class ProjectTaskType(models.Model):
|
||||
_inherit = 'project.task.type'
|
||||
|
||||
all_project_check = fields.Boolean(string='Check Track code', default=False, copy=False)
|
||||
all_project_check = fields.Boolean(string='Show All Project', default=False, copy=False)
|
||||
16
laundary_mgt/views/crm_lead_view.xml
Normal file
16
laundary_mgt/views/crm_lead_view.xml
Normal file
@@ -0,0 +1,16 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<odoo>
|
||||
<record id="crm_lead_view_form_inherits" model="ir.ui.view">
|
||||
<field name="name">crm.lead.form.view.inherit</field>
|
||||
<field name="model">crm.lead</field>
|
||||
<field name="groups_id" eval="[(4, ref('base.group_user'))]"/>
|
||||
<field name="inherit_id" ref="crm.crm_lead_view_form"/>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//header" position="inside">
|
||||
<field name="create_task" invisible="1"/>
|
||||
<button name="action_create_task" string="Create New Task" type="object" class="oe_highlight" attrs="{'invisible': ['|',('create_task', '=', True)]}"/>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
</odoo>
|
||||
@@ -8,6 +8,8 @@
|
||||
<field name="arch" type="xml">
|
||||
<field name="project_id" position="before">
|
||||
<field name="tracking_code" attrs="{'invisible': ['|', ('partner_id', '=', False), '&', ('sale_order_id', '!=', False), ('sale_line_id', '=', False)]}" options='{"no_open": True}' readonly="1" context="{'create': False, 'edit': False, 'delete': False}"/>
|
||||
|
||||
<field name="crm_id" readonly="1"/>
|
||||
</field>
|
||||
<field name="date_deadline" position="before">
|
||||
<field name="cloth_name" attrs="{'invisible': ['|', ('partner_id', '=', False), '&', ('sale_order_id', '!=', False), ('sale_line_id', '=', False)]}" options='{"no_open": True}' readonly="1" context="{'create': False, 'edit': False, 'delete': False}"/>
|
||||
|
||||
Reference in New Issue
Block a user