Skip to content

Commit

Permalink
[MIG] rma: Migration to 18.0
Browse files Browse the repository at this point in the history
  • Loading branch information
JasminSForgeFlow committed Nov 27, 2024
1 parent 306acd4 commit e1179b8
Show file tree
Hide file tree
Showing 17 changed files with 499 additions and 514 deletions.
6 changes: 3 additions & 3 deletions rma/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ RMA (Return Merchandise Authorization)
:target: http://www.gnu.org/licenses/lgpl-3.0-standalone.html
:alt: License: LGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-ForgeFlow%2Fstock--rma-lightgray.png?logo=github
:target: https://github.com/ForgeFlow/stock-rma/tree/17.0/rma
:target: https://github.com/ForgeFlow/stock-rma/tree/18.0/rma
:alt: ForgeFlow/stock-rma

|badge1| |badge2| |badge3|
Expand Down Expand Up @@ -128,7 +128,7 @@ Bug Tracker
Bugs are tracked on `GitHub Issues <https://github.com/ForgeFlow/stock-rma/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/ForgeFlow/stock-rma/issues/new?body=module:%20rma%0Aversion:%2017.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
`feedback <https://github.com/ForgeFlow/stock-rma/issues/new?body=module:%20rma%0Aversion:%2018.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.

Expand All @@ -155,6 +155,6 @@ Contributors
Maintainers
-----------

This module is part of the `ForgeFlow/stock-rma <https://github.com/ForgeFlow/stock-rma/tree/17.0/rma>`_ project on GitHub.
This module is part of the `ForgeFlow/stock-rma <https://github.com/ForgeFlow/stock-rma/tree/18.0/rma>`_ project on GitHub.

You are welcome to contribute.
2 changes: 1 addition & 1 deletion rma/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

{
"name": "RMA (Return Merchandise Authorization)",
"version": "17.0.1.0.0",
"version": "18.0.1.0.0",
"license": "LGPL-3",
"category": "RMA",
"summary": "Introduces the return merchandise authorization (RMA) process in odoo",
Expand Down
2 changes: 0 additions & 2 deletions rma/models/stock_move.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,6 @@ def _update_reserved_quantity(
self,
need,
location_id,
quant_ids=None,
lot_id=None,
package_id=None,
owner_id=None,
Expand All @@ -94,7 +93,6 @@ def _update_reserved_quantity(
return super()._update_reserved_quantity(
need,
location_id,
quant_ids=quant_ids,
lot_id=lot_id,
package_id=package_id,
owner_id=owner_id,
Expand Down
1 change: 0 additions & 1 deletion rma/models/stock_warehouse.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@ def write(self, vals):
"usage": "internal",
"location_id": wh.view_location_id.id,
"company_id": wh.company_id.id,
"return_location": True,
}
)
# RMA types
Expand Down
41 changes: 20 additions & 21 deletions rma/report/rma_report.xml
Original file line number Diff line number Diff line change
@@ -1,24 +1,23 @@
<?xml version="1.0" encoding="utf-8" ?>
<odoo>

<record id="rma_order_line_report" model="ir.actions.report">
<field name="name">RMA</field>
<field name="model">rma.order.line</field>
<field name="report_type">qweb-pdf</field>
<field name="report_name">rma.report_rma_order_line</field>
<field name="report_file">rma.report_rma_order_line</field>
<field name="print_report_name">('RMA - %s' % (object.name))</field>
<field name="binding_model_id" ref="model_rma_order_line" />
<field name="binding_type">report</field>
</record>
<record id="rma_order_report" model="ir.actions.report">
<field name="name">RMA Group</field>
<field name="model">rma.order</field>
<field name="report_type">qweb-pdf</field>
<field name="report_name">rma.report_rma_order</field>
<field name="report_file">rma.report_rma_order</field>
<field name="print_report_name">('RMA Group - %s' % (object.name))</field>
<field name="binding_model_id" ref="model_rma_order" />
<field name="binding_type">report</field>
</record>
<record id="rma_order_line_report" model="ir.actions.report">
<field name="name">RMA</field>
<field name="model">rma.order.line</field>
<field name="report_type">qweb-pdf</field>
<field name="report_name">rma.report_rma_order_line</field>
<field name="report_file">rma.report_rma_order_line</field>
<field name="print_report_name">('RMA - %s' % (object.name))</field>
<field name="binding_model_id" ref="model_rma_order_line" />
<field name="binding_type">report</field>
</record>
<record id="rma_order_report" model="ir.actions.report">
<field name="name">RMA Group</field>
<field name="model">rma.order</field>
<field name="report_type">qweb-pdf</field>
<field name="report_name">rma.report_rma_order</field>
<field name="report_file">rma.report_rma_order</field>
<field name="print_report_name">('RMA Group - %s' % (object.name))</field>
<field name="binding_model_id" ref="model_rma_order" />
<field name="binding_type">report</field>
</record>
</odoo>
58 changes: 35 additions & 23 deletions rma/report/rma_report_templates.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
<t t-call="web.external_layout">
<t t-set="doc" t-value="doc.with_context({'lang':doc.partner_id.lang})" />
<div class="page">
<div class="oe_structure" />
<div class="row">
<div class="col-6">
<t
Expand Down Expand Up @@ -39,11 +38,11 @@
class="mt8"
>
<strong>Shipping address:</strong>
<div
<div
t-field="doc.customer_address_id"
t-options='{"widget": "contact", "fields": ["address", "name", "phone", "fax"], "no_marker": True, "phone_icons": True}'
/>
<p t-if="doc.customer_address_id.vat">VAT: <span
<p t-if="doc.customer_address_id.vat">VAT: <span
t-field="doc.customer_address_id.vat"
/></p>
</div>
Expand Down Expand Up @@ -89,13 +88,15 @@
<th name="quantity" class="text-right">Quantity</th>
<th name="unit_price" class="text-right">Unit Price</th>
</tr>
</thead>
<tbody>
</thead>
<tbody>
<tr>
<td name="product"><span t-field="doc.product_id" /></td>
<td name="lot" t-if="doc.lot_id"><span
t-field="doc.lot_id"
/></td>
<td name="product">
<span t-field="doc.product_id" />
</td>
<td name="lot" t-if="doc.lot_id">
<span t-field="doc.lot_id" />
</td>
<td name="quantity" class="text-right">
<span t-field="doc.product_qty" />
<span t-field="doc.uom_id" groups="uom.group_uom" />
Expand All @@ -110,11 +111,15 @@
</tbody>
</table>
<div t-if="doc.description">
<strong><p>Description</p></strong>
<strong>
<p>Description</p>
</strong>
<span t-field="doc.description" />
</div>
<div t-if="doc.conditions">
<strong><p>Term and conditions</p></strong>
<strong>
<p>Term and conditions</p>
</strong>
<span t-field="doc.conditions" />
</div>
</div>
Expand All @@ -138,7 +143,6 @@
<t t-call="web.external_layout">
<t t-set="doc" t-value="doc.with_context({'lang':doc.partner_id.lang})" />
<div class="page">
<div class="oe_structure" />
<div class="row">
<div class="col-6">
<t
Expand Down Expand Up @@ -173,11 +177,11 @@
class="mt8"
>
<strong>Shipping address:</strong>
<div
<div
t-field="doc.customer_address_id"
t-options='{"widget": "contact", "fields": ["address", "name", "phone", "fax"], "no_marker": True, "phone_icons": True}'
/>
<p t-if="doc.customer_address_id.vat">VAT: <span
<p t-if="doc.customer_address_id.vat">VAT: <span
t-field="doc.customer_address_id.vat"
/></p>
</div>
Expand Down Expand Up @@ -228,15 +232,21 @@
<th class="text-right">Quantity</th>
<th class="text-right">Unit Price</th>
</tr>
</thead>
<tbody>
</thead>
<tbody>
<tr t-foreach="doc.rma_line_ids" t-as="l">
<td><span t-field="l.origin" /></td>
<td><span t-field="l.operation_id.name" /></td>
<td><span t-field="l.product_id" /></td>
<td name="lot" t-if="print_lot_column"><span
t-field="l.lot_id"
/></td>
<td>
<span t-field="l.origin" />
</td>
<td>
<span t-field="l.operation_id.name" />
</td>
<td>
<span t-field="l.product_id" />
</td>
<td name="lot" t-if="print_lot_column">
<span t-field="l.lot_id" />
</td>
<td class="text-right">
<span t-field="l.product_qty" />
<span t-field="l.uom_id" groups="uom.group_uom" />
Expand All @@ -248,7 +258,9 @@
</tbody>
</table>
<div t-if="doc.comment">
<strong><p>Additional Information</p></strong>
<strong>
<p>Additional Information</p>
</strong>
<span t-field="doc.comment" />
</div>
</div>
Expand Down
13 changes: 7 additions & 6 deletions rma/static/description/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,11 @@

/*
:Author: David Goodger ([email protected])
:Id: $Id: html4css1.css 8954 2022-01-20 10:10:25Z milde $
:Id: $Id: html4css1.css 9511 2024-01-13 09:50:07Z milde $
:Copyright: This stylesheet has been placed in the public domain.
Default cascading style sheet for the HTML output of Docutils.
Despite the name, some widely supported CSS2 features are used.
See https://docutils.sourceforge.io/docs/howto/html-stylesheets.html for how to
customize this style sheet.
Expand Down Expand Up @@ -274,7 +275,7 @@
margin-left: 2em ;
margin-right: 2em }

pre.code .ln { color: grey; } /* line numbers */
pre.code .ln { color: gray; } /* line numbers */
pre.code, code { background-color: #eeeeee }
pre.code .comment, code .comment { color: #5C6576 }
pre.code .keyword, code .keyword { color: #3B0D06; font-weight: bold }
Expand All @@ -300,7 +301,7 @@
span.pre {
white-space: pre }

span.problematic {
span.problematic, pre.problematic {
color: red }

span.section-subtitle {
Expand Down Expand Up @@ -368,7 +369,7 @@ <h1 class="title">RMA (Return Merchandise Authorization)</h1>
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:310ce4e3f5919e5be643c54f11481d09bb8fc79cab65f08ac969ef3bf9d799fe
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<p><a class="reference external image-reference" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external image-reference" href="http://www.gnu.org/licenses/lgpl-3.0-standalone.html"><img alt="License: LGPL-3" src="https://img.shields.io/badge/licence-LGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/ForgeFlow/stock-rma/tree/17.0/rma"><img alt="ForgeFlow/stock-rma" src="https://img.shields.io/badge/github-ForgeFlow%2Fstock--rma-lightgray.png?logo=github" /></a></p>
<p><a class="reference external image-reference" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external image-reference" href="http://www.gnu.org/licenses/lgpl-3.0-standalone.html"><img alt="License: LGPL-3" src="https://img.shields.io/badge/licence-LGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/ForgeFlow/stock-rma/tree/18.0/rma"><img alt="ForgeFlow/stock-rma" src="https://img.shields.io/badge/github-ForgeFlow%2Fstock--rma-lightgray.png?logo=github" /></a></p>
<p>A Return Merchandise Authorization (RMA), is a part of the process of
returning a product in order to receive a refund, replacement, or repair
during the product’s warranty period.</p>
Expand Down Expand Up @@ -485,7 +486,7 @@ <h1><a class="toc-backref" href="#toc-entry-7">Bug Tracker</a></h1>
<p>Bugs are tracked on <a class="reference external" href="https://github.com/ForgeFlow/stock-rma/issues">GitHub Issues</a>.
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
<a class="reference external" href="https://github.com/ForgeFlow/stock-rma/issues/new?body=module:%20rma%0Aversion:%2017.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
<a class="reference external" href="https://github.com/ForgeFlow/stock-rma/issues/new?body=module:%20rma%0Aversion:%2018.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
<p>Do not contact contributors directly about support or help with technical issues.</p>
</div>
<div class="section" id="credits">
Expand All @@ -511,7 +512,7 @@ <h2><a class="toc-backref" href="#toc-entry-10">Contributors</a></h2>
</div>
<div class="section" id="maintainers">
<h2><a class="toc-backref" href="#toc-entry-11">Maintainers</a></h2>
<p>This module is part of the <a class="reference external" href="https://github.com/ForgeFlow/stock-rma/tree/17.0/rma">ForgeFlow/stock-rma</a> project on GitHub.</p>
<p>This module is part of the <a class="reference external" href="https://github.com/ForgeFlow/stock-rma/tree/18.0/rma">ForgeFlow/stock-rma</a> project on GitHub.</p>
<p>You are welcome to contribute.</p>
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion rma/tests/test_rma.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ def _create_product_category(
@classmethod
def _create_product(cls, name):
return cls.product_product_model.create(
{"name": name, "categ_id": cls.category.id, "type": "product"}
{"name": name, "categ_id": cls.category.id, "is_storable": True}
)

@classmethod
Expand Down
65 changes: 19 additions & 46 deletions rma/views/res_config_settings_views.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,67 +8,40 @@
<field name="inherit_id" ref="base.res_config_settings_view_form" />
<field name="arch" type="xml">
<xpath expr="//form" position="inside">
<div
class="app_settings_block"
<app
data-string="RMA"
string="RMA"
data-key="rma"
name="rma"
groups="rma.group_rma_manager"
>
<h2>Return Merchandise Authorization</h2>
<div class="row mt16 o_settings_container">
<div
name="rma_delivery_address"
class="col-12 col-lg-6 o_setting_box"
<block title="Return Merchandise Authorization" name="rma_config">
<setting
id="rma_delivery_address"
help="Display 3 fields on rma: partner, invoice address, delivery address"
>
<div class="o_setting_left_pane">
<field name="group_rma_delivery_address" />
</div>
<div class="o_setting_right_pane">
<label for="group_rma_delivery_address" />
<div class="text-muted">
Display 3 fields on rma: partner, invoice address, delivery address
</div>
</div>
</div>
<div
name="group_rma_lines"
class="col-12 col-lg-6 o_setting_box"
<field name="group_rma_delivery_address" />
</setting>
<setting
id="group_rma_lines"
help="Group RMA lines in one RMA group"
>
<div class="o_setting_left_pane">
<field name="group_rma_lines" />
</div>
<div class="o_setting_right_pane">
<label for="group_rma_lines" />
<div class="text-muted">
Group RMA lines in one RMA group
</div>
</div>
</div>
<div name="rma_account" class="col-12 col-lg-6 o_setting_box">
<div class="o_setting_left_pane">
<field name="module_rma_account" />
</div>
<div class="o_setting_right_pane">
<label for="module_rma_account" />
<div class="text-muted">
Enable RMA invoicing
</div>
</div>
</div>
</div>
</div>
<field name="group_rma_lines" />
</setting>
<setting id="rma_delivery_address" help="Enable RMA invoicing">
<field name="module_rma_account" />
</setting>
</block>
</app>
</xpath>
</field>
</record>

<record id="action_rma_config_settings" model="ir.actions.act_window">
<field name="name">Settings</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">res.config.settings</field>
<field name="view_mode">form</field>
<field name="target">inline</field>
<field name="context">{'module' : 'rma'}</field>
<field name="context">{'module' : 'rma', 'bin_size': False}</field>
</record>

</odoo>
Loading

0 comments on commit e1179b8

Please sign in to comment.