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] base_revision: Migration to 18.0 #1016

Open
wants to merge 14 commits into
base: 18.0
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 3 additions & 1 deletion base_revision/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ Base Revision (abstract)
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:2746724ea785f12468aaff9dee4aec94036aab03df38394da1d4581105ec2eef
!! source digest: sha256:3d59ecb388d6e3bad95b46b726acabb228c6194e53e7296313a0ac1a3d4a5b05
18.0
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
Expand Down Expand Up @@ -91,6 +92,7 @@ Authors
Contributors
------------


- Devang Pipaliya <devang@dreambits.in>
- Lorenzo Battistini <lorenzo.battistini@agilebg.com>
- Raphael Valyi <rvalyi@akretion.com>
Expand Down
2 changes: 2 additions & 0 deletions base_revision/i18n/base_revision.pot
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,14 @@ msgstr ""
#. module: base_revision
#. odoo-python
#: code:addons/base_revision/models/base_revision.py:0
#, python-format
msgid "New Revisions"
msgstr ""

#. module: base_revision
#. odoo-python
#: code:addons/base_revision/models/base_revision.py:0
#, python-format
msgid "New revision created: %s"
msgstr ""

Expand Down
2 changes: 2 additions & 0 deletions base_revision/i18n/es.po
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,14 @@ msgstr "Tiene revisiones antiguas"
#. module: base_revision
#. odoo-python
#: code:addons/base_revision/models/base_revision.py:0
#, python-format
msgid "New Revisions"
msgstr "Nuevas revisiones"

#. module: base_revision
#. odoo-python
#: code:addons/base_revision/models/base_revision.py:0
#, python-format
msgid "New revision created: %s"
msgstr "Nueva revisión creada: %s"

Expand Down
2 changes: 2 additions & 0 deletions base_revision/i18n/it.po
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,14 @@ msgstr "Ha revisioni precedenti"
#. module: base_revision
#. odoo-python
#: code:addons/base_revision/models/base_revision.py:0
#, python-format
msgid "New Revisions"
msgstr "Nuove revisioni"

#. module: base_revision
#. odoo-python
#: code:addons/base_revision/models/base_revision.py:0
#, python-format
msgid "New revision created: %s"
msgstr "Nuova revisione creata: %s"

Expand Down
11 changes: 5 additions & 6 deletions base_revision/models/base_revision.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,17 +63,16 @@ def _compute_revision_count(self):
)
]

@api.returns("self", lambda value: value.id)
def copy(self, default=None):
default = default or {}
if "unrevisioned_name" not in default:
default["unrevisioned_name"] = False
revision_records = super().copy(default=default)
for rec in revision_records:
if rec.unrevisioned_name:
continue
rec = super().copy(default=default)
if not rec.unrevisioned_name:
name_field = self._context.get("revision_name_field", "name")
rec.write({"unrevisioned_name": rec[name_field]})
return revision_records
return rec

def _get_new_rev_data(self, new_rev_number):
self.ensure_one()
Expand Down Expand Up @@ -122,7 +121,7 @@ def create_revision(self):
"view_mode": "list,form",
"name": _("New Revisions"),
"res_model": self._name,
"domain": f"[('id', 'in', {revision_ids})]",
"domain": _("[('id', 'in', %s)]") % revision_ids,
"target": "current",
}
return action
2 changes: 1 addition & 1 deletion base_revision/static/description/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,7 @@ <h1 class="title">Base Revision (abstract)</h1>
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:2746724ea785f12468aaff9dee4aec94036aab03df38394da1d4581105ec2eef
!! source digest: sha256:3d59ecb388d6e3bad95b46b726acabb228c6194e53e7296313a0ac1a3d4a5b05
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<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/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/OCA/server-ux/tree/18.0/base_revision"><img alt="OCA/server-ux" src="https://img.shields.io/badge/github-OCA%2Fserver--ux-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/server-ux-18-0/server-ux-18-0-base_revision"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external image-reference" href="https://runboat.odoo-community.org/builds?repo=OCA/server-ux&amp;target_branch=18.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
<p>Making revision(s) of a document is a common need across many area.</p>
Expand Down