Skip to content

Commit

Permalink
[ADD] rma_receipt_location
Browse files Browse the repository at this point in the history
  • Loading branch information
FrankC013 committed May 31, 2024
1 parent b41cb76 commit 67d79f7
Show file tree
Hide file tree
Showing 12 changed files with 558 additions and 0 deletions.
63 changes: 63 additions & 0 deletions rma_receipt_location/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
====================
RMA Receipt Location
====================

..
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:e1d08f952b548f3fd8444c00f32b480c6c059a0725eb14b013c10ffc16cad523
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
:target: https://odoo-community.org/page/development-status
:alt: Beta
.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-NuoBiT%2Fodoo--addons-lightgray.png?logo=github
:target: https://github.com/NuoBiT/odoo-addons/tree/14.0/rma_receipt_location
:alt: NuoBiT/odoo-addons

|badge1| |badge2| |badge3|

This module adds a location field to the RMA and sets it as the receipt location.

**Table of contents**

.. contents::
:local:

Bug Tracker
===========

Bugs are tracked on `GitHub Issues <https://github.com/NuoBiT/odoo-addons/issues>`_.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us to smash it by providing a detailed and welcomed
`feedback <https://github.com/NuoBiT/odoo-addons/issues/new?body=module:%20rma_receipt_location%0Aversion:%2014.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.

Do not contact contributors directly about support or help with technical issues.

Credits
=======

Authors
~~~~~~~

* NuoBiT Solutions
* S.L.

Contributors
~~~~~~~~~~~~

* `Nuobit <https://www.nuobit.com>`_:

* Frank Cespedes <[email protected]>

Maintainers
~~~~~~~~~~~

This module is part of the `NuoBiT/odoo-addons <https://github.com/NuoBiT/odoo-addons/tree/14.0/rma_receipt_location>`_ project on GitHub.

You are welcome to contribute.
1 change: 1 addition & 0 deletions rma_receipt_location/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import models
15 changes: 15 additions & 0 deletions rma_receipt_location/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Copyright NuoBiT - Frank Cespedes <[email protected]>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl)

{
"name": "RMA Receipt Location",
"summary": "This module adds a location field to the RMA "
"and sets it as the receipt location",
"version": "14.0.1.0.0",
"category": "RMA",
"author": "NuoBiT Solutions, S.L.",
"website": "https://github.com/nuobit/odoo-addons",
"license": "AGPL-3",
"depends": ["rma"],
"data": ["views/rma_views.xml"],
}
1 change: 1 addition & 0 deletions rma_receipt_location/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import rma
32 changes: 32 additions & 0 deletions rma_receipt_location/models/rma.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Copyright NuoBiT - Frank Cespedes <[email protected]>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl)


from odoo import api, fields, models


class Rma(models.Model):
_inherit = "rma"

receipt_location_id = fields.Many2one(
comodel_name="stock.location",
string="Receipt Location",
compute="_compute_receipt_location_id",
store=True,
readonly=False,
)

@api.depends("partner_id")
def _compute_receipt_location_id(self):
for rec in self:
rec.receipt_location_id = rec.partner_id.property_stock_customer

def _prepare_picking(self, picking_form):
picking_form.origin = self.name
picking_form.partner_id = self.partner_shipping_id
picking_form.location_id = self.receipt_location_id
picking_form.location_dest_id = self.location_id
with picking_form.move_ids_without_package.new() as move_form:
move_form.product_id = self.product_id
move_form.product_uom_qty = self.product_uom_qty
move_form.product_uom = self.product_uom
3 changes: 3 additions & 0 deletions rma_receipt_location/readme/CONTRIBUTORS.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
* `Nuobit <https://www.nuobit.com>`_:

* Frank Cespedes <[email protected]>
1 change: 1 addition & 0 deletions rma_receipt_location/readme/DESCRIPTION.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
This module adds a location field to the RMA and sets it as the receipt location.
Binary file added rma_receipt_location/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.
Loading

0 comments on commit 67d79f7

Please sign in to comment.