-
-
Notifications
You must be signed in to change notification settings - Fork 529
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by hbrunn
- Loading branch information
Showing
17 changed files
with
728 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../../../web_archive_date |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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, | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,102 @@ | ||
================ | ||
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 | ||
====================== | ||
|
||
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. | ||
|
||
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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
from . import models |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# 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": "14.0.1.0.1", | ||
"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"], | ||
"qweb": ["static/src/xml/debug.xml"], | ||
"installable": True, | ||
"application": False, | ||
"auto_install": True, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 "" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
from . import base |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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]> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.