@ -0,0 +1,51 @@ |
|||||
|
.. image:: https://img.shields.io/badge/license-LGPL--3-green.svg |
||||
|
:target: https://www.gnu.org/licenses/lgpl-3.0-standalone.html |
||||
|
:alt: License: LGPL-3 |
||||
|
|
||||
|
Mobile Service Management |
||||
|
========================= |
||||
|
Module for mobile service shop daily activities |
||||
|
|
||||
|
Configuration |
||||
|
============= |
||||
|
* No additional configurations needed |
||||
|
|
||||
|
Company |
||||
|
------- |
||||
|
* `Cybrosys Techno Solutions <https://cybrosys.com/>`__ |
||||
|
|
||||
|
License |
||||
|
------- |
||||
|
General Public License, Version 3 (LGPL v3). |
||||
|
(https://www.odoo.com/documentation/17.0/legal/licenses.html) |
||||
|
|
||||
|
Credits |
||||
|
------- |
||||
|
* Developers: Milind Mohan, |
||||
|
(V15) Mohammed Shahil M P, |
||||
|
(V16) Neenu Merlin Jose, |
||||
|
(V17) Vishnu KP, |
||||
|
(V18) Jumana Jabin MP, |
||||
|
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,23 @@ |
|||||
|
# -*- coding: utf-8 -*- |
||||
|
############################################################################# |
||||
|
# |
||||
|
# Cybrosys Technologies Pvt. Ltd. |
||||
|
# |
||||
|
# Copyright (C) 2024-TODAY Cybrosys Technologies(<https://www.cybrosys.com>) |
||||
|
# Author:Jumana Jabin MP (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 |
||||
|
# GENERAL PUBLIC LICENSE (LGPL v3) along with this program. |
||||
|
# If not, see <http://www.gnu.org/licenses/>. |
||||
|
# |
||||
|
############################################################################# |
||||
|
from . import models |
||||
|
from . import wizard |
@ -0,0 +1,60 @@ |
|||||
|
# -*- coding: utf-8 -*- |
||||
|
############################################################################# |
||||
|
# |
||||
|
# Cybrosys Technologies Pvt. Ltd. |
||||
|
# |
||||
|
# Copyright (C) 2024-TODAY Cybrosys Technologies(<https://www.cybrosys.com>) |
||||
|
# Author:Jumana Jabin MP (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 |
||||
|
# GENERAL PUBLIC LICENSE (LGPL v3) along with this program. |
||||
|
# If not, see <http://www.gnu.org/licenses/>. |
||||
|
# |
||||
|
############################################################################# |
||||
|
{ |
||||
|
'name': 'Mobile Service Management', |
||||
|
'version': '18.0.1.0.0', |
||||
|
'summary': 'Module for managing mobile service shop daily activities.', |
||||
|
'description':'This module provides an all-in-one solution for mobile' |
||||
|
' service centers, helping them efficiently manage operations' |
||||
|
' while maintaining high levels of customer satisfaction.', |
||||
|
'category': 'Industries', |
||||
|
'author': 'Cybrosys Techno Solutions', |
||||
|
'company': 'Cybrosys Techno Solutions', |
||||
|
'maintainer': 'Cybrosys Techno Solutions', |
||||
|
'website': 'https://www.cybrosys.com', |
||||
|
'depends': ['stock_account', 'mail', 'product', 'account' ,'sale'], |
||||
|
'data': ['security/mobile_service_shop_security.xml', |
||||
|
'security/ir.model.access.csv', |
||||
|
'views/mobile_service_views.xml', |
||||
|
'views/product_template_views.xml', |
||||
|
'views/product_product_views.xml', |
||||
|
'views/terms_and_condition_views.xml', |
||||
|
'views/mobile_complaint_description_views.xml', |
||||
|
'views/mobile_complaint_views.xml', |
||||
|
'views/brand_models_views.xml', |
||||
|
'views/mobile_brand_views.xml', |
||||
|
'wizard/mobile_create_invoice_views.xml', |
||||
|
'reports/mobile_service_email_template.xml', |
||||
|
'reports/mobile_service_ticket.xml', |
||||
|
'data/mobile_service_data.xml', |
||||
|
'data/mobile_service_email_template.xml'], |
||||
|
'images': ['static/description/banner.jpg'], |
||||
|
'assetsq': { |
||||
|
'web.assets_backend': [ |
||||
|
'mobile_service_shop/static/src/css/mobile_service.css', |
||||
|
], |
||||
|
}, |
||||
|
'license': 'LGPL-3', |
||||
|
'installable': True, |
||||
|
'application': True, |
||||
|
'auto_install': False, |
||||
|
} |
@ -0,0 +1,21 @@ |
|||||
|
<?xml version="1.0" encoding="utf-8"?> |
||||
|
<odoo> |
||||
|
<!--Mobile service mobile_service_journal account record--> |
||||
|
<data noupdate="1"> |
||||
|
<record model="account.journal" id="mobile_service_journal"> |
||||
|
<field name="name">Mobile Service</field> |
||||
|
<field name="type">sale</field> |
||||
|
<field name="code">SERV</field> |
||||
|
</record> |
||||
|
<!-- Service product data for mobile service--> |
||||
|
<record model="product.template" id="mobile_service_product"> |
||||
|
<field name="name">Mobile Service Charge</field> |
||||
|
<field name="type">service</field> |
||||
|
</record> |
||||
|
<!-- Mobile Service advance product record--> |
||||
|
<record model="product.template" id="mobile_service_advance_product"> |
||||
|
<field name="name">Mobile Service Advance</field> |
||||
|
<field name="type">service</field> |
||||
|
</record> |
||||
|
</data> |
||||
|
</odoo> |
@ -0,0 +1,37 @@ |
|||||
|
<?xml version="1.0" encoding="utf-8"?> |
||||
|
<odoo> |
||||
|
<data noupdate="1"> |
||||
|
<!--Email template for mobile service --> |
||||
|
<record id="email_template_mobile_service" model="mail.template"> |
||||
|
<field name="name">Service Status Email</field> |
||||
|
<field name="model_id" ref="mobile_service_shop.model_mobile_service"/> |
||||
|
<field name="email_from">${ object.user_id.email or object.company_id.email }</field> |
||||
|
<field name="email_to">{{object.person_name.email}}</field> |
||||
|
<field name="subject">Ref {{ (object.name or 'n/a') }}</field> |
||||
|
<field name="auto_delete" eval="True"/> |
||||
|
<field name="lang">{{ (object.person_name.lang or object.technician_name.lang) }}</field> |
||||
|
<field name="body_html" type="html"> |
||||
|
<div> |
||||
|
<p>Dear<t t-out="object.person_name.name"/>, |
||||
|
</p> |
||||
|
<p>Your service request for |
||||
|
<t t-out="object.brand_name.brand_name or 'n/a'"/> |
||||
|
( |
||||
|
<t t-out="object.model_name.mobile_brand_models or 'n/a'"/> |
||||
|
) with reference no |
||||
|
<b> |
||||
|
<t t-out="object.name or 'n/a'"/> |
||||
|
</b> |
||||
|
has been processed to |
||||
|
<b> |
||||
|
<t t-out=" object.service_state or 'n/a'"/> |
||||
|
</b> |
||||
|
stage. |
||||
|
</p> |
||||
|
<p>If you have any questions, please let us know.</p> |
||||
|
<p>Best regards,</p> |
||||
|
</div> |
||||
|
</field> |
||||
|
</record> |
||||
|
</data> |
||||
|
</odoo> |
@ -0,0 +1,6 @@ |
|||||
|
## Module <mobile_service_shop> |
||||
|
|
||||
|
### 16.10.2024 |
||||
|
#### Version 18.0.1.0.0 |
||||
|
#### ADD |
||||
|
- Initial Commit for Mobile Service Management |
@ -0,0 +1,31 @@ |
|||||
|
# -*- coding: utf-8 -*- |
||||
|
############################################################################# |
||||
|
# |
||||
|
# Cybrosys Technologies Pvt. Ltd. |
||||
|
# |
||||
|
# Copyright (C) 2024-TODAY Cybrosys Technologies(<https://www.cybrosys.com>) |
||||
|
# Author:Jumana Jabin MP (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 |
||||
|
# GENERAL PUBLIC LICENSE (LGPL v3) along with this program. |
||||
|
# If not, see <http://www.gnu.org/licenses/>. |
||||
|
# |
||||
|
############################################################################# |
||||
|
from . import brand_model |
||||
|
from . import mobile_brand |
||||
|
from . import mobile_complaint |
||||
|
from . import mobile_complaint_description |
||||
|
from . import mobile_complaint_tree |
||||
|
from . import mobile_service |
||||
|
from . import product_order_line |
||||
|
from . import product_template |
||||
|
from . import service_ticket |
||||
|
from . import terms_condition |
@ -0,0 +1,38 @@ |
|||||
|
# -*- coding: utf-8 -*- |
||||
|
############################################################################# |
||||
|
# |
||||
|
# Cybrosys Technologies Pvt. Ltd. |
||||
|
# |
||||
|
# Copyright (C) 2024-TODAY Cybrosys Technologies(<https://www.cybrosys.com>) |
||||
|
# Author:Jumana Jabin MP (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 |
||||
|
# GENERAL PUBLIC LICENSE (LGPL v3) along with this program. |
||||
|
# If not, see <http://www.gnu.org/licenses/>. |
||||
|
# |
||||
|
############################################################################# |
||||
|
from odoo import fields, models |
||||
|
|
||||
|
|
||||
|
class BrandModel(models.Model): |
||||
|
"""This class represents a mobile brand model""" |
||||
|
_name = 'brand.model' |
||||
|
_description = 'Brand Model' |
||||
|
_inherit = ['mail.thread', 'mail.activity.mixin'] |
||||
|
_rec_name = 'mobile_brand_models' |
||||
|
|
||||
|
mobile_brand_name = fields.Many2one('mobile.brand', |
||||
|
string="Mobile Brand", required=True, |
||||
|
help="Brand name of the mobile") |
||||
|
mobile_brand_models = fields.Char(string="Model Name", required=True, |
||||
|
help="Model name of the mobile") |
||||
|
image_medium = fields.Binary(string='image', store=True, attachment=True, |
||||
|
help="Mobile image space") |
@ -0,0 +1,33 @@ |
|||||
|
# -*- coding: utf-8 -*- |
||||
|
############################################################################# |
||||
|
# |
||||
|
# Cybrosys Technologies Pvt. Ltd. |
||||
|
# |
||||
|
# Copyright (C) 2024-TODAY Cybrosys Technologies(<https://www.cybrosys.com>) |
||||
|
# Author:Jumana Jabin MP (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 |
||||
|
# GENERAL PUBLIC LICENSE (LGPL v3) along with this program. |
||||
|
# If not, see <http://www.gnu.org/licenses/>. |
||||
|
# |
||||
|
############################################################################# |
||||
|
from odoo import fields, models |
||||
|
|
||||
|
|
||||
|
class MobileBrand(models.Model): |
||||
|
"""This model represents the Mobile Brand""" |
||||
|
_name = 'mobile.brand' |
||||
|
_description = 'Mobile Brand' |
||||
|
_inherit = ['mail.thread', 'mail.activity.mixin'] |
||||
|
_rec_name = 'brand_name' |
||||
|
|
||||
|
brand_name = fields.Char(string="Mobile Brand", required=True, |
||||
|
help="Mobile Brand name") |
@ -0,0 +1,34 @@ |
|||||
|
# -*- coding: utf-8 -*- |
||||
|
############################################################################# |
||||
|
# |
||||
|
# Cybrosys Technologies Pvt. Ltd. |
||||
|
# |
||||
|
# Copyright (C) 2024-TODAY Cybrosys Technologies(<https://www.cybrosys.com>) |
||||
|
# Author:Jumana Jabin MP (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 |
||||
|
# GENERAL PUBLIC LICENSE (LGPL v3) along with this program. |
||||
|
# If not, see <http://www.gnu.org/licenses/>. |
||||
|
# |
||||
|
############################################################################# |
||||
|
from odoo import fields, models |
||||
|
|
||||
|
|
||||
|
class MobileComplaint(models.Model): |
||||
|
"""This model represents for the mobile Complaint type managing""" |
||||
|
_name = 'mobile.complaint' |
||||
|
_description = 'Mobile Complaint' |
||||
|
_inherit = ['mail.thread', 'mail.activity.mixin'] |
||||
|
_rec_name = 'complaint_type' |
||||
|
|
||||
|
complaint_type = fields.Char(string="Complaint Type", required=True, |
||||
|
help="This field specifies the type of the " |
||||
|
"complaint.") |
@ -0,0 +1,37 @@ |
|||||
|
# -*- coding: utf-8 -*- |
||||
|
############################################################################# |
||||
|
# |
||||
|
# Cybrosys Technologies Pvt. Ltd. |
||||
|
# |
||||
|
# Copyright (C) 2024-TODAY Cybrosys Technologies(<https://www.cybrosys.com>) |
||||
|
# Author:Jumana Jabin MP (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 |
||||
|
# GENERAL PUBLIC LICENSE (LGPL v3) along with this program. |
||||
|
# If not, see <http://www.gnu.org/licenses/>. |
||||
|
# |
||||
|
############################################################################# |
||||
|
from odoo import fields, models |
||||
|
|
||||
|
|
||||
|
class MobileComplaintDescription(models.Model): |
||||
|
"""This model represents description about the mobile Complaint""" |
||||
|
_name = 'mobile.complaint.description' |
||||
|
_description = "Mobile Complaint Description" |
||||
|
_inherit = ['mail.thread', 'mail.activity.mixin'] |
||||
|
_rec_name = 'description' |
||||
|
|
||||
|
complaint_type_template = fields.Many2one('mobile.complaint', |
||||
|
string="Complaint Type", |
||||
|
required=True, |
||||
|
help="Complaint type template.") |
||||
|
description = fields.Text(string="Description", |
||||
|
help="Complaint description.") |
@ -0,0 +1,45 @@ |
|||||
|
# -*- coding: utf-8 -*- |
||||
|
############################################################################# |
||||
|
# |
||||
|
# Cybrosys Technologies Pvt. Ltd. |
||||
|
# |
||||
|
# Copyright (C) 2024-TODAY Cybrosys Technologies(<https://www.cybrosys.com>) |
||||
|
# Author:Jumana Jabin MP (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 |
||||
|
# GENERAL PUBLIC LICENSE (LGPL v3) along with this program. |
||||
|
# If not, see <http://www.gnu.org/licenses/>. |
||||
|
# |
||||
|
############################################################################# |
||||
|
from odoo import fields, models |
||||
|
|
||||
|
|
||||
|
class MobileComplaintTree(models.Model): |
||||
|
"""Model for managing complaint details in mobile services.""" |
||||
|
_name = 'mobile.complaint.tree' |
||||
|
_description = 'Mobile Complaint Tree' |
||||
|
_inherit = ['mail.thread', 'mail.activity.mixin'] |
||||
|
_rec_name = 'complaint_type_tree' |
||||
|
|
||||
|
complaint_id = fields.Many2one('mobile.service', |
||||
|
string="Complaint ID", |
||||
|
help="Complaint id associated with this " |
||||
|
"record.") |
||||
|
complaint_type_tree = fields.Many2one('mobile.complaint', |
||||
|
string="Category", |
||||
|
required=True, |
||||
|
help="Complaint type tree records.") |
||||
|
description_tree = fields.Many2one('mobile.complaint.description', |
||||
|
string="Description", |
||||
|
domain="[('complaint_type_template'," |
||||
|
"'=',complaint_type_tree)]", |
||||
|
help="Description field for the " |
||||
|
"complaint.") |
@ -0,0 +1,387 @@ |
|||||
|
# -*- coding: utf-8 -*- |
||||
|
############################################################################# |
||||
|
# |
||||
|
# Cybrosys Technologies Pvt. Ltd. |
||||
|
# |
||||
|
# Copyright (C) 2024-TODAY Cybrosys Technologies(<https://www.cybrosys.com>) |
||||
|
# Author:Jumana Jabin MP (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 |
||||
|
# GENERAL PUBLIC LICENSE (LGPL v3) along with this program. |
||||
|
# If not, see <http://www.gnu.org/licenses/>. |
||||
|
# |
||||
|
############################################################################# |
||||
|
import pytz |
||||
|
from datetime import datetime |
||||
|
from odoo import api, fields, models, _ |
||||
|
from odoo.exceptions import UserError |
||||
|
|
||||
|
|
||||
|
class MobileService(models.Model): |
||||
|
"""Creates the model mobile.service""" |
||||
|
_name = 'mobile.service' |
||||
|
_rec_name = 'name' |
||||
|
_description = "Mobile Service" |
||||
|
_inherit = ['mail.thread', 'mail.activity.mixin'] |
||||
|
|
||||
|
name = fields.Char(string='Service Number', copy=False, default="New", |
||||
|
help="Number of The Service.") |
||||
|
person_name = fields.Many2one('res.partner', |
||||
|
string="Customer Name", required=True, |
||||
|
help="Name of the customer.") |
||||
|
contact_no = fields.Char(related='person_name.mobile', |
||||
|
string="Contact Number", |
||||
|
help="Contact number of the customer.") |
||||
|
email_id = fields.Char(related='person_name.email', string="Email", |
||||
|
help="Email ID of the customer.") |
||||
|
street = fields.Char(related='person_name.street', string="Address", |
||||
|
help="Street of the customer.") |
||||
|
street2 = fields.Char(related='person_name.street2', string="Address", |
||||
|
help="Street2 of the customer.") |
||||
|
city = fields.Char(related='person_name.city', string="Address", |
||||
|
help="City of the customer.") |
||||
|
state_id = fields.Many2one(related='person_name.state_id', string="Address", |
||||
|
help="State of the customer.") |
||||
|
zip = fields.Char(related='person_name.zip', string="Address", |
||||
|
help="Zip number of the customer address.") |
||||
|
country_id = fields.Many2one(related='person_name.country_id', |
||||
|
string="Address", |
||||
|
help="Country of the customer.") |
||||
|
brand_name = fields.Many2one('mobile.brand', |
||||
|
string="Mobile Brand", |
||||
|
help="Brand name of the mobile.") |
||||
|
is_in_warranty = fields.Boolean( |
||||
|
'In Warranty', default=False, |
||||
|
help="Specify if the product is in warranty.") |
||||
|
warranty_number = fields.Char(string="Warranty No ", |
||||
|
help="Warranty details.") |
||||
|
re_repair = fields.Boolean('Re-repair', default=False, |
||||
|
help="Re-repairing.") |
||||
|
imei_no = fields.Char(string="IMEI Number", |
||||
|
help="IMEI Number of the device.") |
||||
|
model_name = fields.Many2one('brand.model', string="Model", |
||||
|
domain="[('mobile_brand_name','=',brand_name)]" |
||||
|
, help="Model name of the device.") |
||||
|
image_medium = fields.Binary(related='model_name.image_medium', store=True, |
||||
|
attachment=True, help="Image of the device.") |
||||
|
date_request = fields.Date(string="Requested Date", |
||||
|
default=fields.Date.context_today, |
||||
|
help="Device submitted date.") |
||||
|
return_date = fields.Date(string="Return Date", required=True, |
||||
|
help="Device returned date.") |
||||
|
technician_name = fields.Many2one('res.users', |
||||
|
string="Technician Name", |
||||
|
default=lambda self: self.env.user, |
||||
|
help="Work assigned technician name.", |
||||
|
required=True) |
||||
|
service_state = fields.Selection( |
||||
|
[('draft', 'Draft'), ('assigned', 'Assigned'), |
||||
|
('completed', 'Completed'), ('returned', 'Returned'), |
||||
|
('not_solved', 'Not solved')], |
||||
|
string='Service Status', default='draft', track_visibility='always', |
||||
|
help='Service status of the work.') |
||||
|
complaints_tree = fields.One2many('mobile.complaint.tree', |
||||
|
'complaint_id', |
||||
|
string='Complaints Tree', |
||||
|
help='Mobile complaint details.') |
||||
|
product_order_line = fields.One2many('product.order.line', |
||||
|
'product_order_id', |
||||
|
string='Parts Order Lines', |
||||
|
help='Product parts order details.') |
||||
|
internal_notes = fields.Text(string="Internal Notes") |
||||
|
invoice_count = fields.Integer(compute='_compute_invoice_count', |
||||
|
string='# Invoice', copy=False, |
||||
|
help="Count of invoice.") |
||||
|
invoice_ids = fields.Many2many("account.move", string='Invoices', |
||||
|
compute="_get_invoiced", readonly=True, |
||||
|
copy=False, help="Invoices line") |
||||
|
first_payment_inv = fields.Many2one('account.move', copy=False, |
||||
|
help="First payment of the invoice.") |
||||
|
first_invoice_created = fields.Boolean(string="First Invoice Created", |
||||
|
invisible=True, copy=False, |
||||
|
help="Date of the first invoice.") |
||||
|
journal_type = fields.Many2one('account.journal', |
||||
|
'Journal', invisible=True, |
||||
|
default=lambda self: self.env[ |
||||
|
'account.journal'].search( |
||||
|
[('code', '=', 'SERV')]), |
||||
|
help='Type of the journal.') |
||||
|
company_id = fields.Many2one('res.company', 'Company', |
||||
|
default=lambda self: self.env.company, |
||||
|
help='Default company id.') |
||||
|
|
||||
|
|
||||
|
@api.model |
||||
|
def _default_picking_transfer(self): |
||||
|
"""To get the default picking transfers.""" |
||||
|
type_obj = self.env['stock.picking.type'] |
||||
|
company_id = self.env.context.get( |
||||
|
'company_id') or self.env.user.company_id.id |
||||
|
types = type_obj.search([('code', '=', 'outgoing'), |
||||
|
('warehouse_id.company_id', '=', company_id)], |
||||
|
limit=1) |
||||
|
if not types: |
||||
|
types = type_obj.search([('code', '=', 'outgoing'), |
||||
|
('warehouse_id', '=', False)]) |
||||
|
return types[:4] |
||||
|
|
||||
|
stock_picking_id = fields.Many2one('stock.picking', |
||||
|
string="Picking Id", |
||||
|
help='Stock picking ID information.') |
||||
|
picking_transfer_id = fields.Many2one('stock.picking.type', |
||||
|
string='Deliver To', |
||||
|
required=True, |
||||
|
default=_default_picking_transfer, |
||||
|
help="This will determine picking " |
||||
|
"type of outgoing shipment.") |
||||
|
picking_count = fields.Integer(string="Picking Count", |
||||
|
help='Number of outgoing shipment') |
||||
|
|
||||
|
@api.onchange('return_date') |
||||
|
def check_date(self): |
||||
|
"""Check the return date and request date""" |
||||
|
if self.return_date: |
||||
|
return_date_string = datetime.strptime(str(self.return_date), |
||||
|
"%Y-%m-%d") |
||||
|
request_date_string = datetime.strptime(str(self.date_request), |
||||
|
"%Y-%m-%d") |
||||
|
if return_date_string < request_date_string: |
||||
|
raise UserError( |
||||
|
"Return date should be greater than requested date") |
||||
|
|
||||
|
def approve(self): |
||||
|
"""Assigning the Service Request to the corresponding user""" |
||||
|
self.service_state = 'assigned' |
||||
|
|
||||
|
def complete(self): |
||||
|
"""Mark the service request as completed""" |
||||
|
self.service_state = 'completed' |
||||
|
|
||||
|
def return_to(self): |
||||
|
"""The service request is returned to the client""" |
||||
|
self.service_state = 'returned' |
||||
|
|
||||
|
def not_solved(self): |
||||
|
"""Mark the service request as not solved""" |
||||
|
self.service_state = 'not_solved' |
||||
|
|
||||
|
def action_send_mail(self): |
||||
|
"""This function opens a window to compose an email, with the edi sale |
||||
|
template message loaded by default""" |
||||
|
self.ensure_one() |
||||
|
try: |
||||
|
template_id = self.env.ref( |
||||
|
'mobile_service_shop.email_template_mobile_service') |
||||
|
except ValueError: |
||||
|
template_id = False |
||||
|
try: |
||||
|
compose_form_id = self.env.ref( |
||||
|
'mail.email_compose_message_wizard_form') |
||||
|
except ValueError: |
||||
|
compose_form_id = False |
||||
|
ctx = { |
||||
|
'default_model': 'mobile.service', |
||||
|
'default_res_ids': self.ids, |
||||
|
'default_use_template': bool(template_id), |
||||
|
'default_template_id': template_id.id, |
||||
|
'default_composition_mode': 'comment'} |
||||
|
return { |
||||
|
'name': _('Compose Email'), |
||||
|
'type': 'ir.actions.act_window', |
||||
|
'view_mode': 'form', |
||||
|
'res_model': 'mail.compose.message', |
||||
|
'views': [(compose_form_id.id, 'form')], |
||||
|
'view_id': compose_form_id.id, |
||||
|
'target': 'new', |
||||
|
'context': ctx} |
||||
|
|
||||
|
def return_advance(self): |
||||
|
"""This method returns the current invoice related to the work""" |
||||
|
inv_obj = self.env['account.move'].search( |
||||
|
[('invoice_origin', '=', self.name)]) |
||||
|
inv_ids = [] |
||||
|
for each in inv_obj: |
||||
|
inv_ids.append(each.id) |
||||
|
view_id = self.env.ref('account.view_move_form').id |
||||
|
if inv_ids: |
||||
|
if len(inv_ids) <= 1: |
||||
|
value = { |
||||
|
'view_mode': 'form', |
||||
|
'res_model': 'account.move', |
||||
|
'view_id': view_id, |
||||
|
'type': 'ir.actions.act_window', |
||||
|
'name': 'Invoice', |
||||
|
'res_id': inv_ids[0]} |
||||
|
else: |
||||
|
value = { |
||||
|
'domain': str([('id', 'in', inv_ids)]), |
||||
|
'view_mode': 'tree,form', |
||||
|
'res_model': 'account.move', |
||||
|
'view_id': False, |
||||
|
'type': 'ir.actions.act_window', |
||||
|
'name': 'Invoice', |
||||
|
'res_id': inv_ids[0]} |
||||
|
return value |
||||
|
else: |
||||
|
raise UserError("No invoice created") |
||||
|
|
||||
|
def _compute_invoice_count(self): |
||||
|
"""Calculating the number of invoices""" |
||||
|
self.invoice_count = self.env['account.move'].search_count( |
||||
|
[('invoice_origin', '=', self.name)]) |
||||
|
|
||||
|
@api.model |
||||
|
def create(self, vals): |
||||
|
"""Creating sequence""" |
||||
|
if 'company_id' in vals: |
||||
|
vals['name'] = self.env['ir.sequence'].with_context( |
||||
|
force_company=self.env.user.company_id.id).next_by_code( |
||||
|
'mobile.service') or _('New') |
||||
|
else: |
||||
|
vals['name'] = self.env['ir.sequence'].next_by_code( |
||||
|
'mobile.service') or _('New') |
||||
|
vals['service_state'] = 'draft' |
||||
|
return super(MobileService, self).create(vals) |
||||
|
|
||||
|
def unlink(self): |
||||
|
"""Supering the unlink function""" |
||||
|
for service in self: |
||||
|
if service.service_state != 'draft': |
||||
|
raise UserError( |
||||
|
_('You cannot delete an assigned service request')) |
||||
|
return super(MobileService, self).unlink() |
||||
|
|
||||
|
def action_invoice_create_wizard(self): |
||||
|
"""Opening a wizard to create invoice""" |
||||
|
return { |
||||
|
'name': _('Create Invoice'), |
||||
|
'view_mode': 'form', |
||||
|
'res_model': 'mobile.invoice', |
||||
|
'type': 'ir.actions.act_window', |
||||
|
'target': 'new'} |
||||
|
|
||||
|
def action_post_stock(self): |
||||
|
"""It will post a stock picking with products in parts usage""" |
||||
|
if not self.product_order_line: |
||||
|
raise UserError(_('No products are mentioned for this service.')) |
||||
|
flag = 0 |
||||
|
all_have_stock_number = True |
||||
|
move_lines = [] |
||||
|
for order in self.product_order_line: |
||||
|
if not order.stock_number: |
||||
|
all_have_stock_number = False |
||||
|
if order.product_uom_qty > order.qty_stock_move: |
||||
|
flag = 1 |
||||
|
move_line_vals = { |
||||
|
'product_id': order.product_id.id, |
||||
|
'quantity': order.product_uom_qty - order.qty_stock_move, |
||||
|
'product_uom_id': order.product_id.uom_id.id if order.product_id.uom_id else False, |
||||
|
} |
||||
|
move_lines.append((0, 0, move_line_vals)) |
||||
|
elif order.product_uom_qty < order.qty_stock_move: |
||||
|
raise UserError( |
||||
|
_('Used quantity is less than quantity stock move posted.')) |
||||
|
if all_have_stock_number: |
||||
|
raise UserError( |
||||
|
_('All products have stock moves. No stock picking will be created.')) |
||||
|
if flag == 0: |
||||
|
raise UserError(_('Nothing to post stock move.')) |
||||
|
pick = { |
||||
|
'picking_type_id': self.picking_transfer_id.id, |
||||
|
'partner_id': self.person_name.id, |
||||
|
'origin': self.name, |
||||
|
'location_dest_id': self.person_name.property_stock_customer.id, |
||||
|
'location_id': int( |
||||
|
self.picking_transfer_id.default_location_src_id.id), |
||||
|
'move_line_ids': move_lines |
||||
|
} |
||||
|
picking = self.env['stock.picking'].create(pick) |
||||
|
self.stock_picking_id = picking.id |
||||
|
self.picking_count = len(picking) |
||||
|
picking.action_confirm() |
||||
|
picking.button_validate() |
||||
|
for order in self.product_order_line: |
||||
|
if not order.stock_number: |
||||
|
order.stock_number = picking.name |
||||
|
self.message_post( |
||||
|
body='Stock moves have been successfully posted for picking %s.' |
||||
|
% picking.name,) |
||||
|
|
||||
|
def action_view_invoice(self): |
||||
|
"""It will show the invoice for the customer""" |
||||
|
self.ensure_one() |
||||
|
ctx = dict(create=False) |
||||
|
action = { |
||||
|
'name': _("Invoices"), |
||||
|
'type': 'ir.actions.act_window', |
||||
|
'res_model': 'account.move', |
||||
|
'target': 'current', |
||||
|
'context': ctx} |
||||
|
invoice_ids = self.env['account.move'].search( |
||||
|
[('invoice_origin', '=', self.name)]) |
||||
|
inv_ids = [] |
||||
|
for each_ids in invoice_ids: |
||||
|
inv_ids.append(each_ids.id) |
||||
|
if len(invoice_ids) == 1: |
||||
|
invoice = inv_ids and inv_ids[0] |
||||
|
action['res_id'] = invoice |
||||
|
action['view_mode'] = 'form' |
||||
|
action['views'] = [ |
||||
|
(self.env.ref('account.view_move_form').id, 'form')] |
||||
|
else: |
||||
|
action['view_mode'] = 'tree,form' |
||||
|
action['domain'] = [('id', 'in', inv_ids)] |
||||
|
return action |
||||
|
|
||||
|
def get_ticket(self): |
||||
|
"""This will return a ticket associated with the given service""" |
||||
|
self.ensure_one() |
||||
|
user = self.env['res.users'].browse(self.env.uid) |
||||
|
if user.tz: |
||||
|
tz = pytz.timezone(user.tz) |
||||
|
time = pytz.utc.localize(datetime.now()).astimezone(tz) |
||||
|
date_today = time.strftime("%Y-%m-%d %H:%M %p") |
||||
|
else: |
||||
|
date_today = datetime.strftime(datetime.now(), |
||||
|
"%Y-%m-%d %I:%M:%S %p") |
||||
|
complaint_text = "" |
||||
|
description_text = "" |
||||
|
complaint_id = self.env['mobile.complaint.tree'].search( |
||||
|
[('complaint_id', '=', self.id)]) |
||||
|
if complaint_id: |
||||
|
for obj in complaint_id: |
||||
|
complaint = obj.complaint_type_tree |
||||
|
description = obj.description_tree |
||||
|
complaint_text = complaint.complaint_type + ", " + complaint_text |
||||
|
if description.description: |
||||
|
description_text = description.description + ", " + description_text |
||||
|
else: |
||||
|
for obj in complaint_id: |
||||
|
complaint = obj.complaint_type_tree |
||||
|
complaint_text = complaint.complaint_type + ", " + complaint_text |
||||
|
data = { |
||||
|
'ids': self.ids, |
||||
|
'model': self._name, |
||||
|
'date_today': date_today, |
||||
|
'date_request': self.date_request, |
||||
|
'date_return': self.return_date, |
||||
|
'sev_id': self.name, |
||||
|
'warranty': self.is_in_warranty, |
||||
|
'customer_name': self.person_name.name, |
||||
|
'imei_no': self.imei_no, |
||||
|
'technician': self.technician_name.name, |
||||
|
'complaint_types': complaint_text, |
||||
|
'complaint_description': description_text, |
||||
|
'mobile_brand': self.brand_name.brand_name, |
||||
|
'model_name': self.model_name.mobile_brand_models} |
||||
|
return self.env.ref( |
||||
|
'mobile_service_shop.mobile_service_ticket').report_action(self, |
||||
|
data=data) |
@ -0,0 +1,69 @@ |
|||||
|
# -*- coding: utf-8 -*- |
||||
|
############################################################################# |
||||
|
# |
||||
|
# Cybrosys Technologies Pvt. Ltd. |
||||
|
# |
||||
|
# Copyright (C) 2024-TODAY Cybrosys Technologies(<https://www.cybrosys.com>) |
||||
|
# Author:Jumana Jabin MP (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 |
||||
|
# GENERAL PUBLIC LICENSE (LGPL v3) along with this program. |
||||
|
# If not, see <http://www.gnu.org/licenses/>. |
||||
|
# |
||||
|
############################################################################# |
||||
|
from odoo import api, fields, models, _ |
||||
|
|
||||
|
|
||||
|
class ProductOrderLine(models.Model): |
||||
|
"""Model for managing product order lines in mobile service operations.""" |
||||
|
_name = 'product.order.line' |
||||
|
_description = 'Product Order Line' |
||||
|
|
||||
|
product_order_id = fields.Many2one('mobile.service', |
||||
|
help="Reference to the related mobile " |
||||
|
"service order to which this product" |
||||
|
" order line belongs.") |
||||
|
product_id = fields.Many2one('product.product', string='Product', |
||||
|
domain="[('is_a_parts','=', True)]", |
||||
|
help="Product ID of the product.", |
||||
|
required=True) |
||||
|
product_uom_qty = fields.Float(string='Used Quantity', default=1.0, |
||||
|
help="Choose a quantity to use.", |
||||
|
required=True) |
||||
|
price_unit = fields.Float(string='Unit Price', default=0.0, required=True, |
||||
|
help="Price of the product.") |
||||
|
qty_invoiced = fields.Float(string='Invoiced Qty', readonly=True, |
||||
|
help="Number of invoice created.") |
||||
|
qty_stock_move = fields.Float(string='Stock Move Posted Qty', readonly=True, |
||||
|
help="Count of stock move.") |
||||
|
part_price = fields.Char(compute='_compute_part_price', string='Price', |
||||
|
readonly=True, store=True, help="Price for the " |
||||
|
"part.") |
||||
|
product_uom = fields.Char(string='Unit of Measure', required=True, |
||||
|
help="Unit of measure of the product.") |
||||
|
stock_number = fields.Char(string="Picking", help="Stock move picking name", |
||||
|
readonly=True) |
||||
|
|
||||
|
@api.onchange('product_id') |
||||
|
def change_prod(self): |
||||
|
"""It will return the product price and the unit of measurement""" |
||||
|
self.ensure_one() |
||||
|
if self.product_id: |
||||
|
product_template_obj = self.product_id.product_tmpl_id |
||||
|
self.price_unit = product_template_obj.list_price |
||||
|
self.product_uom = product_template_obj.uom_id.name |
||||
|
|
||||
|
@api.depends('product_uom_qty', 'product_id') |
||||
|
def _compute_part_price(self): |
||||
|
"""Compute the amount of part price""" |
||||
|
for line in self: |
||||
|
price = line.price_unit * line.product_uom_qty |
||||
|
line.update({'part_price': price}) |
@ -0,0 +1,39 @@ |
|||||
|
# -*- coding: utf-8 -*- |
||||
|
############################################################################# |
||||
|
# |
||||
|
# Cybrosys Technologies Pvt. Ltd. |
||||
|
# |
||||
|
# Copyright (C) 2024-TODAY Cybrosys Technologies(<https://www.cybrosys.com>) |
||||
|
# Author:Jumana Jabin MP (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 |
||||
|
# 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): |
||||
|
"""Inherits the model product.template to extend and add fields""" |
||||
|
_inherit = 'product.template' |
||||
|
|
||||
|
is_a_parts = fields.Boolean( |
||||
|
'Is a Mobile Part', default=False, |
||||
|
help="Specify if the product is a mobile part or not.") |
||||
|
brand_name = fields.Many2one('mobile.brand', string="Brand", |
||||
|
help="Select a mobile brand for the part.") |
||||
|
model_name = fields.Many2one('brand.model', string="Model Name", |
||||
|
domain="[('mobile_brand_name','=',brand_name)]", |
||||
|
help="Select a model for the part.") |
||||
|
model_colour = fields.Char(string="Colour", help="Colour for the part.") |
||||
|
extra_descriptions = fields.Text(string="Note", help="Extra description " |
||||
|
"for the part.") |
@ -0,0 +1,46 @@ |
|||||
|
# -*- coding: utf-8 -*- |
||||
|
############################################################################# |
||||
|
# |
||||
|
# Cybrosys Technologies Pvt. Ltd. |
||||
|
# |
||||
|
# Copyright (C) 2024-TODAY Cybrosys Technologies(<https://www.cybrosys.com>) |
||||
|
# Author:Jumana Jabin MP (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 |
||||
|
# GENERAL PUBLIC LICENSE (LGPL v3) along with this program. |
||||
|
# If not, see <http://www.gnu.org/licenses/>. |
||||
|
# |
||||
|
############################################################################# |
||||
|
from odoo import api, models |
||||
|
|
||||
|
|
||||
|
class MobileServiceTicket(models.AbstractModel): |
||||
|
"""Mobile service ticket report abstract model""" |
||||
|
_name = 'report.mobile_service_shop.mobile_service_ticket_template' |
||||
|
|
||||
|
@api.model |
||||
|
def _get_report_values(self, docids, data): |
||||
|
"""Returns the data file for the report""" |
||||
|
terms = self.env['terms.conditions'].search([]) |
||||
|
return { |
||||
|
'date_today': data['date_today'], |
||||
|
'date_request': data['date_request'], |
||||
|
'date_return': data['date_return'], |
||||
|
'sev_id': data['sev_id'], |
||||
|
'imei_no': data['imei_no'], |
||||
|
'technician': data['technician'], |
||||
|
'complaint_types': data['complaint_types'], |
||||
|
'complaint_description': data['complaint_description'], |
||||
|
'mobile_brand': data['mobile_brand'], |
||||
|
'model_name': data['model_name'], |
||||
|
'customer_name': data['customer_name'], |
||||
|
'warranty': data['warranty'], |
||||
|
'terms': terms} |
@ -0,0 +1,41 @@ |
|||||
|
# -*- coding: utf-8 -*- |
||||
|
############################################################################# |
||||
|
# |
||||
|
# Cybrosys Technologies Pvt. Ltd. |
||||
|
# |
||||
|
# Copyright (C) 2024-TODAY Cybrosys Technologies(<https://www.cybrosys.com>) |
||||
|
# Author:Jumana Jabin MP (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 |
||||
|
# GENERAL PUBLIC LICENSE (LGPL v3) along with this program. |
||||
|
# If not, see <http://www.gnu.org/licenses/>. |
||||
|
# |
||||
|
############################################################################# |
||||
|
from odoo import fields, models |
||||
|
|
||||
|
|
||||
|
class TermsConditions(models.Model): |
||||
|
"""Used to add the Mobile Service Terms and Conditions""" |
||||
|
_name = 'terms.conditions' |
||||
|
_description = 'Terms and Conditions' |
||||
|
_inherit = ['mail.thread', 'mail.activity.mixin'] |
||||
|
_rec_name = 'terms_id' |
||||
|
|
||||
|
terms_id = fields.Char(String="Terms and condition", |
||||
|
compute="_compute_terms_id", help="this will be " |
||||
|
"the terms id.") |
||||
|
terms_conditions = fields.Text(string="Terms and Conditions", |
||||
|
help="this will be the terms and " |
||||
|
"conditions space.") |
||||
|
|
||||
|
def _compute_terms_id(self): |
||||
|
"""Return the terms ID""" |
||||
|
self.terms_id = self.id or '' |
@ -0,0 +1,118 @@ |
|||||
|
<?xml version="1.0" encoding="utf-8"?> |
||||
|
<odoo> |
||||
|
<!-- Mobile service template--> |
||||
|
<template id="mobile_service_ticket_template"> |
||||
|
<t t-call="web.external_layout"> |
||||
|
<t t-call="web.html_container"> |
||||
|
<div class="page"> |
||||
|
<br/> |
||||
|
<div class="row" style="margin-bottom:40px; text-align:center;margin-left:5%;margin-top:2%;"> |
||||
|
<h3> |
||||
|
<strong>Service Ticket</strong> |
||||
|
</h3> |
||||
|
</div> |
||||
|
<div class="col-xs-6" style="margin-left:-5%; text-align:center;"> |
||||
|
<table style="margin-left:5%;width:95%;border:1px solid black;line-height:2;text-align:center;"> |
||||
|
<tbody> |
||||
|
<tr> |
||||
|
<td> |
||||
|
<strong>Ref no:</strong> |
||||
|
</td> |
||||
|
<td> |
||||
|
<strong> <span style="font-size:16px; font-weight:2px;" t-esc="sev_id"/> |
||||
|
</strong> |
||||
|
</td> |
||||
|
<td> |
||||
|
<strong>Customer name: </strong> |
||||
|
</td> |
||||
|
<td> <span t-esc="customer_name"/> |
||||
|
</td> |
||||
|
</tr> |
||||
|
</tbody> |
||||
|
</table> |
||||
|
</div> |
||||
|
<div class="col-xs-6" style="margin-left:-5%; text-align:center;"> |
||||
|
<table style="margin-left:5%;width:95%;border:1px solid black;line-height:2;text-align:center;"> |
||||
|
<tbody style="line-height:2"> |
||||
|
<tr> |
||||
|
<td style="margin-right:10%;"> |
||||
|
<strong>Requested date: </strong> |
||||
|
</td> |
||||
|
<td> <span t-esc="date_request"/> |
||||
|
</td> |
||||
|
<td style="margin-right:10%;"> |
||||
|
<strong>Return date: </strong> |
||||
|
</td> |
||||
|
<td> <span t-esc="date_return"/> |
||||
|
</td> |
||||
|
</tr> |
||||
|
</tbody> |
||||
|
</table> |
||||
|
</div> |
||||
|
<div class="col-xs-6" style="margin-top:10%;margin-left:5%; text-align:center;"> |
||||
|
<h2>Device details</h2> |
||||
|
</div> |
||||
|
<table style="margin-top:5%;margin-left:5%;width:95%;border:1px solid black;line-height:2;text-align:center;"> |
||||
|
<thead style="background-color:#c9cacc;font-size:15px;"> |
||||
|
<tr> |
||||
|
<td>Sl no.</td> |
||||
|
<td>Device brand</td> |
||||
|
<td>Model name</td> |
||||
|
<td>IMEI</td> |
||||
|
<td>Complaints</td> |
||||
|
<td>Description</td> |
||||
|
</tr> |
||||
|
</thead> |
||||
|
<tbody> |
||||
|
<tr> |
||||
|
<td>1</td> |
||||
|
<td> |
||||
|
<t t-esc="mobile_brand"/> |
||||
|
</td> |
||||
|
<td> |
||||
|
<t t-esc="model_name"/> |
||||
|
</td> |
||||
|
<td> |
||||
|
<t t-esc="imei_no"/> |
||||
|
</td> |
||||
|
<td> |
||||
|
<t t-esc="complaint_types"/> |
||||
|
</td> |
||||
|
<td> |
||||
|
<t t-esc="complaint_description"/> |
||||
|
</td> |
||||
|
</tr> |
||||
|
</tbody> |
||||
|
</table> |
||||
|
</div> |
||||
|
<div style="margin-top:10px;"> |
||||
|
<t t-if="warranty==True"> |
||||
|
<span>The device is in warranty range !!</span> |
||||
|
</t> |
||||
|
</div> |
||||
|
<div style="margin-top:30px;"> |
||||
|
<h5> |
||||
|
<strong>Terms and Conditions</strong> |
||||
|
</h5> |
||||
|
<t t-if="terms"> |
||||
|
<t t-foreach="terms" t-as="term"> |
||||
|
<span> |
||||
|
<t t-esc="term.terms_conditions"/> |
||||
|
<br/> |
||||
|
</span> |
||||
|
</t> |
||||
|
</t> |
||||
|
<t t-else=""> |
||||
|
<span t-esc="'Services provided are subject to a 10 warranty on parts, with no liability for data loss or damages beyond pre-existing conditions, and full payment is required upon completion.'"/> |
||||
|
</t> |
||||
|
</div> |
||||
|
<div style="margin-top:200px;"> |
||||
|
<span>Keep this ticket safely for future reference.</span> |
||||
|
<br/> |
||||
|
<span>Issue Date :</span> |
||||
|
<t t-esc="date_today"/> |
||||
|
</div> |
||||
|
</t> |
||||
|
</t> |
||||
|
</template> |
||||
|
</odoo> |
@ -0,0 +1,13 @@ |
|||||
|
<?xml version="1.0" encoding="UTF-8"?> |
||||
|
<odoo> |
||||
|
<!-- Service ticket report action--> |
||||
|
<data noupdate="0"> |
||||
|
<record id="mobile_service_ticket" model="ir.actions.report"> |
||||
|
<field name="name">Mobile Service Ticket</field> |
||||
|
<field name="model">mobile.service</field> |
||||
|
<field name="report_type">qweb-pdf</field> |
||||
|
<field name="report_name">mobile_service_shop.mobile_service_ticket_template</field> |
||||
|
<field name="report_file">mobile_service_shop.mobile_service_ticket_template</field> |
||||
|
</record> |
||||
|
</data> |
||||
|
</odoo> |
|
@ -0,0 +1,35 @@ |
|||||
|
<?xml version="1.0" encoding="UTF-8"?> |
||||
|
<odoo> |
||||
|
<!--Mobile service sequence--> |
||||
|
<record id="mobile_service_execute" model="ir.module.category"> |
||||
|
<field name="name">Mobile Service</field> |
||||
|
<field name="sequence">5</field> |
||||
|
</record> |
||||
|
<!--Mobile service user group creation--> |
||||
|
<record id="mobile_service_group_executer" model="res.groups"> |
||||
|
<field name="name">Mobile Technician</field> |
||||
|
<field name="implied_ids" eval="[(4, ref('base.group_user'))]"/> |
||||
|
<field name="category_id" ref="mobile_service_execute"/> |
||||
|
</record> |
||||
|
<!--Mobile service manager group creation--> |
||||
|
<record id="mobile_service_group_manager" model="res.groups"> |
||||
|
<field name="name">Manager</field> |
||||
|
<field name="implied_ids" eval="[(4, ref('mobile_service_group_executer'))]"/> |
||||
|
<field name="category_id" ref="mobile_service_execute"/> |
||||
|
<field name="users" eval="[(4, ref('base.user_admin')), (4, ref('base.user_root'))]"/> |
||||
|
</record> |
||||
|
<!--Mobile service record rule creation--> |
||||
|
<record id="mobile_service_tech_rules" model="ir.rule"> |
||||
|
<field name="name">Mobile Service rule</field> |
||||
|
<field name="model_id" ref="model_mobile_service" /> |
||||
|
<field name="domain_force">[('technician_name','=',user.id),('service_state','!=','draft'), ('company_id','=',user.company_id.id)]</field> |
||||
|
<field name="groups" eval="[(4,ref('mobile_service_group_executer'))]"/> |
||||
|
</record> |
||||
|
<!--Mobile service manager group rule creation--> |
||||
|
<record id="mobile_service_rule_manager" model="ir.rule"> |
||||
|
<field name="name">Mobile Service Manager rule</field> |
||||
|
<field name="model_id" ref="model_mobile_service" /> |
||||
|
<field name="domain_force">[('company_id','=',user.company_id.id)]</field> |
||||
|
<field name="groups" eval="[(4,ref('mobile_service_group_manager'))]"/> |
||||
|
</record> |
||||
|
</odoo> |
After Width: | Height: | Size: 2.2 KiB |
After Width: | Height: | Size: 28 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: 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: 912 KiB |
After Width: | Height: | Size: 1.3 MiB |
After Width: | Height: | Size: 46 KiB |
After Width: | Height: | Size: 44 KiB |
After Width: | Height: | Size: 46 KiB |
After Width: | Height: | Size: 85 KiB |
After Width: | Height: | Size: 79 KiB |
After Width: | Height: | Size: 83 KiB |
After Width: | Height: | Size: 116 KiB |
After Width: | Height: | Size: 69 KiB |
After Width: | Height: | Size: 110 KiB |
After Width: | Height: | Size: 111 KiB |
After Width: | Height: | Size: 120 KiB |