-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
165 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
.. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg | ||
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html | ||
:alt: License: AGPL-3 | ||
|
||
====================== | ||
RMA + Sale Integration | ||
====================== | ||
|
||
|
||
Installation | ||
============ | ||
|
||
To install this module, you need to: | ||
|
||
1. Clone the branch 14.0 of the repository https://github.com/open-synergy/ssi-rma | ||
2. Add the path to this repository in your configuration (addons-path) | ||
3. Update the module list (Must be on developer mode) | ||
4. Go to menu *Apps -> Apps -> Main Apps* | ||
5. Search For *RMA + Sale Integration* | ||
6. Install the module | ||
|
||
Bug Tracker | ||
=========== | ||
|
||
Bugs are tracked on `GitHub Issues | ||
<https://github.com/open-synergy/ssi-rma/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 | ||
------------ | ||
|
||
* Andhitia Rama <[email protected]> | ||
|
||
Maintainer | ||
---------- | ||
|
||
.. image:: https://simetri-sinergi.id/logo.png | ||
:alt: PT. Simetri Sinergi Indonesia | ||
:target: https://simetri-sinergi.id.com | ||
|
||
This module is maintained by the PT. Simetri Sinergi Indonesia. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# Copyright 2023 OpenSynergy Indonesia | ||
# Copyright 2023 PT. Simetri Sinergi Indonesia | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). | ||
|
||
from . import ( | ||
models, | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# Copyright 2023 OpenSynergy Indonesia | ||
# Copyright 2023 PT. Simetri Sinergi Indonesia | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). | ||
|
||
{ | ||
"name": "RMA + Sale Integration", | ||
"version": "14.0.1.0.0", | ||
"website": "https://simetri-sinergi.id", | ||
"author": "PT. Simetri Sinergi Indonesia, OpenSynergy Indonesia", | ||
"license": "AGPL-3", | ||
"installable": True, | ||
"depends": ["ssi_rma_account", "ssi_sale"], | ||
"data": [ | ||
"views/rma_customer_views.xml", | ||
], | ||
"demo": [], | ||
"images": [], | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# Copyright 2023 OpenSynergy Indonesia | ||
# Copyright 2023 PT. Simetri Sinergi Indonesia | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). | ||
|
||
from . import ( | ||
rma_customer_line, | ||
stock_rule, | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
# Copyright 2023 OpenSynergy Indonesia | ||
# Copyright 2023 PT. Simetri Sinergi Indonesia | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). | ||
|
||
from odoo import fields, models | ||
|
||
|
||
class RMACustomerLine(models.Model): | ||
_name = "rma_customer_line" | ||
_inherit = [ | ||
"rma_line_mixin", | ||
"rma_customer_line", | ||
] | ||
|
||
sale_line_id = fields.Many2one( | ||
related="source_stock_move_id.sale_line_id", | ||
store=False, | ||
) | ||
|
||
def _get_receipt_procurement_data(self): | ||
_super = super(RMACustomerLine, self) | ||
result = _super._get_receipt_procurement_data() | ||
sale_line_id = self.sale_line_id and self.sale_line_id.id or False | ||
to_refund = sale_line_id and True or False | ||
result.update( | ||
{ | ||
"sale_line_id": sale_line_id, | ||
"to_refund": to_refund, | ||
} | ||
) | ||
return result | ||
|
||
def _get_delivery_procurement_data(self): | ||
_super = super(RMACustomerLine, self) | ||
result = _super._get_delivery_procurement_data() | ||
sale_line_id = self.sale_line_id and self.sale_line_id.id or False | ||
source_stock_move_id = ( | ||
self.source_stock_move_id and self.source_stock_move_id.id or False | ||
) | ||
to_refund = sale_line_id and True or False | ||
result.update( | ||
{ | ||
"sale_line_id": sale_line_id, | ||
"origin_returned_move_id": source_stock_move_id, | ||
"to_refund": to_refund, | ||
} | ||
) | ||
return result |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# Copyright 2023 OpenSynergy Indonesia | ||
# Copyright 2023 PT. Simetri Sinergi Indonesia | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). | ||
|
||
from odoo import models | ||
|
||
|
||
class StockRule(models.Model): | ||
_name = "stock.rule" | ||
_inherit = ["stock.rule"] | ||
|
||
def _get_custom_move_fields(self): | ||
_super = super(StockRule, self) | ||
result = _super._get_custom_move_fields() | ||
result += [ | ||
"to_refund", | ||
"origin_returned_move_id", | ||
] | ||
return result |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<?xml version="1.0" encoding="utf-8" ?> | ||
<!--Copyright 2023 OpenSynergy Indonesia--> | ||
<!--Copyright 2023 PT. Simetri Sinergi Indonesia--> | ||
<!--License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).--> | ||
<odoo> | ||
|
||
<record id="rma_customer_view_form" model="ir.ui.view"> | ||
<field name="name">RMA Customers - Form</field> | ||
<field name="model">rma_customer</field> | ||
<field name="inherit_id" ref="ssi_rma.rma_customer_view_form" /> | ||
<field name="arch" type="xml"> | ||
<data> | ||
<xpath expr="//field[@name='source_stock_move_id']" position="after"> | ||
<field name="sale_line_id" /> | ||
</xpath> | ||
</data> | ||
</field> | ||
</record> | ||
</odoo> |