Skip to content

Commit

Permalink
Merge PR #686 into 15.0
Browse files Browse the repository at this point in the history
Signed-off-by hbrunn
  • Loading branch information
OCA-git-bot committed Aug 29, 2023
2 parents b8a07f9 + 74e0464 commit 90afff5
Show file tree
Hide file tree
Showing 18 changed files with 806 additions and 0 deletions.
1 change: 1 addition & 0 deletions setup/web_archive_date/odoo/addons/web_archive_date
6 changes: 6 additions & 0 deletions setup/web_archive_date/setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import setuptools

setuptools.setup(
setup_requires=['setuptools-odoo'],
odoo_addon=True,
)
98 changes: 98 additions & 0 deletions web_archive_date/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
================
Web Archive Date
================

.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
:target: https://odoo-community.org/page/development-status
:alt: Beta
.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fserver--ux-lightgray.png?logo=github
:target: https://github.com/OCA/server-ux/tree/13.0/web_archive_date
:alt: OCA/server-ux
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/server-ux-13-0/server-ux-13-0-web_archive_date
:alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png
:target: https://runbot.odoo-community.org/runbot/250/13.0
:alt: Try me on Runbot

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

Glue module between `web` and `base_archive_date`.

This module adds the `Latest Archived Date:` and `Latest Archived by:` as fields showing in the metadata of a record. Just like the `Latest Modification Date:` (write_date) or the `Created by:` (create_uid).

**Table of contents**

.. contents::
:local:

Usage
=====

#. Install the module, archive a record and show on the Metdata of the record and you'll
be able to see the `Latest Archived Date` `Latest Archived by` there.
#. To check the Metadata:
* Activate the Developer Mode.
* Click on the `bug`, once the markdown appears, click on the View Metadata button.
* You can check the `Latest Archived Date` and `Latest Archived by` value once the record has been archived previously.

Known issues / Roadmap
======================

Bug Tracker
===========

Bugs are tracked on `GitHub Issues <https://github.com/OCA/server-ux/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/server-ux/issues/new?body=module:%20web_archive_date%0Aversion:%2013.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.

Credits
=======

Authors
~~~~~~~

* ForgeFlow

Contributors
~~~~~~~~~~~~

* `ForgeFlow S.L. <https://www.forgeflow.com>`_:

* Guillem Casassas <[email protected]>

Maintainers
~~~~~~~~~~~

This module is maintained by the OCA.

.. image:: https://odoo-community.org/logo.png
:alt: Odoo Community Association
:target: https://odoo-community.org

OCA, or the Odoo Community Association, is a nonprofit organization whose
mission is to support the collaborative development of Odoo features and
promote its widespread use.

.. |maintainer-GuillemCForgeFlow| image:: https://github.com/GuillemCForgeFlow.png?size=40px
:target: https://github.com/GuillemCForgeFlow
:alt: GuillemCForgeFlow

Current `maintainer <https://odoo-community.org/page/maintainer-role>`__:

|maintainer-GuillemCForgeFlow|

This module is part of the `OCA/server-ux <https://github.com/OCA/server-ux/tree/13.0/web_archive_date>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
1 change: 1 addition & 0 deletions web_archive_date/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import models
24 changes: 24 additions & 0 deletions web_archive_date/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Copyright 2023 ForgeFlow S.L. (https://www.forgeflow.com)
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
{
"name": "Web Archive Date",
"summary": """
Reflects the Latest Archived Date and Latest Archived by on the record metadata.
""",
"version": "15.0.1.0.0",
"category": "Usability",
"license": "AGPL-3",
"website": "https://github.com/OCA/server-ux",
"author": "ForgeFlow, Odoo Community Association (OCA)",
"depends": ["web", "base_archive_date"],
"maintainers": ["GuillemCForgeFlow"],
"assets": {
"web.assets_backend": [
"web_archive_date/static/src/js/debug_manager.esm.js",
],
"web.assets_qweb": ["web_archive_date/static/src/xml/debug.xml"],
},
"installable": True,
"application": False,
"auto_install": True,
}
33 changes: 33 additions & 0 deletions web_archive_date/i18n/web_archive_date.pot
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * web_archive_date
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 13.0\n"
"Report-Msgid-Bugs-To: \n"
"Last-Translator: \n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: \n"

#. module: web_archive_date
#: model:ir.model,name:web_archive_date.model_base
msgid "Base"
msgstr ""

#. module: web_archive_date
#. openerp-web
#: code:addons/web_archive_date/static/src/xml/debug.xml:0
#, python-format
msgid "Latest Archived Date:"
msgstr ""

#. module: web_archive_date
#. openerp-web
#: code:addons/web_archive_date/static/src/xml/debug.xml:0
#, python-format
msgid "Latest Archived by:"
msgstr ""
1 change: 1 addition & 0 deletions web_archive_date/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import base
26 changes: 26 additions & 0 deletions web_archive_date/models/base.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Copyright 2023 ForgeFlow S.L. (https://www.forgeflow.com)
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
from odoo import models

from odoo.addons.base_archive_date.models.base import LOG_ARCHIVE_DATE, LOG_ARCHIVE_UID


class Base(models.AbstractModel):
_inherit = "base"

def get_metadata(self):
def merge_lists_of_dicts(original, new, key):
merged_dict = {}
for item in original:
merged_dict[item[key]] = item
for item in new:
merged_dict.setdefault(item[key], {}).update(item)
merged_list = list(merged_dict.values())
return merged_list

result = super(Base, self).get_metadata()
fields_list = list(self._fields)
if LOG_ARCHIVE_DATE in fields_list and LOG_ARCHIVE_UID in fields_list:
archive_dict = self.read([LOG_ARCHIVE_DATE, LOG_ARCHIVE_UID])
return merge_lists_of_dicts(result, archive_dict, "id")
return result
3 changes: 3 additions & 0 deletions web_archive_date/readme/CONTRIBUTORS.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
* `ForgeFlow S.L. <https://www.forgeflow.com>`_:

* Guillem Casassas <[email protected]>
3 changes: 3 additions & 0 deletions web_archive_date/readme/DESCRIPTION.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Glue module between `web` and `base_archive_date`.

This module adds the `Latest Archived Date:` and `Latest Archived by:` as fields showing in the metadata of a record. Just like the `Latest Modification Date:` (write_date) or the `Created by:` (create_uid).
3 changes: 3 additions & 0 deletions web_archive_date/readme/ROADMAP.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Format of `archive_date` is not the same as `write_date` shown in the metadata. Values are formatted in javascript. Can't inherit the method and adapt the value there.

TO BE DONE: Check how to format the value in the QWeb view somehow.
6 changes: 6 additions & 0 deletions web_archive_date/readme/USAGE.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#. Install the module, archive a record and show on the Metdata of the record and you'll
be able to see the `Latest Archived Date` `Latest Archived by` there.
#. To check the Metadata:
* Activate the Developer Mode.
* Click on the `bug`, once the markdown appears, click on the View Metadata button.
* You can check the `Latest Archived Date` and `Latest Archived by` value once the record has been archived previously.
Binary file added web_archive_date/static/description/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 90afff5

Please sign in to comment.