Browse Source

[MIG] pos_order_return: Migration to 11.0

pull/418/head
Kiril Vangelovski 6 years ago
committed by david
parent
commit
6aafc1a6af
  1. 100
      pos_order_return/README.rst
  2. 1
      pos_order_return/__init__.py
  3. 5
      pos_order_return/__manifest__.py
  4. 1
      pos_order_return/models/__init__.py
  5. 13
      pos_order_return/models/pos_order.py
  6. 2
      pos_order_return/models/product_template.py
  7. 11
      pos_order_return/readme/CONFIGURE.rst
  8. 3
      pos_order_return/readme/CONTRIBUTORS.rst
  9. 7
      pos_order_return/readme/CREDITS.rst
  10. 8
      pos_order_return/readme/DESCRIPTION.rst
  11. 24
      pos_order_return/readme/USAGE.rst
  12. 1
      pos_order_return/tests/__init__.py
  13. 2
      pos_order_return/tests/test_pos_order_return.py
  14. 1
      pos_order_return/wizard/__init__.py
  15. 2
      pos_order_return/wizard/pos_partial_return_wizard.py
  16. 2
      pos_order_return/wizard/pos_partial_return_wizard_view.xml

100
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
<https://github.com/OCA/pos/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 <https://twitter.com/legalsylvain>
* David Vidal <david.vidal@tecnativa.com>
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.**

1
pos_order_return/__init__.py

@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
from . import models
from . import wizard

5
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 <david.vidal@tecnativa.com>
# Copyright 2018 Lambda IS DOOEL <https://www.lambda-is.com>
# 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',

1
pos_order_return/models/__init__.py

@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
from . import product_template
from . import pos_order

13
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 <david.vidal@tecnativa.com>
# Copyright 2018 Lambda IS DOOEL <https://www.lambda-is.com>
# 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,

2
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 <https://www.lambda-is.com>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from odoo import fields, models

11
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

3
pos_order_return/readme/CONTRIBUTORS.rst

@ -0,0 +1,3 @@
* Sylvain LE GAL <https://twitter.com/legalsylvain>
* David Vidal <david.vidal@tecnativa.com>
* Kiril Vangelovski <kiril@lambda-is.com>

7
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)

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

24
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

1
pos_order_return/tests/__init__.py

@ -1,3 +1,2 @@
# -*- coding: utf-8 -*-
from . import test_pos_order_return

2
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 <https://www.lambda-is.com>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from odoo.tests import common

1
pos_order_return/wizard/__init__.py

@ -1,3 +1,2 @@
# -*- coding: utf-8 -*-
from . import pos_partial_return_wizard

2
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 <https://www.lambda-is.com>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from odoo import api, fields, models

2
pos_order_return/wizard/pos_partial_return_wizard_view.xml

@ -11,7 +11,7 @@
<group string="Lines to Return">
<field name="line_ids" nolabel="1">
<tree editable="bottom">
<field name="pos_order_line_id"/>
<field name="pos_order_line_id" force_save="1"/>
<field name="initial_qty"/>
<field name="max_returnable_qty"/>
<field name="qty"/>

Loading…
Cancel
Save