diff --git a/game_sudoku/README.rst b/game_sudoku/README.rst
new file mode 100644
index 000000000..460677fd1
--- /dev/null
+++ b/game_sudoku/README.rst
@@ -0,0 +1,20 @@
+Odoo Games - Sudoku v11
+=======================
+ The classic Sudoku game involves a grid of 81 squares. The grid is divided into nine blocks,
+each containing nine squares.
+ The rules of the game are simple:
+Each of the nine blocks has to contain all the numbers 1-9 within its squares. Each number can
+only appear once in a row, column or box.
+ You can select the squares by clicking. Enter the numbers.
+
+Space button is use to erase the entry.
+
+Features
+========
+
+* We can play SUDOKU Game.
+* Play only By the approval of HR Manager.
+
+Credits
+=======
+Nikhil Krishnan @ nikhilkrishnan0101@gmail.com
\ No newline at end of file
diff --git a/game_sudoku/__init__.py b/game_sudoku/__init__.py
new file mode 100644
index 000000000..934aa716d
--- /dev/null
+++ b/game_sudoku/__init__.py
@@ -0,0 +1,25 @@
+# -*- coding: utf-8 -*-
+
+##############################################################################
+#
+# Cybrosys Technologies Pvt. Ltd.
+# Copyright (C) 2017-TODAY Cybrosys Technologies().
+# Author: Nikhil krishnan()
+# you can modify it under the terms of the GNU LESSER
+# GENERAL PUBLIC LICENSE (LGPL v3), Version 3.
+#
+# It is forbidden to publish, distribute, sublicense, or sell copies
+# of the Software or modified copies of the Software.
+#
+# 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 .
+#
+##############################################################################
+
+from . import models
diff --git a/game_sudoku/__manifest__.py b/game_sudoku/__manifest__.py
new file mode 100644
index 000000000..5bbec0351
--- /dev/null
+++ b/game_sudoku/__manifest__.py
@@ -0,0 +1,49 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+# Author: Nikhil krishnan(nikhilkrishnan0101@gmail.com)
+# you can modify it under the terms of the GNU LESSER
+# GENERAL PUBLIC LICENSE (LGPL v3), Version 3.
+#
+# It is forbidden to publish, distribute, sublicense, or sell copies
+# of the Software or modified copies of the Software.
+#
+# 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 .
+#
+##############################################################################
+
+{
+ 'name': 'Odoo Games - Sudoku',
+ 'version': '11.0.1.0.0',
+ 'summary': """Sudoku Game.""",
+ 'description': """We can play SUDOKU.""",
+ 'author': 'Cybrosys Techno Solutions',
+ 'company': 'Cybrosys Techno Solutions',
+ 'website': 'http://www.cybrosys.com',
+ 'category': '',
+ 'depends': ['base', 'hr', 'hr_attendance'],
+ 'license': 'LGPL-3',
+ 'data': [
+ 'security/security_data.xml',
+ 'security/ir.model.access.csv',
+ 'views/game_approve_sequence.xml',
+ 'views/game_template.xml',
+ 'views/main_menu.xml',
+ 'views/sudoku_menu.xml',
+ ],
+ 'demo': [],
+ 'qweb': [
+ "static/src/xml/sudoku.xml",
+ "static/src/xml/game.xml",
+ ],
+ 'images': ['static/description/banner.jpg'],
+ 'installable': True,
+ 'auto_install': False,
+}
diff --git a/game_sudoku/models/__init__.py b/game_sudoku/models/__init__.py
new file mode 100644
index 000000000..ddeef43e7
--- /dev/null
+++ b/game_sudoku/models/__init__.py
@@ -0,0 +1,26 @@
+# -*- coding: utf-8 -*-
+
+##############################################################################
+#
+# Cybrosys Technologies Pvt. Ltd.
+# Copyright (C) 2017-TODAY Cybrosys Technologies().
+# Author: Nikhil krishnan()
+# you can modify it under the terms of the GNU LESSER
+# GENERAL PUBLIC LICENSE (LGPL v3), Version 3.
+#
+# It is forbidden to publish, distribute, sublicense, or sell copies
+# of the Software or modified copies of the Software.
+#
+# 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 .
+#
+##############################################################################
+
+from . import game
+
diff --git a/game_sudoku/models/game.py b/game_sudoku/models/game.py
new file mode 100644
index 000000000..a57b9d0ad
--- /dev/null
+++ b/game_sudoku/models/game.py
@@ -0,0 +1,75 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+# Cybrosys Technologies Pvt. Ltd.
+# Copyright (C) 2017-TODAY Cybrosys Technologies().
+# Author: Nikhil krishnan()
+# you can modify it under the terms of the GNU LESSER
+# GENERAL PUBLIC LICENSE (LGPL v3), Version 3.
+#
+# It is forbidden to publish, distribute, sublicense, or sell copies
+# of the Software or modified copies of the Software.
+#
+# 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 .
+#
+##############################################################################
+
+from datetime import datetime
+from odoo import models, fields
+
+
+class EntertainmentGames(models.Model):
+ _name = 'employee.game.approve'
+ _order = 'sequence desc'
+
+ name = fields.Char(string='Name', related='employee_id.name')
+ approve_datetime = fields.Datetime(string='Datetime', readonly=1)
+ employee_id = fields.Many2one('hr.employee', string='Employee', required=True)
+ user_id = fields.Many2one('res.users', string='User')
+ department_id = fields.Many2one('hr.department', string='Department', related='employee_id.department_id')
+ game_user = fields.Boolean(string='Is Game User')
+ state = fields.Selection([
+ ('draft', 'Requested'),
+ ('approve', 'Approved'),
+ ('cancel', 'Cancelled'),
+ ], string='Status', readonly=True, copy=False, default='draft')
+ sequence = fields.Integer('Sequence')
+
+ def create_employee_game_approve(self, empl_id, user):
+ rec = self.search([('employee_id', '=', empl_id)])
+ if rec:
+ seq = self.env['ir.sequence'].next_by_code('employee.game')
+ rec.write({'sequence': seq, 'state': 'draft', 'approve_datetime': datetime.now()})
+ else:
+ vals = {
+ 'employee_id': empl_id,
+ 'user_id': user,
+ 'approve_datetime': datetime.now(),
+ 'sequence': self.env['ir.sequence'].next_by_code('employee.game')
+ }
+ self.create(vals)
+
+ def approve(self):
+ group_game_approve = self.env.ref('game_sudoku.odoo_gamer_group', False)
+ group_game_approve.write({'users': [(4, self.user_id.id)]})
+
+ group_game_req = self.env.ref('game_sudoku.odoo_gamer_approve_req', False)
+ group_game_req.write({'users': [(3, self.user_id.id)]})
+
+ return self.write({'game_user': True, 'state': 'approve'})
+
+ def cancel(self):
+ group_game_approve = self.env.ref('game_sudoku.odoo_gamer_group', False)
+ group_game_approve.write({'users': [(3, self.user_id.id)]})
+
+ group_game_req = self.env.ref('game_sudoku.odoo_gamer_approve_req', False)
+ group_game_req.write({'users': [(4, self.user_id.id)]})
+
+ return self.write({'game_user': False, 'state': 'cancel'})
diff --git a/game_sudoku/security/ir.model.access.csv b/game_sudoku/security/ir.model.access.csv
new file mode 100644
index 000000000..e4a1c9915
--- /dev/null
+++ b/game_sudoku/security/ir.model.access.csv
@@ -0,0 +1,4 @@
+id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
+
+access_game_gamer,employee.game.approve.user,game_sudoku.model_employee_game_approve,base.group_user,1,1,1,0
+access_game_gamer_manager,employee.game.approve.manager,game_sudoku.model_employee_game_approve,hr.group_hr_manager,1,1,1,1
diff --git a/game_sudoku/security/security_data.xml b/game_sudoku/security/security_data.xml
new file mode 100644
index 000000000..5a6b4f142
--- /dev/null
+++ b/game_sudoku/security/security_data.xml
@@ -0,0 +1,26 @@
+
+
+
+
+ Game
+ 10
+
+
+
+
+ Odoo Gamer
+
+
+
+
+ Odoo Game Request
+
+
+
+
+
+
+
+
+
+
diff --git a/game_sudoku/static/description/Game Request.png b/game_sudoku/static/description/Game Request.png
new file mode 100644
index 000000000..f98af56af
Binary files /dev/null and b/game_sudoku/static/description/Game Request.png differ
diff --git a/game_sudoku/static/description/Just wait for approval.png b/game_sudoku/static/description/Just wait for approval.png
new file mode 100644
index 000000000..410f2f4ec
Binary files /dev/null and b/game_sudoku/static/description/Just wait for approval.png differ
diff --git a/game_sudoku/static/description/Level.png b/game_sudoku/static/description/Level.png
new file mode 100644
index 000000000..512e1ee5d
Binary files /dev/null and b/game_sudoku/static/description/Level.png differ
diff --git a/game_sudoku/static/description/May i play.png b/game_sudoku/static/description/May i play.png
new file mode 100644
index 000000000..df84a5e2a
Binary files /dev/null and b/game_sudoku/static/description/May i play.png differ
diff --git a/game_sudoku/static/description/Sudoku.png b/game_sudoku/static/description/Sudoku.png
new file mode 100644
index 000000000..f88651465
Binary files /dev/null and b/game_sudoku/static/description/Sudoku.png differ
diff --git a/game_sudoku/static/description/banner.jpg b/game_sudoku/static/description/banner.jpg
new file mode 100644
index 000000000..0fd479eb1
Binary files /dev/null and b/game_sudoku/static/description/banner.jpg differ
diff --git a/game_sudoku/static/description/color code.png b/game_sudoku/static/description/color code.png
new file mode 100644
index 000000000..d0e8465d0
Binary files /dev/null and b/game_sudoku/static/description/color code.png differ
diff --git a/game_sudoku/static/description/cybro_logo.png b/game_sudoku/static/description/cybro_logo.png
new file mode 100644
index 000000000..bb309114c
Binary files /dev/null and b/game_sudoku/static/description/cybro_logo.png differ
diff --git a/game_sudoku/static/description/icon.png b/game_sudoku/static/description/icon.png
new file mode 100644
index 000000000..e34faf824
Binary files /dev/null and b/game_sudoku/static/description/icon.png differ
diff --git a/game_sudoku/static/description/index.html b/game_sudoku/static/description/index.html
new file mode 100644
index 000000000..ba975e9d9
--- /dev/null
+++ b/game_sudoku/static/description/index.html
@@ -0,0 +1,192 @@
+
+
+
+
diff --git a/game_sudoku/views/game_approve_sequence.xml b/game_sudoku/views/game_approve_sequence.xml
new file mode 100644
index 000000000..52371cfed
--- /dev/null
+++ b/game_sudoku/views/game_approve_sequence.xml
@@ -0,0 +1,9 @@
+
+
+
+
+ Game Approve
+ employee.game
+
+
+
\ No newline at end of file
diff --git a/game_sudoku/views/game_template.xml b/game_sudoku/views/game_template.xml
new file mode 100644
index 000000000..d9ffad93d
--- /dev/null
+++ b/game_sudoku/views/game_template.xml
@@ -0,0 +1,13 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/game_sudoku/views/main_menu.xml b/game_sudoku/views/main_menu.xml
new file mode 100644
index 000000000..1b4ad3dd5
--- /dev/null
+++ b/game_sudoku/views/main_menu.xml
@@ -0,0 +1,48 @@
+
+
+
+
+ Game Approval
+ entertainment_games_my_game
+ main
+
+
+
+ employee.game.approve.tree
+ employee.game.approve
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Game Approval
+ ir.actions.act_window
+ employee.game.approve
+ form
+ tree
+
+
+
+
+
+
+
+
+
+
diff --git a/game_sudoku/views/sudoku_menu.xml b/game_sudoku/views/sudoku_menu.xml
new file mode 100644
index 000000000..0be3978ed
--- /dev/null
+++ b/game_sudoku/views/sudoku_menu.xml
@@ -0,0 +1,14 @@
+
+
+
+
+ Sudoku
+ entertainment_games_sudoku
+ main
+
+
+
+
+
diff --git a/quotation_handler/README.rst b/quotation_handler/README.rst
new file mode 100644
index 000000000..a3f4632b5
--- /dev/null
+++ b/quotation_handler/README.rst
@@ -0,0 +1,19 @@
+Quotation Revised History v10
+=============================
+The clients will require negotiations whenever we sent a quotation to them.In such cases we need to edit the
+Quotation's order lines. We have included the 'Revise the Quotation' button for it. The order lines can be edited
+by a click on this button. At the same time a history or copy of the quotation will also be generated automatically.
+We can track the history using the smart buttons.
+Every quotations have a expiration date which we set manually.On configuring the above shown settings we can
+automatically set the expiration date very easily.
+
+Features
+========
+
+* Retrieve the History of Revised Quotations.
+* Automatically Set Expiration Date For Quotation.
+* Email Template Contains The Expiration Date.
+
+Credits
+=======
+Nikhil Krishnan @ cybrosys, nikhil@cybrosys.in
\ No newline at end of file
diff --git a/quotation_handler/__init__.py b/quotation_handler/__init__.py
new file mode 100644
index 000000000..b4f5efdab
--- /dev/null
+++ b/quotation_handler/__init__.py
@@ -0,0 +1,23 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+# Copyright (C) 2018-TODAY NIKHIL KRISHNAN(nikhilkrishnan0101@gmail.com).
+# Author: Nikhil krishnan(nikhilkrishnan0101@gmail.com)
+# you can modify it under the terms of the GNU LESSER
+# GENERAL PUBLIC LICENSE (LGPL v3), Version 3.
+#
+# It is forbidden to publish, distribute, sublicense, or sell copies
+# of the Software or modified copies of the Software.
+#
+# 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 .
+#
+##############################################################################
+
+from . import models
diff --git a/quotation_handler/__manifest__.py b/quotation_handler/__manifest__.py
new file mode 100644
index 000000000..687b4bde5
--- /dev/null
+++ b/quotation_handler/__manifest__.py
@@ -0,0 +1,44 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+# Copyright (C) 2018-TODAY NIKHIL KRISHNAN(nikhilkrishnan0101@gmail.com).
+# Author: Nikhil krishnan(nikhilkrishnan0101@gmail.com)
+# you can modify it under the terms of the GNU LESSER
+# GENERAL PUBLIC LICENSE (LGPL v3), Version 3.
+#
+# It is forbidden to publish, distribute, sublicense, or sell copies
+# of the Software or modified copies of the Software.
+#
+# 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 .
+#
+##############################################################################
+
+{
+ 'name': 'Quotation Revised History',
+ 'version': '11.0.1.0.0',
+ 'summary': """We Can Retrieve the History of Revised Quotations.""",
+ 'description': """ Negotiations with clients and we resent multiple Quotations,
+ This module store the History of Every Quotations""",
+ 'author': 'Cybrosys Techno Solutions',
+ 'company': 'Cybrosys Techno Solutions',
+ 'website': 'http://www.cybrosys.com',
+ 'category': 'Sales Management',
+ 'depends': ['sale'],
+ 'license': 'LGPL-3',
+ 'data': [
+ 'views/quotation_handler.xml',
+ 'views/sale_config_settings_exp_date_views.xml',
+ 'data/mail_template_data_exp_date.xml',
+ ],
+ 'demo': [],
+ 'images': ['static/description/banner.jpg'],
+ 'installable': True,
+ 'auto_install': False,
+}
diff --git a/quotation_handler/data/mail_template_data_exp_date.xml b/quotation_handler/data/mail_template_data_exp_date.xml
new file mode 100644
index 000000000..8bbb8710b
--- /dev/null
+++ b/quotation_handler/data/mail_template_data_exp_date.xml
@@ -0,0 +1,69 @@
+
+
+
+
+
+ Sales Order - Send by Email
+ ${(object.user_id.email and '"%s" <%s>' % (object.user_id.name, object.user_id.email) or '')|safe}
+ ${object.company_id.name} ${object.state in ('draft','pre', 'sent') and 'Quotation' or 'Order'} (Ref ${object.name or 'n/a' })
+ ${object.partner_id.id}
+
+
+
+ ${(object.name or '').replace('/','_')}${object.state == 'draft' and '_draft' or ''}
+ ${object.partner_id.lang}
+ Dear ${object.partner_id.name}
+% set access_action = object.with_context(force_website=True).get_access_action()
+% set is_online = access_action and access_action['type'] == 'ir.actions.act_url'
+% set doc_name = 'quotation' if object.state in ('draft','pre', 'sent') else 'order confirmation'
+% set pay_sign_name = object.get_portal_confirmation_action()
+% set access_name = is_online and object.state in ('draft', 'pre', 'sent') and pay_sign_name in ('pay', 'sign') and 'Accept and %s online' % pay_sign_name or 'View %s' % doc_name
+% set access_url = is_online and object.get_mail_url() or ''
+
+% if object.partner_id.parent_id:
+ (${object.partner_id.parent_id.name})
+% endif
+,
+
+Here is
+% if ctx.get('proforma')
+in attachment, your pro-forma invoice
+% else
+the ${doc_name} ${object.name}
+% endif
+% if object.origin:
+(with reference: ${object.origin} )
+% endif
+amounting in ${format_amount(object.amount_total, object.currency_id)}
+from ${object.company_id.name}.
+
+
+% endif
+
+% if object.state == "pre" or object.state == "draft" or object.state == "sent" :
+ % if object.validity_date:
+
Your quotation will expire on ${object.validity_date}.
+ % endif
+% endif
+
+
You can reply to this email if you have any questions.
+
Thank you,
+
+
+% if object.user_id and object.user_id.signature:
+ ${object.user_id.signature | safe}
+% endif
+
+]]>
+
+
+
diff --git a/quotation_handler/models/__init__.py b/quotation_handler/models/__init__.py
new file mode 100644
index 000000000..979cdfbda
--- /dev/null
+++ b/quotation_handler/models/__init__.py
@@ -0,0 +1,24 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+# Copyright (C) 2018-TODAY NIKHIL KRISHNAN(nikhilkrishnan0101@gmail.com).
+# Author: Nikhil krishnan(nikhilkrishnan0101@gmail.com)
+# you can modify it under the terms of the GNU LESSER
+# GENERAL PUBLIC LICENSE (LGPL v3), Version 3.
+#
+# It is forbidden to publish, distribute, sublicense, or sell copies
+# of the Software or modified copies of the Software.
+#
+# 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 .
+#
+##############################################################################
+
+from . import sale
+from . import sale_config_settings_exp_date_views
diff --git a/quotation_handler/models/sale.py b/quotation_handler/models/sale.py
new file mode 100644
index 000000000..96c767891
--- /dev/null
+++ b/quotation_handler/models/sale.py
@@ -0,0 +1,144 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+# Copyright (C) 2018-TODAY NIKHIL KRISHNAN(nikhilkrishnan0101@gmail.com).
+# Author: Nikhil krishnan(nikhilkrishnan0101@gmail.com)
+# you can modify it under the terms of the GNU LESSER
+# GENERAL PUBLIC LICENSE (LGPL v3), Version 3.
+#
+# It is forbidden to publish, distribute, sublicense, or sell copies
+# of the Software or modified copies of the Software.
+#
+# 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 .
+#
+##############################################################################
+
+from odoo import models, fields, api, _
+from datetime import timedelta, datetime
+
+
+class SaleOrder(models.Model):
+ _inherit = 'sale.order'
+
+ name = fields.Char(string='Order Reference', required=True, copy=False, readonly=True,
+ index=True, default='New')
+ parent_so_id = fields.Many2one('sale.order', 'Parent SO', copy=False)
+ revised_order_count = fields.Integer(string='# of Revised Orders', compute='_revised_count')
+ validity_date = fields.Date(string='Expiration Date', readonly=True, states={'draft': [('readonly', False)],
+ 'pre': [('readonly', False)]},
+ help="Automatically expiration date of your quotation (offer) will set as 14 days "
+ "later, or it will set the date automatically based on the settings, We can set "
+ "it manually too.")
+
+ state = fields.Selection([
+ ('pre', 'Revised Quotation'),
+ ('draft', 'Quotation'),
+ ('sent', 'Quotation Sent'),
+ ('revised', 'Revised'),
+ ('sale', 'Sale Order'),
+ ('done', 'Done'),
+ ('cancel', 'Cancelled'),
+ ], string='Status', readonly=True, copy=False, index=True, track_visibility='onchange', default='draft')
+ revision_number = fields.Integer(string='Revision', copy=False, default=1)
+ org_name = fields.Char(string='Origin', copy=False)
+
+ @api.model
+ def create(self, vals):
+ date_type = self.env['ir.config_parameter'].sudo().get_param('quotation_handler.so_expiration_date'),
+ date_start = self.env['ir.config_parameter'].sudo().get_param('quotation_handler.so_expiration_date_start'),
+ if int(date_type[0]):
+ if not int(date_start[0]):
+ if 'validity_date' in vals:
+ if vals.get('validity_date'):
+ pass
+ else:
+ date_no = self.env['ir.config_parameter'].sudo().get_param('quotation_handler.so_expiration_date_no')
+ date_today = fields.Date.today()
+ date_object = datetime.strptime(date_today, '%Y-%m-%d')
+ if not int(date_no):
+ pass
+ else:
+ v_date = date_object + timedelta(days=int(date_no))
+ vals['validity_date'] = v_date
+ return super(SaleOrder, self).create(vals)
+
+ @api.multi
+ def _revised_count(self):
+ for sale in self:
+ revised_count = sale.search([('parent_so_id', '=', sale.id)])
+ sale.revised_order_count = len(revised_count)
+
+ # ********************Overwrite the print button to give expiration date********************
+ @api.multi
+ def print_quotation(self):
+ is_date = int(self.env['ir.config_parameter'].sudo().get_param('quotation_handler.so_expiration_date'))
+ date_start = int(self.env['ir.config_parameter'].sudo().get_param('quotation_handler.so_expiration_date_start'))
+ date_no = int(self.env['ir.config_parameter'].sudo().get_param('quotation_handler.so_expiration_date_no'))
+ if is_date:
+ if date_start:
+ if date_no:
+ for doc in self:
+ if doc.state in ['pre', 'draft']:
+ date_today = fields.Date.today()
+ date_object = datetime.strptime(date_today, '%Y-%m-%d')
+ v_date = date_object + timedelta(days=date_no)
+ doc.validity_date = v_date
+ self.filtered(lambda s: s.state == 'pre').write({'state': 'sent'})
+ return super(SaleOrder, self).print_quotation()
+
+ @api.multi
+ def make_revision(self):
+ for rec in self:
+ if not rec.org_name:
+ namee = rec.name + '/R' + str(rec.revision_number)
+ rec.org_name = rec.name
+ else:
+ namee = rec.org_name + '/R' + str(rec.revision_number)
+ if not rec.org_name:
+ names = rec.name
+ else:
+ names = rec.org_name
+ vals = {
+ 'name': names + "-" + str(rec.revision_number),
+ 'state': 'revised',
+ 'parent_so_id': rec.id
+ }
+ new_so_copy = rec.copy(default=vals)
+ rec.state = 'pre'
+ rec.name = namee
+ rec.revision_number += 1
+ date_start = self.env['ir.config_parameter'].sudo().get_param('quotation_handler.so_expiration_date_start')
+ if date_start:
+ rec.validity_date = False
+
+
+class MailComposeMessage(models.TransientModel):
+ _inherit = 'mail.compose.message'
+
+ @api.multi
+ def send_mail(self, auto_commit=False):
+ if self._context.get('default_model') == 'sale.order' and self._context.get('default_res_id') and self._context.get('mark_so_as_sent'):
+ order = self.env['sale.order'].browse([self._context['default_res_id']])
+ # ********************Email Sent action Change the State in pre stage too********************
+ if order.state in ('draft', 'pre'):
+ order.state = 'sent'
+ date_start = int(self.env['ir.config_parameter'].sudo().get_param('quotation_handler.so_expiration_date_start'))
+ if date_start:
+ # ********************Email Sent action Set the Exp Date From settings********************
+ date_no = int(self.env['ir.config_parameter'].sudo().get_param('quotation_handler.so_expiration_date_no'))
+ date_today = fields.Date.today()
+ date_object = datetime.strptime(date_today, '%Y-%m-%d')
+ if date_no:
+ v_date = date_object + timedelta(days=date_no)
+ order.validity_date = v_date
+
+ self = self.with_context(mail_post_autofollow=True)
+ return super(MailComposeMessage, self).send_mail(auto_commit=auto_commit)
+
diff --git a/quotation_handler/models/sale_config_settings_exp_date_views.py b/quotation_handler/models/sale_config_settings_exp_date_views.py
new file mode 100644
index 000000000..37669440a
--- /dev/null
+++ b/quotation_handler/models/sale_config_settings_exp_date_views.py
@@ -0,0 +1,62 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+# Copyright (C) 2018-TODAY NIKHIL KRISHNAN(nikhilkrishnan0101@gmail.com).
+# Author: Nikhil krishnan(nikhilkrishnan0101@gmail.com)
+# you can modify it under the terms of the GNU LESSER
+# GENERAL PUBLIC LICENSE (LGPL v3), Version 3.
+#
+# It is forbidden to publish, distribute, sublicense, or sell copies
+# of the Software or modified copies of the Software.
+#
+# 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 .
+#
+###############################################################################
+
+from odoo import api, fields, models
+
+
+class SaleConfiguration(models.TransientModel):
+ _inherit = 'res.config.settings'
+
+ so_expiration_date = fields.Selection([('0', "No Default Expiration Date"), ('1', "Default 14 days"),
+ ('2', 'Created as company rule')], "Expiration Date",
+ default='0', help="Allows you to set Expiration Date.")
+ so_expiration_date_start = fields.Selection([('0', "Quotation Creation Date"),
+ ('1', "Quotation Sent Date")],
+ "Expiration Date Start from", default='0',
+ help="Allows you to set Expiration Date Start from.")
+ so_expiration_date_no = fields.Integer(string="No.of Days")
+
+ @api.model
+ def get_values(self):
+ res = super(SaleConfiguration, self).get_values()
+ a = self.env['ir.config_parameter'].sudo().get_param('quotation_handler.so_expiration_date_no')
+ res.update(
+ so_expiration_date=self.env['ir.config_parameter'].sudo().get_param('quotation_handler.so_expiration_date'),
+ so_expiration_date_start=self.env['ir.config_parameter'].sudo().get_param('quotation_handler.so_expiration_date_start'),
+ so_expiration_date_no=int(a)
+ )
+ return res
+
+ @api.multi
+ def set_values(self):
+ super(SaleConfiguration, self).set_values()
+ a = self.so_expiration_date
+ print("type", type(a))
+ if a == '0':
+ so_expiration_date_nos = False
+ elif a == '1':
+ so_expiration_date_nos = 14
+ else:
+ so_expiration_date_nos = self.so_expiration_date_no
+ self.env['ir.config_parameter'].sudo().set_param('quotation_handler.so_expiration_date', self.so_expiration_date)
+ self.env['ir.config_parameter'].sudo().set_param('quotation_handler.so_expiration_date_start', self.so_expiration_date_start)
+ self.env['ir.config_parameter'].sudo().set_param('quotation_handler.so_expiration_date_no', int(so_expiration_date_nos))
diff --git a/quotation_handler/static/description/banner.jpg b/quotation_handler/static/description/banner.jpg
new file mode 100644
index 000000000..33b4c1ed7
Binary files /dev/null and b/quotation_handler/static/description/banner.jpg differ
diff --git a/quotation_handler/static/description/cybro_logo.png b/quotation_handler/static/description/cybro_logo.png
new file mode 100644
index 000000000..bb309114c
Binary files /dev/null and b/quotation_handler/static/description/cybro_logo.png differ
diff --git a/quotation_handler/static/description/editable line.png b/quotation_handler/static/description/editable line.png
new file mode 100644
index 000000000..8f023fa34
Binary files /dev/null and b/quotation_handler/static/description/editable line.png differ
diff --git a/quotation_handler/static/description/email template.png b/quotation_handler/static/description/email template.png
new file mode 100644
index 000000000..71029c6d3
Binary files /dev/null and b/quotation_handler/static/description/email template.png differ
diff --git a/quotation_handler/static/description/icon.png b/quotation_handler/static/description/icon.png
new file mode 100644
index 000000000..17aa2186d
Binary files /dev/null and b/quotation_handler/static/description/icon.png differ
diff --git a/quotation_handler/static/description/index.html b/quotation_handler/static/description/index.html
new file mode 100644
index 000000000..b3acf358a
--- /dev/null
+++ b/quotation_handler/static/description/index.html
@@ -0,0 +1,189 @@
+
+
☑ Automatically set expiration date for quotation.
+
☑ Email template contains the expiration date.
+
+
+
+
+
+
+
+
Quotation in "Quotation Sent" state
+
+
+
+
+
+
+
+
+ The clients will require negotiations whenever we sent a quotation to them.In such cases we need to edit the Quotation's order lines.
+ We have included the 'Revise the Quotation' button for it. The order lines can be edited by a click on this button.
+ At the same time a history or copy of the quotation will also be generated automatically.We can track the history using the smart buttons.
+
+
+
+
+
+
+
+
+
+
Quotation in "Revised Quotation" state
+
+
+
+
+
+
+
+
+ In the Revised Quotation state, we can edit the order lines and resent to the client.
+
Quotation Sent ---> Revised Quotation ---> Quotation Sent
+
The smart button on the top right of the form will provide the entire revised history of quotation.
+ The revised quotation will be indicated by a change in name format as (initial name/R1) in a recurring manner.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
In the Quotation Sent state we can't edit the Order lines. When we need to revise just click on
+ the "Revise the Quotation" button.
+
+
+
+
+
+
+
+
In the Revised Quotation state we can edit the order lines and resend it through mail or
+ take print out with new order lines.
+
+
+
+
+
+
+
+
Quotation History
+
+
+
+
Smart button redirect you to the Quotation History.
+
+
+
Tree view of the Revised Quotations of the particular parent quotation.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Quotation in "Revised" state
+
+
+
+
+
+
+
+
+ In this state we can't edit anything, it's just for a view.
+
+
+
+
+
+
+
+
+
+
Quotation Email template
+
+
+
+
+
+
+
+ If we gave expiration date then it will mention in the Email
+
+ Every quotations have a expiration date which we set manually.On configuring the above shown settings we can
+ automatically set the expiration date very easily.
+
+
No Expiration date: No changes(we have to set the date manually)
+
Default 14 days: The expiration date calculated from Quotation Creation Date or form Quotation Sent Date is set for 14 days.
+
Created as company rule: The quotation will expire as per the custom days set by user from Quotation Creation Date or from the Quotation Sent Date .
+
+
Expiration Date Calculated From : Choose either of the two, Quotation Creation Date or Quotation Sent Date
+ Create a Quotation, the first step of a new sale.
+
+ Once the quotation is confirmed, it becomes a sales order.
+ You'll be able to invoice it and collect payments.
+ From the Sales Orders menu, you can track delivery
+ orders or services.
+
+ Create a Quotation, the first step of a new sale.
+
+ Once the quotation is confirmed, it becomes a sales order.
+ You'll be able to invoice it and collect payments.
+ From the Sales Orders menu, you can track delivery
+ orders or services.
+