Browse Source

[ADD]Initial Commit

pull/29/head
SHEREEF PT 8 years ago
parent
commit
318bff275e
  1. 19
      quotation_handler/README.rst
  2. 25
      quotation_handler/__init__.py
  3. 46
      quotation_handler/__manifest__.py
  4. 63
      quotation_handler/data/mail_template_data_exp_date.xml
  5. 26
      quotation_handler/models/__init__.py
  6. 145
      quotation_handler/models/sale.py
  7. 62
      quotation_handler/models/sale_config_settings_exp_date_views.py
  8. BIN
      quotation_handler/static/description/banner.jpg
  9. BIN
      quotation_handler/static/description/cybro_logo.png
  10. BIN
      quotation_handler/static/description/editable line.png
  11. BIN
      quotation_handler/static/description/email template.png
  12. BIN
      quotation_handler/static/description/icon.png
  13. 189
      quotation_handler/static/description/index.html
  14. BIN
      quotation_handler/static/description/revised form view.png
  15. BIN
      quotation_handler/static/description/revised state.png
  16. BIN
      quotation_handler/static/description/revised tree.png
  17. BIN
      quotation_handler/static/description/sent state not editable.png
  18. BIN
      quotation_handler/static/description/sent state.png
  19. BIN
      quotation_handler/static/description/settings.png
  20. 112
      quotation_handler/views/quotation_handler.xml
  21. 29
      quotation_handler/views/sale_config_settings_exp_date_views.xml

19
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

25
quotation_handler/__init__.py

@ -0,0 +1,25 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# Cybrosys Technologies Pvt. Ltd.
# Copyright (C) 2017-TODAY Cybrosys Technologies(<http://www.cybrosys.com>).
# Author: Nikhil krishnan(<http://www.cybrosys.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 <http://www.gnu.org/licenses/>.
#
##############################################################################
import models

46
quotation_handler/__manifest__.py

@ -0,0 +1,46 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# Cybrosys Technologies Pvt. Ltd.
# Copyright (C) 2017-TODAY Cybrosys Technologies(<http://www.cybrosys.com>).
# Author: Nikhil krishnan(<http://www.cybrosys.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 <http://www.gnu.org/licenses/>.
#
##############################################################################
{
'name': 'Quotation Revised History',
'version': '10.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,
}

63
quotation_handler/data/mail_template_data_exp_date.xml

@ -0,0 +1,63 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data noupdate="1">
<!--Email template -->
<record id="sale.email_template_edi_sale" model="mail.template">
<field name="name">Sales Order - Send by Email</field>
<field name="email_from">${(object.user_id.email and '%s &lt;%s&gt;' % (object.user_id.name, object.user_id.email) or '')|safe}</field>
<field name="subject">${object.company_id.name} ${object.state in ('draft', 'sent') and 'Quotation' or 'Order'} (Ref ${object.name or 'n/a' })</field>
<field name="partner_to">${object.partner_id.id}</field>
<field name="model_id" ref="sale.model_sale_order"/>
<field name="auto_delete" eval="True"/>
<field name="report_template" ref="sale.report_sale_order"/>
<field name="report_name">${(object.name or '').replace('/','_')}_${object.state == 'draft' and 'draft' or ''}</field>
<field name="lang">${object.partner_id.lang}</field>
<field name="body_html"><![CDATA[
<p>Dear ${object.partner_id.name}
% set access_action = object.get_access_action()
% set doc_name = 'quotation' if object.state in ('draft', 'sent') else 'order confirmation'
% set is_online = access_action and access_action['type'] == 'ir.actions.act_url'
% set access_name = is_online and object.template_id and 'Accept and pay %s online' % doc_name or 'View %s' % doc_name
% set access_url = is_online and access_action['url'] or object.get_signup_url()
% if object.partner_id.parent_id:
(<i>${object.partner_id.parent_id.name}</i>)
% endif
,</p>
<p>
Here is your ${doc_name} <strong>${object.name}</strong>
% if object.origin:
(with reference: ${object.origin} )
% endif
amounting in <strong>${object.amount_total} ${object.pricelist_id.currency_id.name}</strong>
from ${object.company_id.name}.
</p>
<br/><br/>
% if is_online:
<center>
<a href="${access_url}" style="background-color: #1abc9c; padding: 20px; text-decoration: none; color: #fff; border-radius: 5px; font-size: 16px;" class="o_default_snippet_text">${access_name}</a>
<br/><br/>
<span style="color:#888888">(or view attached PDF)</span>
</center>
<br/>
% endif
% if object.state in ('draft', 'sent'):
% if object.state == "pre" or object.state == "draft" or object.state == "sent" :
% if object.validity_date:
<p> Your quotation will expire on <strong>${object.validity_date}</strong>.</p>
% endif
% endif
<p>You can reply to this email if you have any questions.</p>
<p>Thank you,</p>
<p style="color:#eeeeee;">
% if object.user_id and object.user_id.signature:
${object.user_id.signature | safe}
% endif
</p>
]]></field>
</record>
</data>
</odoo>

26
quotation_handler/models/__init__.py

@ -0,0 +1,26 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# Cybrosys Technologies Pvt. Ltd.
# Copyright (C) 2017-TODAY Cybrosys Technologies(<http://www.cybrosys.com>).
# Author: Nikhil krishnan(<http://www.cybrosys.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 <http://www.gnu.org/licenses/>.
#
##############################################################################
import sale
import sale_config_settings_exp_date_views

145
quotation_handler/models/sale.py

@ -0,0 +1,145 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# Cybrosys Technologies Pvt. Ltd.
# Copyright (C) 2017-TODAY Cybrosys Technologies(<http://www.cybrosys.com>).
# Author: Nikhil krishnan(<http://www.cybrosys.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 <http://www.gnu.org/licenses/>.
#
##############################################################################
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')
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_start = self.env['ir.values'].get_default('sale.config.settings', 'so_expiration_date_start')
if not date_start:
if 'validity_date' in vals:
if vals.get('validity_date'):
pass
else:
date_no = self.env['ir.values'].get_default('sale.config.settings', 'so_expiration_date_no')
date_today = fields.Date.today()
date_object = datetime.strptime(date_today, '%Y-%m-%d')
if not date_no:
pass
else:
v_date = date_object + timedelta(days=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 = self.env['ir.values'].get_default('sale.config.settings', 'so_expiration_date')
date_start = self.env['ir.values'].get_default('sale.config.settings', 'so_expiration_date_start')
date_no = self.env['ir.values'].get_default('sale.config.settings', '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.values'].get_default('sale.config.settings', '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 = self.env['ir.values'].get_default('sale.config.settings', 'so_expiration_date_start')
if date_start:
# ********************Email Sent action Set the Exp Date From settings********************
date_no = self.env['ir.values'].get_default('sale.config.settings', '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)

62
quotation_handler/models/sale_config_settings_exp_date_views.py

@ -0,0 +1,62 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# Cybrosys Technologies Pvt. Ltd.
# Copyright (C) 2017-TODAY Cybrosys Technologies(<http://www.cybrosys.com>).
# Author: Nikhil krishnan(<http://www.cybrosys.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 <http://www.gnu.org/licenses/>.
#
##############################################################################
from odoo import api, fields, models
class SaleConfiguration(models.TransientModel):
_inherit = 'sale.config.settings'
so_expiration_date = fields.Selection([(0, "No Default Expiration Date"), (1, "Default 14 days"),
(2, 'Created as company rule')], "Expiration Date",
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",
help="Allows you to set Expiration Date Start from.")
so_expiration_date_no = fields.Integer(string="No.of Days")
@api.multi
def set_default_so_expiration_date(self):
return self.env['ir.values'].sudo().set_default(
'sale.config.settings', 'so_expiration_date', self.so_expiration_date)
@api.multi
def set_default_so_expiration_date_start(self):
return self.env['ir.values'].sudo().set_default(
'sale.config.settings', 'so_expiration_date_start', self.so_expiration_date_start)
@api.multi
def set_default_so_expiration_date_no(self):
a = self.env['ir.values'].get_default('sale.config.settings', 'so_expiration_date', self.so_expiration_date)
if a == 0:
so_expiration_date_no = False
elif a == 1:
so_expiration_date_no = 14
else:
so_expiration_date_no = self.so_expiration_date_no
return self.env['ir.values'].sudo().set_default(
'sale.config.settings', 'so_expiration_date_no', so_expiration_date_no)

BIN
quotation_handler/static/description/banner.jpg

Binary file not shown.

After

Width:  |  Height:  |  Size: 54 KiB

BIN
quotation_handler/static/description/cybro_logo.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 50 KiB

BIN
quotation_handler/static/description/editable line.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 52 KiB

BIN
quotation_handler/static/description/email template.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 37 KiB

BIN
quotation_handler/static/description/icon.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

189
quotation_handler/static/description/index.html

@ -0,0 +1,189 @@
<section class="oe_container">
<div class="oe_row oe_spaced">
<h2 class="oe_slogan">Quotation Revised History</h2>
<h3 class="oe_slogan">Retrieve the History of Revised Quotations</h3>
<h4 class="oe_slogan">Author : Cybrosys Techno Solutions , www.cybrosys.com</h4>
<div>
<h4><p>Features:</p></h4>
<ul>
<li style="list-style:none !important;"><span style="color:green;"> &#9745;</span>&nbsp;&nbsp; Retrieve the history of revised quotations.</li>
<li style="list-style:none !important;"><span style="color:green;"> &#9745;</span>&nbsp;&nbsp; Automatically set expiration date for quotation.</li>
<li style="list-style:none !important;"><span style="color:green;"> &#9745;</span>&nbsp;&nbsp; Email template contains the expiration date.</li>
</ul>
</div>
</div>
</section>
<section class="oe_container oe_dark">
<div class="oe_row oe_spaced">
<h3 class="oe_slogan">Quotation in "Quotation Sent" state</h3>
<div class="oe_row oe_spaced">
<div class="oe_span12">
<div class="oe_row_img oe_centered">
<img class="oe_picture oe_screenshot" src="sent state.png">
</div>
</div>
<div class="oe_span12">
<p class="oe_mt32">
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.
</p>
</div>
</div>
</div>
</section>
<section class="oe_container">
<div class="oe_row oe_spaced">
<h3 class="oe_slogan">Quotation in "Revised Quotation" state</h3>
<div class="oe_row oe_spaced">
<div class="oe_span12">
<div class="oe_row_img oe_centered">
<img class="oe_picture oe_screenshot" src="revised state.png">
</div>
</div>
<div class="oe_span12">
<p class="oe_mt32">
In the Revised Quotation state, we can edit the order lines and resent to the client.
<p>Quotation Sent ---> Revised Quotation ---> Quotation Sent</p>
<p>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.</p>
</p>
</div>
</div>
</div>
</section>
<section class="oe_container oe_dark">
<div class="oe_row oe_spaced">
<div class="oe_span6">
<div class="oe_demo oe_picture oe_screenshot">
<img src="sent state not editable.png">
</div>
<p class="oe_mt32">
<p>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.</p>
</p>
</div>
<div class="oe_span6">
<div class="oe_demo oe_picture oe_screenshot">
<img src="editable line.png">
</div>
<p class="oe_mt32">
<p>In the Revised Quotation state we can edit the order lines and resend it through mail or
take print out with new order lines.</p>
</p>
</div>
</div>
</section>
<section class="oe_container">
<div class="oe_row oe_spaced">
<h3 class="oe_slogan">Quotation History</h3>
<div class="oe_row oe_spaced">
<p>
<ul>
<li>Smart button redirect you to the Quotation History.</li>
</ul>
<ul>
<li>Tree view of the Revised Quotations of the particular parent quotation.</li>
</ul>
</p>
</div>
<div class="oe_row oe_spaced">
<div class="oe_span12">
<div class="oe_row_img oe_centered">
<img class="oe_picture oe_screenshot" src="revised tree.png">
</div>
</div>
</div>
</div>
</section>
<section class="oe_container oe_dark">
<div class="oe_row oe_spaced">
<h3 class="oe_slogan">Quotation in "Revised" state</h3>
<div class="oe_row oe_spaced">
<div class="oe_span12">
<div class="oe_row_img oe_centered">
<img class="oe_picture oe_screenshot" src="revised form view.png">
</div>
</div>
<div class="oe_span12">
<p class="oe_mt32">
In this state we can't edit anything, it's just for a view.
</p>
</div>
</div>
</div>
</section>
<section class="oe_container">
<div class="oe_row oe_spaced">
<h3 class="oe_slogan">Quotation Email template</h3>
<div class="oe_span12">
<div class="oe_row_img oe_centered">
<img class="oe_picture oe_screenshot" src="email template.png">
</div>
</div>
<div class="oe_span12">
<p class="oe_mt32">
If we gave expiration date then it will mention in the Email
</p>
</div>
</div>
</section>
<section class="oe_container oe_dark">
<div class="oe_row oe_spaced">
<h3 class="oe_slogan">Quotations & Sales Settings</h3>
<div class="oe_span12">
<div class="oe_row_img oe_centered">
<img class="oe_picture oe_screenshot" src="settings.png">
</div>
</div>
<div class="oe_span12">
<p class="oe_mt32">
Sales --> Configuration --> Settings ---> Quotations & Sales --> Expiration Date
</p>
<p>
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.
<p>No Expiration date: No changes(we have to set the date manually)</p>
<p>Default 14 days: The expiration date calculated from Quotation Creation Date or form Quotation Sent Date is set for 14 days.</p>
<p>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 . </p>
</p>
<p>Expiration Date Calculated From : Choose either of the two, Quotation Creation Date or Quotation Sent Date</p>
</div>
</div>
</section>
<section class="oe_container">
<h2 class="oe_slogan" style="margin-top:20px;" >Need Any Help?</h2>
<div class="oe_slogan" style="margin-top:10px !important;">
<div>
<a class="btn btn-primary btn-lg mt8"
style="color: #FFFFFF !important;border-radius: 0;" href="http://www.cybrosys.com"><i
class="fa fa-envelope"></i> Email </a> <a
class="btn btn-primary btn-lg mt8" style="color: #FFFFFF !important;border-radius: 0;"
href="http://www.cybrosys.com/contact/"><i
class="fa fa-phone"></i> Contact Us </a> <a
class="btn btn-primary btn-lg mt8" style="color: #FFFFFF !important;border-radius: 0;"
href="http://www.cybrosys.com/odoo-customization-and-installation/"><i
class="fa fa-check-square"></i> Request Customization </a>
</div>
<br>
<img src="cybro_logo.png" style="width: 190px; margin-bottom: 20px;" class="center-block">
<div>
<a href="https://twitter.com/cybrosys" target="_blank"><i class="fa fa-2x fa-twitter" style="color:white;background: #00a0d1;width:35px;"></i></a></td>
<a href="https://www.linkedin.com/company/cybrosys-technologies-pvt-ltd" target="_blank"><i class="fa fa-2x fa-linkedin" style="color:white;background: #31a3d6;width:35px;padding-left: 3px;"></i></a></td>
<a href="https://www.facebook.com/cybrosystechnologies" target="_blank"><i class="fa fa-2x fa-facebook" style="color:white;background: #3b5998;width:35px;padding-left: 8px;"></i></a></td>
<a href="https://plus.google.com/106641282743045431892/about" target="_blank"><i class="fa fa-2x fa-google-plus" style="color:white;background: #c53c2c;width:35px;padding-left: 3px;"></i></a></td>
<a href="https://in.pinterest.com/cybrosys" target="_blank"><i class="fa fa-2x fa-pinterest" style="color:white;background: #ac0f18;width:35px;padding-left: 3px;"></i></a></td>
</div>
</div>
</section>

BIN
quotation_handler/static/description/revised form view.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 49 KiB

BIN
quotation_handler/static/description/revised state.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 54 KiB

BIN
quotation_handler/static/description/revised tree.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 32 KiB

BIN
quotation_handler/static/description/sent state not editable.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 50 KiB

BIN
quotation_handler/static/description/sent state.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 90 KiB

BIN
quotation_handler/static/description/settings.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 70 KiB

112
quotation_handler/views/quotation_handler.xml

@ -0,0 +1,112 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data>
<record id="act_sale_order_2_revised" model="ir.actions.act_window">
<field name="name">Revised Quotation Orders</field>
<field name="res_model">sale.order</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
<field name="view_id" ref="sale.view_quotation_tree"/>
<field name="domain">[('parent_so_id', '=', active_id)]</field>
<field name="help" type="html">
<p class="oe_view_nocontent_create">
Revised order against this Quotation Order.
</p>
</field>
</record>
<!--In sale order menu, we need to avoid the 'revised' state orders. -->
<record id="sale.action_orders" model="ir.actions.act_window">
<field name="name">Sales Orders</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">sale.order</field>
<field name="view_type">form</field>
<field name="view_mode">tree,kanban,form,calendar,pivot,graph</field>
<field name="search_view_id" ref="sale.sale_order_view_search_inherit_sale"/>
<field name="context">{}</field>
<field name="domain">[('state', 'not in', ('draft','revised','sent', 'cancel'))]</field>
<field name="help" type="html">
<p class="oe_view_nocontent_create">
Create a Quotation, the first step of a new sale.
</p><p>
Once the quotation is confirmed, it becomes a sales order.
You'll be able to invoice it and collect payments.
From the <i>Sales Orders</i> menu, you can track delivery
orders or services.
</p>
</field>
</record>
<record id="sale.action_quotations" model="ir.actions.act_window">
<field name="name">Quotations</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">sale.order</field>
<field name="view_type">form</field>
<field name="view_id" ref="sale.view_quotation_tree"/>
<field name="view_mode">tree,kanban,form,calendar,pivot,graph</field>
<field name="context">{}</field>
<field name="domain">[('state','in',('pre','draft','sent','cancel'))]</field>
<field name="search_view_id" ref="sale.view_sales_order_filter"/>
<field name="help" type="html">
<p class="oe_view_nocontent_create">
Create a Quotation, the first step of a new sale.
</p><p>
Your next actions should flow efficiently: confirm the Quotation
to a Sale Order, then create the Invoice and collect the Payment.
</p><p>
Note that once a Quotation becomes a Sale Order, it will be moved
from the Quotations list to the Sales Order list.
</p>
</field>
</record>
<record id="view_order_form_revised" model="ir.ui.view">
<field name="name">sale.order.form</field>
<field name="model">sale.order</field>
<field name="inherit_id" ref="sale.view_order_form" />
<field name="arch" type="xml">
<xpath expr="//button[@name='action_confirm']" position="after">
<button name="make_revision" string="Revise the Quotation" type="object" states="sent" class="btn-primary"/>
<button name="action_quotation_send" string="Send by Email" type="object" states="pre" class="btn-primary"/>
<button name="print_quotation" string="Print" type="object" states="pre" class="btn-primary"/>
<button name="action_cancel" states="pre" type="object" string="Cancel"/>
</xpath>
<xpath expr="//div[@name='button_box']" position="inside">
<button class="oe_inline oe_stat_button" type="action" name="%(act_sale_order_2_revised)d"
icon="fa-bars" attrs="{'invisible':[('state','in',[('draft','revised')]}">
<field string="Revised Quotation Orders" name="revised_order_count" widget="statinfo"/>
</button>
</xpath>
<xpath expr="//field[@name='order_line']" position="attributes">
<attribute name="attrs">{'readonly': [('state', 'in', ('sent','revised','done','cancel'))]}</attribute>
</xpath>
<xpath expr="//field[@name='payment_term_id']" position="attributes">
<attribute name="attrs">{'readonly': [('state', 'in', ('sent','revised','done','cancel'))]}</attribute>
</xpath>
<xpath expr="//field[@name='user_id']" position="attributes">
<attribute name="attrs">{'readonly': [('state', 'in', ('sent','revised','done','cancel'))]}</attribute>
</xpath>
<xpath expr="//field[@name='team_id']" position="attributes">
<attribute name="attrs">{'readonly': [('state', 'in', ('sent','revised','done','cancel'))]}</attribute>
</xpath>
</field>
</record>
<record id="view_quotation_handler_tree" model="ir.ui.view">
<field name="name">sale.order.tree</field>
<field name="model">sale.order</field>
<field name="inherit_id" ref="sale.view_quotation_tree" />
<field name="arch" type="xml">
<xpath expr="//field[@name='state']" position="replace">
<field name="state"/>
</xpath>
</field>
</record>
</data>
</odoo>

29
quotation_handler/views/sale_config_settings_exp_date_views.xml

@ -0,0 +1,29 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data>
<record id="view_sales_config_revised_quotation" model="ir.ui.view">
<field name="name">sale settings</field>
<field name="model">sale.config.settings</field>
<field name="inherit_id" ref="sale.view_sales_config"/>
<field name="arch" type="xml">
<xpath expr="//div/group/field[@name='auto_done_setting']" position="after">
<label for="so_expiration_date" string="Expiration Date"/>
<div>
<field name="so_expiration_date" widget="radio" />
<div attrs="{'invisible': [('so_expiration_date', 'not in', [2])]}">
<field name="so_expiration_date_no" class="oe_inline"/>
<label for="so_expiration_date_no" string="Days"/>
</div>
</div>
<label for="so_expiration_date_start" string="Expiration Date Calculated From"
attrs="{'invisible': [('so_expiration_date', 'not in', [1,2])]}"/>
<div>
<div attrs="{'invisible': [('so_expiration_date', 'not in', [1,2])]}">
<field name="so_expiration_date_start" widget="radio"/>
</div>
</div>
</xpath>
</field>
</record>
</data>
</odoo>
Loading…
Cancel
Save