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 Feb 18, 2025
1 parent eb32bed commit 6b7bb4e
Show file tree
Hide file tree
Showing 15 changed files with 461 additions and 454 deletions.
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
22 changes: 0 additions & 22 deletions rma/migrations/14.0.1.1.2/pre-migration.py

This file was deleted.

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
2 changes: 1 addition & 1 deletion rma/tests/test_rma.py
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ def _create_product(cls, name, tracking="none"):
{
"name": name,
"categ_id": cls.category.id,
"type": "product",
"is_storable": True,
"tracking": tracking,
}
)
Expand Down
10 changes: 5 additions & 5 deletions rma/views/rma_operation_view.xml
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
<?xml version="1.0" encoding="utf-8" ?>
<odoo>
<record id="rma_operation_tree" model="ir.ui.view">
<field name="name">rma.operation.tree</field>
<field name="name">rma.operation.list</field>
<field name="model">rma.operation</field>
<field name="arch" type="xml">
<tree name="RMA Operations">
<list name="RMA Operations">
<field name="active" invisible="1" />
<field name="code" />
<field name="name" />
<field name="receipt_policy" />
<field name="delivery_policy" />
</tree>
</list>
</field>
</record>

Expand Down Expand Up @@ -71,7 +71,7 @@
<record id="action_rma_operation_customer" model="ir.actions.act_window">
<field name="name">Customer Operations</field>
<field name="res_model">rma.operation</field>
<field name="view_mode">tree,form</field>
<field name="view_mode">list,form</field>
<field name="context">{'default_type': "customer"}</field>
<field name="domain">[('type','=', 'customer')]</field>
<field name="view_id" ref="rma_operation_tree" />
Expand All @@ -80,7 +80,7 @@
<record id="action_rma_operation_supplier" model="ir.actions.act_window">
<field name="name">Supplier Operations</field>
<field name="res_model">rma.operation</field>
<field name="view_mode">tree,form</field>
<field name="view_mode">list,form</field>
<field name="context">{'default_type': "supplier"}</field>
<field name="domain">[('type','=', 'supplier')]</field>
<field name="view_id" ref="rma_operation_tree" />
Expand Down
Loading

0 comments on commit 6b7bb4e

Please sign in to comment.