diff --git a/sale_revision_history.zip b/sale_revision_history.zip new file mode 100644 index 00000000..f837d953 Binary files /dev/null and b/sale_revision_history.zip differ diff --git a/sale_revision_history/__init__.py b/sale_revision_history/__init__.py new file mode 100644 index 00000000..5305644d --- /dev/null +++ b/sale_revision_history/__init__.py @@ -0,0 +1,3 @@ +# -*- coding: utf-8 -*- + +from . import models \ No newline at end of file diff --git a/sale_revision_history/__manifest__.py b/sale_revision_history/__manifest__.py new file mode 100644 index 00000000..61605fdc --- /dev/null +++ b/sale_revision_history/__manifest__.py @@ -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: diff --git a/sale_revision_history/i18n/pt_BR.po b/sale_revision_history/i18n/pt_BR.po new file mode 100644 index 00000000..ab6656e3 --- /dev/null +++ b/sale_revision_history/i18n/pt_BR.po @@ -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" + diff --git a/sale_revision_history/models/__init__.py b/sale_revision_history/models/__init__.py new file mode 100644 index 00000000..6064afee --- /dev/null +++ b/sale_revision_history/models/__init__.py @@ -0,0 +1,3 @@ +# -*- coding: utf-8 -*- + +from . import sale_order diff --git a/sale_revision_history/models/__pycache__/__init__.cpython-35.pyc b/sale_revision_history/models/__pycache__/__init__.cpython-35.pyc new file mode 100644 index 00000000..6659ba49 Binary files /dev/null and b/sale_revision_history/models/__pycache__/__init__.cpython-35.pyc differ diff --git a/sale_revision_history/models/__pycache__/sale_order.cpython-35.pyc b/sale_revision_history/models/__pycache__/sale_order.cpython-35.pyc new file mode 100644 index 00000000..fd87a4e4 Binary files /dev/null and b/sale_revision_history/models/__pycache__/sale_order.cpython-35.pyc differ diff --git a/sale_revision_history/models/sale_order.py b/sale_revision_history/models/sale_order.py new file mode 100644 index 00000000..9a9c8981 --- /dev/null +++ b/sale_revision_history/models/sale_order.py @@ -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) + + + + + + diff --git a/sale_revision_history/static/description/icon.png b/sale_revision_history/static/description/icon.png new file mode 100644 index 00000000..0c90ea3f Binary files /dev/null and b/sale_revision_history/static/description/icon.png differ diff --git a/sale_revision_history/static/description/index.html b/sale_revision_history/static/description/index.html new file mode 100644 index 00000000..72231550 --- /dev/null +++ b/sale_revision_history/static/description/index.html @@ -0,0 +1,116 @@ +
+
+

Sales Quotation Revision

+

+ 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. +

+

+ By installing this module which allows the user to revise the quotation and manage the revision history as follows. +

+
+
+ + +
+
+
+

+ Step 1: +

+

+ Creation of Quotation on draft state & system will auto generate a Sequence like SO005. +

+ +
+
+
+ +
+
+
+

+ Step 2: +

+

+ Once the quotation moves to Quotation Sent state, User cannot modify the quotation. +

+ +
+
+
+ +
+
+
+

+ Step 3: +

+

+ Scenario: If customer is not satisfied with the quotation or wants to add more products or change in product price or discount. +

+

+ To revise the quotation, user needs to click on the Revision Button (appears on Quotation sent stage). +

+ +
+
+
+
+
+
+

+ Step 4: +

+

+ Quotation gets revised and it will indicated by adding iteration number next to the generated sequence. +

+

+ Now the quotation will be moved to Quotation a draft, user can make changes and save. +

+ +
+
+
+
+
+
+

+ Step 5: +

+

+ To view the revision history. Goto -> Revision Tab. +

+ +
+
+
+
+
+
+

+ Step 6: +

+

+ Click on the list (sale order number) to view the previous Sales quotation. +

+ +
+
+
+
+

Need Any Help?

+
+ Email Contact Us +
+ +

+ PPTS [India] Pvt.Ltd. +

+
+
+
\ No newline at end of file diff --git a/sale_revision_history/static/description/sale_revision_1.png b/sale_revision_history/static/description/sale_revision_1.png new file mode 100644 index 00000000..859e9679 Binary files /dev/null and b/sale_revision_history/static/description/sale_revision_1.png differ diff --git a/sale_revision_history/static/description/sale_revision_2.png b/sale_revision_history/static/description/sale_revision_2.png new file mode 100644 index 00000000..664dc22e Binary files /dev/null and b/sale_revision_history/static/description/sale_revision_2.png differ diff --git a/sale_revision_history/static/description/sale_revision_3.png b/sale_revision_history/static/description/sale_revision_3.png new file mode 100644 index 00000000..a965d600 Binary files /dev/null and b/sale_revision_history/static/description/sale_revision_3.png differ diff --git a/sale_revision_history/static/description/sale_revision_4.png b/sale_revision_history/static/description/sale_revision_4.png new file mode 100644 index 00000000..d83f4f71 Binary files /dev/null and b/sale_revision_history/static/description/sale_revision_4.png differ diff --git a/sale_revision_history/static/description/sale_revision_5.png b/sale_revision_history/static/description/sale_revision_5.png new file mode 100644 index 00000000..dc5503b3 Binary files /dev/null and b/sale_revision_history/static/description/sale_revision_5.png differ diff --git a/sale_revision_history/static/description/sale_revision_6.png b/sale_revision_history/static/description/sale_revision_6.png new file mode 100644 index 00000000..071f1c43 Binary files /dev/null and b/sale_revision_history/static/description/sale_revision_6.png differ diff --git a/sale_revision_history/views/sale_order_views.xml b/sale_revision_history/views/sale_order_views.xml new file mode 100644 index 00000000..cff93b96 --- /dev/null +++ b/sale_revision_history/views/sale_order_views.xml @@ -0,0 +1,30 @@ + + + + sale.order.form + sale.order + + + +