Skip to content

Commit

Permalink
[MIG] rma: Migration to 16.0
Browse files Browse the repository at this point in the history
* Standard procedure.
* Transfer view groups to nodes.
* Adjusted upstream changed field names.
* Converted onchanges to computed writable fields.
* Replace `Form` by direct dictionary vals in record creation, as they
  don't handle now properly multiple existing fields in the view, and
  computed writable improve the compatibility on new values.
* Replace domain returned on onchange by static domain in field.
* Change maintainer.

TT44213
  • Loading branch information
pedrobaeza committed Aug 28, 2023
1 parent c093db1 commit ed3f242
Show file tree
Hide file tree
Showing 19 changed files with 350 additions and 457 deletions.
14 changes: 7 additions & 7 deletions rma/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@ Return Merchandise Authorization Management
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Frma-lightgray.png?logo=github
:target: https://github.com/OCA/rma/tree/15.0/rma
:target: https://github.com/OCA/rma/tree/16.0/rma
:alt: OCA/rma
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/rma-15-0/rma-15-0-rma
:target: https://translation.odoo-community.org/projects/rma-16-0/rma-16-0-rma
:alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png
:target: https://runbot.odoo-community.org/runbot/145/15.0
:alt: Try me on Runbot
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
:target: https://runboat.odoo-community.org/webui/builds.html?repo=OCA/rma&target_branch=16.0
:alt: Try me on Runboat

|badge1| |badge2| |badge3| |badge4| |badge5|

Expand Down Expand Up @@ -138,7 +138,7 @@ Bug Tracker
Bugs are tracked on `GitHub Issues <https://github.com/OCA/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 <https://github.com/OCA/rma/issues/new?body=module:%20rma%0Aversion:%2015.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
`feedback <https://github.com/OCA/rma/issues/new?body=module:%20rma%0Aversion:%2016.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 Down Expand Up @@ -184,6 +184,6 @@ Current `maintainer <https://odoo-community.org/page/maintainer-role>`__:

|maintainer-ernestotejeda|

This module is part of the `OCA/rma <https://github.com/OCA/rma/tree/15.0/rma>`_ project on GitHub.
This module is part of the `OCA/rma <https://github.com/OCA/rma/tree/16.0/rma>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
6 changes: 4 additions & 2 deletions rma/__manifest__.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
# Copyright 2020 Tecnativa - Ernesto Tejeda
# Copyright 2021-2023 Tecnativa - David Vidal
# Copyright 2021-2023 Tecnativa - Pedro M. Baeza
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
{
"name": "Return Merchandise Authorization Management",
"summary": "Return Merchandise Authorization (RMA)",
"version": "15.0.1.1.3",
"version": "16.0.1.0.0",
"development_status": "Production/Stable",
"category": "RMA",
"website": "https://github.com/OCA/rma",
"author": "Tecnativa, Odoo Community Association (OCA)",
"maintainers": ["ernestotejeda"],
"maintainers": ["pedrobaeza"],
"license": "AGPL-3",
"depends": ["stock_account"],
"data": [
Expand Down
99 changes: 0 additions & 99 deletions rma/migrations/15.0.1.0.0/noupdate_changes.xml

This file was deleted.

18 changes: 0 additions & 18 deletions rma/migrations/15.0.1.0.0/post-migration.py

This file was deleted.

14 changes: 8 additions & 6 deletions rma/models/res_company.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
# Copyright 2020 Tecnativa - Ernesto Tejeda
# Copyright 2023 Tecnativa - Pedro M. Baeza
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

from odoo import _, api, fields, models


class Company(models.Model):
class ResCompany(models.Model):
_inherit = "res.company"

def _default_rma_mail_confirmation_template(self):
Expand Down Expand Up @@ -65,11 +66,12 @@ def _default_rma_mail_draft_template(self):
help="Email sent to the customer when they place " "an RMA from the portal",
)

@api.model
def create(self, vals):
company = super(Company, self).create(vals)
company.create_rma_index()
return company
@api.model_create_multi
def create(self, vals_list):
companies = super().create(vals_list)
for company in companies:
company.create_rma_index()
return companies

def create_rma_index(self):
return (
Expand Down
Loading

0 comments on commit ed3f242

Please sign in to comment.