Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[18.0][MIG] rma_sale #561

Open
wants to merge 95 commits into
base: 18.0
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
95 commits
Select commit Hold shift + click to select a range
1669e96
init branch
JordiBForgeFlow Jul 27, 2017
5ffc2ab
[9.0][FIX] rma:
LoisRForgeFlow Aug 2, 2017
d056a3c
[IMP] default operation in product and product_categ for customer and…
AaronHForgeFlow Aug 16, 2017
37ee649
[9.0][FIX]
LoisRForgeFlow Aug 24, 2017
b703f5d
[9.0][IMP] rma_account:
LoisRForgeFlow Aug 25, 2017
e697b9f
[9.0][IMP] rma_sale:
LoisRForgeFlow Aug 25, 2017
24cdaae
[9.0][FIX] rma_sale: wrong domain
LoisRForgeFlow Sep 19, 2017
9425ab6
[9.0][FIX] rma_sale: product might be changed when creating SO from RMA.
LoisRForgeFlow Oct 11, 2017
87ae155
[9.0][REW] rma_sale: adapt
LoisRForgeFlow Oct 19, 2017
54c1c26
[9.0][FIX] wizards need to specify partner.
LoisRForgeFlow Oct 19, 2017
9729d42
fix rma_sale
LoisRForgeFlow Oct 19, 2017
f58af3d
[9.0][IMP] rma_sale: allow to search by order reference
LoisRForgeFlow Nov 8, 2017
8a2af77
[FIX] allow child partners too
LoisRForgeFlow Nov 13, 2017
c0e8a28
[9.0][IMP] rma: add link to source SO and PO
LoisRForgeFlow Nov 13, 2017
2e85c70
[MIG]rma_sale to v10
AaronHForgeFlow Dec 20, 2017
fd2c356
[IMP] Improved Unit Test Case and Fixed Travis
nikul-serpentcs Nov 10, 2017
0da4677
[FIX]various fixes
AaronHForgeFlow Jan 2, 2018
ea77721
[MIG] Migrated UT & Fixed Travis
nikul-serpentcs Jan 5, 2018
8ebed62
[IMP] Improved Code.
nikul-serpentcs Jan 9, 2018
1f9f3b9
[FIX] Fixed UT & Travis
nikul-serpentcs Jan 10, 2018
d30b5b6
[FIX]compute qty to sell
AaronHForgeFlow Feb 8, 2018
028b8df
[MIG] Migrate configuration and cleanup
max3903 Feb 9, 2018
342ecd7
[FIX] tests
LoisRForgeFlow Apr 18, 2018
7cc133e
[FIX]reverting changes applied to v11
AaronHForgeFlow May 4, 2018
d45073c
[9.0] rma_sale: adapt constraint to view domain
LoisRForgeFlow May 11, 2018
32a252b
[9.0] rma_sale: add default sale operation
LoisRForgeFlow May 18, 2018
4405709
[9.0][REW] rma_sale: complete rework of the tests (they didn't make s…
LoisRForgeFlow May 16, 2018
a758352
fixup! fix
LoisRForgeFlow May 24, 2018
5225e16
[FIX]rma_sale sale_policy instead of sale_type
AaronHForgeFlow May 24, 2018
6f10a32
[9.0] rma: add filters for pending quantities
LoisRForgeFlow May 24, 2018
921f01a
[FIX]when selling use the standard routes not rma ones
AaronHForgeFlow May 25, 2018
f1da58d
[FIX]sale group
AaronHForgeFlow May 25, 2018
b4f0609
[IMP]name get when filling form sale order lines
AaronHForgeFlow May 25, 2018
dfd1daf
[9.0] rma_sale: add advanced refund operation
LoisRForgeFlow May 25, 2018
9f6a088
[IMP]nicer name_get in sale_order_line
AaronHForgeFlow May 31, 2018
7793884
[IMP]update module version
AaronHForgeFlow Jun 28, 2018
6c8eb8e
[MIG]rma_sale to v11
AaronHForgeFlow Aug 22, 2018
9e40d40
[FIX]rma_line view in the sale order line
AaronHForgeFlow Oct 2, 2018
601df0e
[FIX]currency_id was not filled
AaronHForgeFlow Oct 4, 2018
ebd7f9b
[FIX]rma_sale. sale_policy only editable in draft
AaronHForgeFlow Dec 3, 2018
e684a39
[MIG] rma_sale: Migration to 12.0
grindtildeath Mar 12, 2019
eb0ebfc
[SET] Correct website URL for RMA modules
May 24, 2019
b3faee6
[FIX] tests
MiquelRForgeFlow Oct 30, 2019
0183e6f
[FIX]remove autoinstall for rma_account, rma_sale and rma_purchase mo…
AaronHForgeFlow Oct 29, 2019
0da6e4d
[FIX] rma_sale
AaronHForgeFlow Nov 29, 2019
daa6a3d
[FIX] default_gets: avoid using shadowname 'fields'
MiquelRForgeFlow Nov 29, 2019
76fef77
[IMP] : black, isort
AaronHForgeFlow Mar 9, 2020
74e7aae
[MIG]rma_sale v13
AaronHForgeFlow Mar 9, 2020
4b80623
[ENH]rma_sale traceability
AaronHForgeFlow Jan 23, 2020
67e3e5e
[IMP] Update pre-commit lints according with OCA ones
HviorForgeFlow May 29, 2020
e9d5511
[IMP] rma_sale: black, isort, prettier
MateuGForgeFlow Dec 21, 2020
6acc798
[MIG] rma_sale: Migration to 14.0
MateuGForgeFlow Dec 21, 2020
96d7db6
[MIG] rma_sale: Migration to 14.0
MateuGForgeFlow Jan 20, 2021
c2319e3
[MIG] rma_sale: Migration to 14.0
MateuGForgeFlow Jan 27, 2021
c3d9803
[IMP] rma_sale: adapt to simplification on rma.line form view.
LoisRForgeFlow Mar 26, 2021
4d63063
[14.0][MIG] rma*: ir.actions.act_window has different access
LoisRForgeFlow Apr 16, 2021
634dfda
[14.0][FIX] rma_sale: set fiscal position in SO
MateuGForgeFlow Aug 17, 2021
d7fd3a8
Fix Pre-commit Websites
MateuGForgeFlow Oct 6, 2021
c757199
[MIG] rma_sale: Migration to 15.0
JasminSForgeFlow Jan 7, 2022
ced0d8f
[14.0][IMP] rma_sale: make sale policy editable in approved RMAs
AaronHForgeFlow Jan 19, 2022
c33658f
[IMP] rma_sale: Added serial/lot selection on wizard to create rma fr…
ChrisOForgeFlow Jan 25, 2022
5321dc6
[IMP] rma, rma_sale: added select all, messages for UX
ChrisOForgeFlow Jan 28, 2022
13d7290
[IMP] COPIER UPDATE: black, isort, prettier
AaronHForgeFlow Apr 22, 2022
5b02be1
[IMP] rma: Refactor all rma modules in order to consider using the co…
JordiBForgeFlow Mar 2, 2022
6bb78a7
[15.0][IMP] Tests for stock valuation
AaronHForgeFlow Mar 4, 2022
de5e3d2
[FIX] rma_sale: sale policy not being updated from rma group
LoisRForgeFlow May 13, 2022
002cc16
Hide smart button when empty
florian-dacosta Jun 8, 2022
f21ea33
[IMP] Make rma order view cleaner for user
florian-dacosta Jul 1, 2022
cd5e20e
[15.0][FIX] rma_sale: fixup of procurement
DavidJForgeFlow Jul 11, 2022
52360af
[IMP] rma_sale: introduce new config settings.
JordiBForgeFlow Jun 26, 2022
0483d6e
[IMP] rma_sale: add hook _post_process_sale_order for better extensib…
JordiBForgeFlow Aug 8, 2022
9afa000
[FIX] rma_sale: fix author in manifest
LoisRForgeFlow Nov 7, 2022
143e8aa
[FIX] get price unit with all related layers on sale moves
ChrisOForgeFlow Oct 4, 2022
e5f3660
[FIX] include anglo-saxon price unit calculation in refunds.
JordiBForgeFlow Nov 21, 2022
4190a69
[IMP] centralize the logic to get the correct cost of the RMA.
JordiBForgeFlow Nov 23, 2022
c8b5617
[IMP] calculate refund unit price
JordiBForgeFlow Nov 29, 2022
2355188
[FIX] rma_sale: Ensure that configuration on the operation is applied
LoisRForgeFlow Dec 28, 2022
8f1201e
[IMP] rma_sale: adapt to changes in supplier rma group form view.
LoisRForgeFlow Jan 2, 2023
5c8dd47
[IMP] rma_sale: copy group description to rma lines
LoisRForgeFlow Jan 2, 2023
bdd8d77
[14.0][FIX] rma_sale: description not passed to SO
DavidJForgeFlow Jan 23, 2023
9f100b2
[14.0][FIX] rma_sale: duplicate SO also link rma
DavidJForgeFlow Feb 13, 2023
3807cd3
[14.0][FIX] rma_sale: compatibility with refunds free of charge
AaronHForgeFlow Jan 5, 2023
f560f32
[IMP] rma_sale: button cancel
DavidJForgeFlow Feb 15, 2023
594b5e4
[IMP] rma_sale: pre-commit stuff
DavidJForgeFlow Feb 23, 2023
8a758a6
[MIG] rma_sale: Migration to 16.0
DavidJForgeFlow Feb 23, 2023
a1d0572
[FIX] takes invoice and delivery address when creating a rma from a s…
florian-dacosta Sep 29, 2023
c4f9467
[14.0][IMP] added default operation on rma group, easy setup before r…
ChrisOForgeFlow Oct 27, 2023
bcf9de6
[FIX]rma_sale: Error when cancelling rma.order.line without sale orde…
manuelregidor Feb 12, 2024
f0bf47a
[IMP] rma_sale : Add hook to make sale line display name overridable …
florian-dacosta Apr 17, 2024
7a823ab
[IMP] rma_sale: black, isort, prettier
AaronHForgeFlow May 6, 2024
6d5abdd
[MIG] rma_sale: Migration to v17
CarlosVForgeFlow May 6, 2024
494c555
[FIX] rma_sale: name_search migration
AaronHForgeFlow May 6, 2024
cb04464
[IMP] rma_sale : Always create rma line from sale line using stock mo…
florian-dacosta Aug 12, 2024
74fbce6
[REF] rename back method _prepare_rma_line to _prepare_rma_line_from_…
florian-dacosta Jul 31, 2024
924e565
[MIG] rma_sale: Migration to 18.0
JasminSForgeFlow Nov 28, 2024
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
57 changes: 57 additions & 0 deletions rma_sale/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
.. image:: https://img.shields.io/badge/licence-LGPL--3-blue.svg
:alt: License LGPL-3

========
RMA Sale
========

This module allows you to:

#. Import sales order lines into RMA lines
#. Create a sales order and/or sales order line from one or more RMA lines

Usage
=====

**Import existing sales order lines into an RMA:**

This feature is useful when you create an RMA associated to a product that
was shipped and you have as a reference the customer PO number.

#. Access to a customer RMA.
#. Fill the customer.
#. Press the button *Add from Sales Order*.
#. In the wizard add a sales order and click on *add item* to select the
lines you want to add to the RMA.

**Create a sales order and/or sales order line from RMA lines:**

#. Go to a approved RMA line.
#. Click on *Create a Sales Quotation*.
#. In the wizard, select an *Existing Quotation to update* or leave it empty
if you want to create a new one.
#. Fill the quantity to sell in the lines.
#. Hit *Create a Sales Quotation*.

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

Bugs are tracked on `GitHub Issues
<https://github.com/Eficent/stock-rma/issues>`_. In case of trouble, please
check there if your issue has already been reported. If you spotted it first,
help us smashing it by providing a detailed and welcomed feedback.

Credits
=======

Contributors
------------

* Jordi Ballester Alomar <[email protected]>
* Aaron Henriquez <[email protected]>
* Lois Rilo <[email protected]>

Maintainer
----------

This module is maintained by Eficent
4 changes: 4 additions & 0 deletions rma_sale/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Copyright 2020 ForgeFlow S.L.
# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html)
from . import models
from . import wizards
24 changes: 24 additions & 0 deletions rma_sale/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Copyright 2020 ForgeFlow S.L.
# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html)

{
"name": "RMA Sale",
"version": "18.0.1.0.0",
"license": "LGPL-3",
"category": "RMA",
"summary": "Links RMA with Sales Orders",
"author": "ForgeFlow",
"website": "https://github.com/ForgeFlow",
"depends": ["rma_account", "sale_stock"],
"data": [
"security/ir.model.access.csv",
"data/rma_operation.xml",
"views/rma_order_view.xml",
"views/rma_operation_view.xml",
"views/sale_order_view.xml",
"wizards/rma_order_line_make_sale_order_view.xml",
"wizards/rma_add_sale.xml",
"views/rma_order_line_view.xml",
],
"installable": True,
}
28 changes: 28 additions & 0 deletions rma_sale/data/rma_operation.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?xml version="1.0" encoding="utf-8" ?>
<odoo noupdate="1">

<record id="rma_operation_customer_sale" model="rma.operation">
<field name="name">Sale after receive</field>
<field name="code">SL-C</field>
<field name="sale_policy">received</field>
<field name="receipt_policy">ordered</field>
<field name="delivery_policy">no</field>
<field name="refund_policy">no</field>
<field name="type">customer</field>
<field name="in_route_id" ref="rma.route_rma_customer" />
<field name="out_route_id" ref="rma.route_rma_customer" />
</record>

<record id="rma_operation_customer_sale_advanced" model="rma.operation">
<field name="name">Advanced Refund</field>
<field name="code">AR-C</field>
<field name="sale_policy">received</field>
<field name="receipt_policy">ordered</field>
<field name="delivery_policy">no</field>
<field name="refund_policy">received</field>
<field name="type">customer</field>
<field name="in_route_id" ref="rma.route_rma_customer" />
<field name="out_route_id" ref="rma.route_rma_customer" />
</record>

</odoo>
8 changes: 8 additions & 0 deletions rma_sale/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Copyright 2020-2022 ForgeFlow S.L.
# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html)
from . import sale_order_line
from . import sale_order
from . import rma_order_line
from . import rma_order
from . import rma_operation
from . import procurement
37 changes: 37 additions & 0 deletions rma_sale/models/procurement.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# Copyright 2022 ForgeFlow S.L.
# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html)

from odoo import models


class StockRule(models.Model):
_inherit = "stock.rule"

def _get_stock_move_values(
self,
product_id,
product_qty,
product_uom,
location_id,
name,
origin,
company_id,
values,
):
res = super()._get_stock_move_values(
product_id,
product_qty,
product_uom,
location_id,
name,
origin,
company_id,
values,
)
if "rma_line_id" in values:
line = values.get("rma_line_id")
line = self.env["rma.order.line"].browse([line])
if line.reference_move_id:
return res
res["price_unit"] = line._get_price_unit()
return res
26 changes: 26 additions & 0 deletions rma_sale/models/rma_operation.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Copyright 2020 ForgeFlow S.L.
# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html)
from odoo import fields, models


class RmaOperation(models.Model):
_inherit = "rma.operation"

sale_policy = fields.Selection(
[
("no", "Not required"),
("ordered", "Based on Ordered Quantities"),
("received", "Based on Received Quantities"),
],
default="no",
)
auto_confirm_rma_sale = fields.Boolean(
string="Auto confirm Sales Order upon creation from RMA",
help="When a sales is created from an RMA, automatically confirm it",
readonly=False,
)
free_of_charge_rma_sale = fields.Boolean(
string="Free of charge RMA Sales Order",
help="Sales orders created from RMA are free of charge by default",
readonly=False,
)
38 changes: 38 additions & 0 deletions rma_sale/models/rma_order.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# Copyright 2020 ForgeFlow S.L.
# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html)
from odoo import api, fields, models


class RmaOrder(models.Model):
_inherit = "rma.order"

@api.depends(
"rma_line_ids",
"rma_line_ids.sale_line_id",
"rma_line_ids.sale_line_id.order_id",
)
def _compute_sales_count(self):
for rma in self:
sales = rma.mapped("rma_line_ids.sale_line_id.order_id")
rma.sale_count = len(sales)

sale_count = fields.Integer(compute="_compute_sales_count", string="# of Sales")

@api.model
def _get_line_domain(self, rma_id, line):
if line.sale_line_id and line.sale_line_id.id:
domain = [
("rma_id", "=", rma_id.id),
("type", "=", "supplier"),
("sale_line_id", "=", line.sale_line_id.id),
]
else:
domain = super()._get_line_domain(rma_id, line)
return domain

def action_view_sale_order(self):
action = self.env.ref("sale.action_quotations")
result = action.sudo().read()[0]
so_ids = self.mapped("rma_line_ids.sale_line_id.order_id").ids
result["domain"] = [("id", "in", so_ids)]
return result
Loading
Loading