Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added sale_revision_history.zip
Binary file not shown.
3 changes: 3 additions & 0 deletions sale_revision_history/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# -*- coding: utf-8 -*-

from . import models
24 changes: 24 additions & 0 deletions sale_revision_history/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# -*- encoding: utf-8 -*-
{
"name": "Sale Revision History",
"version": "1.1",
"author": "PPTS [India] Pvt.Ltd.",
"website": "http://www.pptssolutions.com",
"sequence": 0,
"depends": ["sale"],
"category": "Sales,Invoicing",
"complexity": "easy",
'license': 'LGPL-3',
'support': 'business@pptservices.com',
"description": """
Quotation sale revision history
""",
"data": [
'views/sale_order_views.xml',
],
"auto_install": False,
"installable": True,
"application": False,

}
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
73 changes: 73 additions & 0 deletions sale_revision_history/i18n/pt_BR.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * sale_revision_history
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 11.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2018-03-06 18:03+0000\n"
"PO-Revision-Date: 2018-03-06 18:03+0000\n"
"Last-Translator: <>\n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: \n"

#. module: sale_revision_history
#: model:ir.model.fields,field_description:sale_revision_history.field_sale_order_active
msgid "Active"
msgstr "Ativo"

#. module: sale_revision_history
#: model:ir.model.fields,field_description:sale_revision_history.field_sale_order_current_revision_id
msgid "Current revision"
msgstr "Versão Atual"

#. module: sale_revision_history
#: model:ir.model.fields,field_description:sale_revision_history.field_sale_order_old_revision_ids
msgid "Old revisions"
msgstr "Revisões Antigas"

#. module: sale_revision_history
#: model:ir.model.fields,field_description:sale_revision_history.field_sale_order_unrevisioned_name
msgid "Order Reference"
msgstr "Referência do Pedido"

#. module: sale_revision_history
#: model:ir.model,name:sale_revision_history.model_sale_order
msgid "Quotation"
msgstr "Cotação"

#. module: sale_revision_history
#: model:ir.ui.view,arch_db:sale_revision_history.sale_order_view_form
msgid "Revise"
msgstr "Revisar"

#. module: sale_revision_history
#: model:ir.model.fields,field_description:sale_revision_history.field_sale_order_revision_number
msgid "Revision"
msgstr "Revisão"

#. module: sale_revision_history
#: model:ir.ui.view,arch_db:sale_revision_history.sale_order_view_form
msgid "Revisions"
msgstr "Revisões"

#. module: sale_revision_history
#: code:addons/sale_revision_history/models/sale_order.py:33
#, python-format
msgid "Sales Order"
msgstr "Ordem de venda"

#. module: sale_revision_history
#: model:ir.ui.view,arch_db:sale_revision_history.sale_order_view_form
msgid "Superseeded by"
msgstr "Revisado por"

#. module: sale_revision_history
#: model:ir.ui.view,arch_db:sale_revision_history.sale_order_view_form
msgid "Superseeded on"
msgstr "Revisado em"

3 changes: 3 additions & 0 deletions sale_revision_history/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# -*- coding: utf-8 -*-

from . import sale_order
Binary file not shown.
Binary file not shown.
59 changes: 59 additions & 0 deletions sale_revision_history/models/sale_order.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
from odoo import api, fields, models, _

class SaleOrder(models.Model):
_inherit = "sale.order"

current_revision_id = fields.Many2one('sale.order','Current revision',readonly=True,copy=True)
old_revision_ids = fields.One2many('sale.order','current_revision_id','Old revisions',readonly=True,context={'active_test': False})
revision_number = fields.Integer('Revision',copy=False)
unrevisioned_name = fields.Char('Order Reference',copy=True,readonly=True)
active = fields.Boolean('Active',default=True,copy=True)

@api.model
def create(self, vals):
if 'unrevisioned_name' not in vals:
if vals.get('name', 'New') == 'New':
seq = self.env['ir.sequence']
vals['name'] = seq.next_by_code('sale.order') or '/'
vals['unrevisioned_name'] = vals['name']
return super(SaleOrder, self).create(vals)

@api.multi
def action_revision(self):
self.ensure_one()
view_ref = self.env['ir.model.data'].get_object_reference('sale', 'view_order_form')
view_id = view_ref and view_ref[1] or False,
self.with_context(sale_revision_history=True).copy()
self.write({'state': 'draft'})
self.order_line.write({'state': 'draft'})
self.mapped('order_line').write(
{'sale_line_id': False})
return {
'type': 'ir.actions.act_window',
'name': _('Sales Order'),
'res_model': 'sale.order',
'res_id': self.id,
'view_type': 'form',
'view_mode': 'form',
'view_id': view_id,
'target': 'current',
'nodestroy': True,
}

@api.returns('self', lambda value: value.id)
@api.multi
def copy(self, defaults=None):
if not defaults:
defaults = {}
if self.env.context.get('sale_revision_history'):
prev_name = self.name
revno = self.revision_number
self.write({'revision_number': revno + 1,'name': '%s-%02d' % (self.unrevisioned_name,revno + 1)})
defaults.update({'name': prev_name,'revision_number': revno,'active': False,'state': 'cancel','current_revision_id': self.id,'unrevisioned_name': self.unrevisioned_name,})
return super(SaleOrder, self).copy(defaults)






Binary file added sale_revision_history/static/description/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
116 changes: 116 additions & 0 deletions sale_revision_history/static/description/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
<section class="oe_container">
<div class="oe_row oe_spaced">
<h2 class="oe_slogan" style="color:#875A7B;">Sales Quotation Revision</h2>
<p class="oe_mt32 text-center">
On Sale, Quotations will be providing to the customer based on the Initial enquiry received. Customer would like to change the quotation with respect to Product, quantity, Price and discounts etc., Application User wishes to track and manage the revisions and related history.
</p>
<p class="oe_mt32 text-center">
By installing this module which allows the user to revise the quotation and manage the revision history as follows.
</p>
</div>
</section>


<section class="oe_container">
<div class="oe_row oe_spaced">
<div class="oe_span12">
<h4 class="oe_mt32 oe_mb8 text-center">
<b>Step 1:</b>
</h4>
<p class="oe_mt32 text-center">
Creation of Quotation on draft state &amp; system will auto generate a Sequence like SO005.
</p>
<img class="oe_picture oe_screenshot" src="sale_revision_1.png">
</div>
</div>
</section>

<section class="oe_container">
<div class="oe_row oe_spaced">
<div class="oe_span12">
<h4 class="oe_mt32 oe_mb8 text-center">
<b>Step 2:</b>
</h4>
<p class="oe_mt32 text-center">
Once the quotation moves to Quotation Sent state, User cannot modify the quotation.
</p>
<img class="oe_picture oe_screenshot" src="sale_revision_2.png">
</div>
</div>
</section>

<section class="oe_container">
<div class="oe_row oe_spaced">
<div class="oe_span12">
<h4 class="oe_mt32 oe_mb8 text-center">
<b>Step 3:</b>
</h4>
<p class="oe_mt32 text-center">
<b>Scenario:</b> If customer is not satisfied with the quotation or wants to add more products or change in product price or discount.
</p>
<p class="oe_mt32 text-center">
To revise the quotation, user needs to click on the Revision Button (appears on Quotation sent stage).
</p>
<img class="oe_picture oe_screenshot" src="sale_revision_3.png">
</div>
</div>
</section>
<section class="oe_container">
<div class="oe_row oe_spaced">
<div class="oe_span12">
<h4 class="oe_mt32 oe_mb8 text-center">
<b>Step 4:</b>
</h4>
<p class="oe_mt32 text-center">
Quotation gets revised and it will indicated by adding iteration number next to the generated sequence.
</p>
<p class="oe_mt32 text-center">
Now the quotation will be moved to Quotation a draft, user can make changes and save.
</p>
<img class="oe_picture oe_screenshot" src="sale_revision_4.png">
</div>
</div>
</section>
<section class="oe_container">
<div class="oe_row oe_spaced">
<div class="oe_span12">
<h4 class="oe_mt32 oe_mb8 text-center">
<b>Step 5:</b>
</h4>
<p class="oe_mt32 text-center">
To view the revision history. Goto -> Revision Tab.
</p>
<img class="oe_picture oe_screenshot" src="sale_revision_5.png">
</div>
</div>
</section>
<section class="oe_container">
<div class="oe_row oe_spaced">
<div class="oe_span12">
<h4 class="oe_mt32 oe_mb8 text-center">
<b>Step 6:</b>
</h4>
<p class="oe_mt32 text-center">
Click on the list (sale order number) to view the previous Sales quotation.
</p>
<img class="oe_picture oe_screenshot" src="sale_revision_6.png">
</div>
</div>
</section>
<section class="oe_container oe_dark">
<h2 class="oe_slogan" style="margin-top:20px;" >Need Any Help?</h2>
<div class="oe_slogan" style="margin-top:10px !important;">
<a class="btn btn-primary btn-lg mt8"
style="color: #FFFFFF !important;" href="mailto:business@pptservices.com"><i
class="fa fa-envelope"></i> Email </a> <a
class="btn btn-primary btn-lg mt8" style="color: #FFFFFF !important;"
href="http://www.pptssolutions.com/contact-us/"><i
class="fa fa-phone"></i> Contact Us </a>
</div>
<img src="icon.png" style="width: 70px; height:70px; margin-bottom: 20px;" class="center-block">
<h4 class="oe_mt32 oe_mb8 text-center">
<b>PPTS [India] Pvt.Ltd.</b>
</h4>
</section>
<section class="oe_container oe_separator">
</section>
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
30 changes: 30 additions & 0 deletions sale_revision_history/views/sale_order_views.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<odoo>
<data>
<record id="sale_order_view_form" 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="//form/header/button[@name='action_cancel']" position="after">
<button name="action_revision" states="sent" type="object" string="Revise"/>
</xpath>
<xpath expr="//form/sheet/notebook/page[2]" position="after">
<page string="Revisions">
<field name="old_revision_ids" >
<tree>
<field name='name'/>
<field name='create_date' string="Superseeded by"/>
<field name='create_uid' string="Superseeded on"/>
<field name='state' invisible='1'/>
</tree>
</field>
<group>
<field name="current_revision_id" invisible='1'/>
<field name="active" invisible='1'/>
</group>
</page>
</xpath>
</field>
</record>
</data>
</odoo>