diff --git a/pos_order_return/README.rst b/pos_order_return/README.rst index 24a1eb4a..3f626252 100644 --- a/pos_order_return/README.rst +++ b/pos_order_return/README.rst @@ -1,99 +1 @@ -.. image:: https://img.shields.io/badge/license-AGPL--3-blue.png - :target: https://www.gnu.org/licenses/agpl - :alt: License: AGPL-3 - -================ -PoS Order Return -================ - -This module extends the functionality of odoo Point Of Sale about POS Order -returns. - -With this module, it is now forbidden to return more quantity than the initial -one. - -A link is created between the returned Order and the initial Order. -A link is created between the returned Order Line and the initial Order Line. - -Usage -===== - -Select an PoS Order an choose either *Return Products* (full return of the -order) or *Partial Return*. In this case, a wizard allows to select just some -products and quantities to return: - -.. image:: /pos_order_return/static/description/partial_return_wizard.png - -Register the refund payment to finish the return. If the original order was -invoiced, a refund invoice will be made. - -Implemented Constraints ------------------------ - -* User can not return more products than the initial quantity: - -.. image:: /pos_order_return/static/description/returned_qty_over_initial.png - -* If a line has been partially refund, only a reduced quantity can be returned: - -.. image:: /pos_order_return/static/description/sum_returned_qty_over_initial.png - -* It is not possible to set a negative quantity if the initial Pos Order is - not indicated: - -.. image:: /pos_order_return/static/description/initial_pos_order_required.png - -Configuration -============= - -In some cases, you may want to let the possibility to allow negative quantity -in a PoS Order, without mentioning initial order. This can happen for special -products like returnable products, etc. - -In that case, a checkbox is possible on Product Form View to allow such case - -.. image:: /pos_order_return/static/description/product_returnable_bottle.png - -.. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas - :alt: Try me on Runbot - :target: https://runbot.odoo-community.org/runbot/184/10.0 - -Bug Tracker -=========== - -Bugs are tracked on `GitHub Issues -`_. In case of trouble, please -check there if your issue has already been reported. If you spotted it first, -help us smash it by providing detailed and welcomed feedback. - -Credits -======= - -Contributors ------------- - -* Sylvain LE GAL -* David Vidal - -Funders -------- - -The development of this module has been financially supported by: - -* La Louve (www.lalouve.net) -* GRAP, Groupement Régional Alimentaire de Proximité (www.grap.coop) - -Maintainer ----------- - -.. image:: https://odoo-community.org/logo.png - :alt: Odoo Community Association - :target: https://odoo-community.org - -This module is maintained by the OCA. - -OCA, or the Odoo Community Association, is a nonprofit organization whose -mission is to support the collaborative development of Odoo features and -promote its widespread use. - -To contribute to this module, please visit https://odoo-community.org. +**This file is going to be generated by oca-gen-addon-readme.** diff --git a/pos_order_return/__init__.py b/pos_order_return/__init__.py index 35e7c960..0217b0f9 100644 --- a/pos_order_return/__init__.py +++ b/pos_order_return/__init__.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- from . import models from . import wizard diff --git a/pos_order_return/__manifest__.py b/pos_order_return/__manifest__.py index 1f28a3f1..23fbd5ac 100644 --- a/pos_order_return/__manifest__.py +++ b/pos_order_return/__manifest__.py @@ -1,15 +1,16 @@ -# -*- coding: utf-8 -*- # Copyright 2016-2018 Sylvain LE GAL (https://twitter.com/legalsylvain) # Copyright 2018 David Vidal +# Copyright 2018 Lambda IS DOOEL # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). { 'name': 'Point of Sale Order Return', - 'version': '10.0.1.0.0', + 'version': '11.0.1.0.0', 'category': 'Point Of Sale', 'author': 'La Louve, ' 'GRAP, ' 'Tecnativa, ' + 'Lambda IS, ' 'Odoo Community Association (OCA)', 'license': 'AGPL-3', 'website': 'https://www.github.com/OCA/pos', diff --git a/pos_order_return/models/__init__.py b/pos_order_return/models/__init__.py index b848178c..d7439b04 100644 --- a/pos_order_return/models/__init__.py +++ b/pos_order_return/models/__init__.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- from . import product_template from . import pos_order diff --git a/pos_order_return/models/pos_order.py b/pos_order_return/models/pos_order.py index 5ed229a8..bc35b172 100644 --- a/pos_order_return/models/pos_order.py +++ b/pos_order_return/models/pos_order.py @@ -1,6 +1,6 @@ -# -*- coding: utf-8 -*- # Copyright 2016-2018 Sylvain LE GAL (https://twitter.com/legalsylvain) # Copyright 2018 David Vidal +# Copyright 2018 Lambda IS DOOEL # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). @@ -57,15 +57,6 @@ class PosOrder(models.Model): }) return res - def _action_create_invoice_line(self, line=False, invoice_id=False): - line = super(PosOrder, self - )._action_create_invoice_line(line, invoice_id) - if not self.returned_order_id: - return line - # Goes to refund invoice thus it should be positive - line.quantity = -line.quantity - return line - def _action_pos_order_invoice(self): """Wrap common process""" self.action_pos_order_invoice() @@ -181,7 +172,7 @@ class PosOrderLine(models.Model): line.returned_line_id.max_returnable_qty([line.id])): raise ValidationError(_( "You can not return %d %s of %s because some refunds" - " has been yet done.\n Maximum quantity allowed :" + " have already been done.\n Maximum quantity allowed :" " %d %s." ) % (-line.qty, line.product_id.uom_id.name, line.product_id.name, diff --git a/pos_order_return/models/product_template.py b/pos_order_return/models/product_template.py index f87215f1..dab5859d 100644 --- a/pos_order_return/models/product_template.py +++ b/pos_order_return/models/product_template.py @@ -1,5 +1,5 @@ -# -*- coding: utf-8 -*- # Copyright 2016-2018 Sylvain LE GAL (https://twitter.com/legalsylvain) +# Copyright 2018 Lambda IS DOOEL # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). from odoo import fields, models diff --git a/pos_order_return/readme/CONFIGURE.rst b/pos_order_return/readme/CONFIGURE.rst new file mode 100644 index 00000000..91f5aa8f --- /dev/null +++ b/pos_order_return/readme/CONFIGURE.rst @@ -0,0 +1,11 @@ +In some cases, you may want to let the possibility to allow negative quantity +in a PoS Order, without mentioning initial order. This can happen for special +products like returnable products, etc. + +In that case, a checkbox is possible on Product Form View to allow such case + +.. image:: /pos_order_return/static/description/product_returnable_bottle.png + +.. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas + :alt: Try me on Runbot + :target: https://runbot.odoo-community.org/runbot/184/10.0 diff --git a/pos_order_return/readme/CONTRIBUTORS.rst b/pos_order_return/readme/CONTRIBUTORS.rst new file mode 100644 index 00000000..4e1bf63f --- /dev/null +++ b/pos_order_return/readme/CONTRIBUTORS.rst @@ -0,0 +1,3 @@ +* Sylvain LE GAL +* David Vidal +* Kiril Vangelovski diff --git a/pos_order_return/readme/CREDITS.rst b/pos_order_return/readme/CREDITS.rst new file mode 100644 index 00000000..f1442796 --- /dev/null +++ b/pos_order_return/readme/CREDITS.rst @@ -0,0 +1,7 @@ +Funders +------- + +The development of this module has been financially supported by: + +* La Louve (www.lalouve.net) +* GRAP, Groupement Régional Alimentaire de Proximité (www.grap.coop) diff --git a/pos_order_return/readme/DESCRIPTION.rst b/pos_order_return/readme/DESCRIPTION.rst new file mode 100644 index 00000000..93ee72fc --- /dev/null +++ b/pos_order_return/readme/DESCRIPTION.rst @@ -0,0 +1,8 @@ +This module extends the functionality of odoo Point Of Sale about POS Order +returns. + +With this module, it is now forbidden to return more quantity than the initial +one. + +A link is created between the returned Order and the initial Order. +A link is created between the returned Order Line and the initial Order Line. diff --git a/pos_order_return/readme/USAGE.rst b/pos_order_return/readme/USAGE.rst new file mode 100644 index 00000000..1a2690ee --- /dev/null +++ b/pos_order_return/readme/USAGE.rst @@ -0,0 +1,24 @@ +Select an PoS Order an choose either *Return Products* (full return of the +order) or *Partial Return*. In this case, a wizard allows to select just some +products and quantities to return: + +.. image:: /pos_order_return/static/description/partial_return_wizard.png + +Register the refund payment to finish the return. If the original order was +invoiced, a refund invoice will be made. + +Implemented Constraints +----------------------- + +* User can not return more products than the initial quantity: + +.. image:: /pos_order_return/static/description/returned_qty_over_initial.png + +* If a line has been partially refund, only a reduced quantity can be returned: + +.. image:: /pos_order_return/static/description/sum_returned_qty_over_initial.png + +* It is not possible to set a negative quantity if the initial Pos Order is + not indicated: + +.. image:: /pos_order_return/static/description/initial_pos_order_required.png diff --git a/pos_order_return/tests/__init__.py b/pos_order_return/tests/__init__.py index 7c46c110..24d89b38 100644 --- a/pos_order_return/tests/__init__.py +++ b/pos_order_return/tests/__init__.py @@ -1,3 +1,2 @@ -# -*- coding: utf-8 -*- from . import test_pos_order_return diff --git a/pos_order_return/tests/test_pos_order_return.py b/pos_order_return/tests/test_pos_order_return.py index ef6cdce7..ecd8da95 100644 --- a/pos_order_return/tests/test_pos_order_return.py +++ b/pos_order_return/tests/test_pos_order_return.py @@ -1,5 +1,5 @@ -# -*- coding: utf-8 -*- # Copyright 2018 Tecnativa - David Vidal +# Copyright 2018 Lambda IS DOOEL # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). from odoo.tests import common diff --git a/pos_order_return/wizard/__init__.py b/pos_order_return/wizard/__init__.py index 601ba34d..ee446c7c 100644 --- a/pos_order_return/wizard/__init__.py +++ b/pos_order_return/wizard/__init__.py @@ -1,3 +1,2 @@ -# -*- coding: utf-8 -*- from . import pos_partial_return_wizard diff --git a/pos_order_return/wizard/pos_partial_return_wizard.py b/pos_order_return/wizard/pos_partial_return_wizard.py index 63a209b2..08e13626 100644 --- a/pos_order_return/wizard/pos_partial_return_wizard.py +++ b/pos_order_return/wizard/pos_partial_return_wizard.py @@ -1,5 +1,5 @@ -# -*- coding: utf-8 -*- # Copyright 2016-2018 Sylvain LE GAL (https://twitter.com/legalsylvain) +# Copyright 2018 Lambda IS DOOEL # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). from odoo import api, fields, models diff --git a/pos_order_return/wizard/pos_partial_return_wizard_view.xml b/pos_order_return/wizard/pos_partial_return_wizard_view.xml index 9f2a3c59..dd92734d 100644 --- a/pos_order_return/wizard/pos_partial_return_wizard_view.xml +++ b/pos_order_return/wizard/pos_partial_return_wizard_view.xml @@ -11,7 +11,7 @@ - +