From 5752f837a966ba30d33fab2021f6770bbb83556f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beno=C3=AEt=20V=C3=A9zina?= Date: Mon, 26 Jun 2023 17:01:44 -0400 Subject: [PATCH] migrate from addons to new repo bemade-addons and ln in addons --- .../__init__.py | 5 ++ .../__manifest__.py | 21 +++++ .../models/__init__.py | 2 + .../models/mail_wizard_invite.py | 8 ++ bemade_attachments_cleanup/__init__.py | 1 + bemade_attachments_cleanup/__manifest__.py | 22 +++++ bemade_attachments_cleanup/i18n/fr_CA.po | 37 ++++++++ .../security/ir.model.access.csv | 2 + bemade_attachments_cleanup/wizard/__init__.py | 1 + .../wizard/attachment_cleanup_wizard.py | 45 ++++++++++ .../wizard/attachment_cleanup_wizard_view.xml | 32 +++++++ bemade_fetchmail_only_production/__init__.py | 4 + .../__manifest__.py | 20 +++++ .../models/__init__.py | 4 + .../models/fetchmail_server.py | 23 +++++ bemade_hide_decimal_on_unit/__init__.py | 5 ++ bemade_hide_decimal_on_unit/__manifest__.py | 23 +++++ .../views/purchase.xml | 31 +++++++ bemade_hide_decimal_on_unit/views/sale.xml | 16 ++++ bemade_reordering_rules_chatter/__init__.py | 5 ++ .../__manifest__.py | 21 +++++ .../models/__init__.py | 1 + .../models/stock_warehouse_orderpoint.py | 19 +++++ .../views/stock_warehouse_orderpoint.xml | 29 +++++++ bemade_so_and_po_only_company/__init__.py | 0 bemade_so_and_po_only_company/__manifest__.py | 22 +++++ .../views/purchase_order.xml | 15 ++++ .../views/sale_order.xml | 15 ++++ bemade_so_followers_to_picking/__init__.py | 1 + .../__manifest__.py | 21 +++++ .../models/__init__.py | 1 + .../models/stock_picking.py | 17 ++++ bemade_user_custom_apps_order/__init__.py | 27 ++++++ bemade_user_custom_apps_order/__manifest__.py | 42 ++++++++++ .../models/__init__.py | 9 ++ .../models/ir_ui_menu.py | 84 +++++++++++++++++++ .../models/res_users.py | 63 ++++++++++++++ .../models/res_users_menu_order.py | 28 +++++++ .../security/ir.model.access.csv | 3 + .../tests/tours/custom_app_order_tour.js | 19 +++++ .../tests/__init__.py | 1 + .../tests/test_user_custom_app_order.py | 36 ++++++++ .../views/res_users_view.xml | 33 ++++++++ .../views/user_menu_sequence.xml | 35 ++++++++ 44 files changed, 849 insertions(+) create mode 100644 bemade_add_follower_no_sendmail_default/__init__.py create mode 100644 bemade_add_follower_no_sendmail_default/__manifest__.py create mode 100644 bemade_add_follower_no_sendmail_default/models/__init__.py create mode 100644 bemade_add_follower_no_sendmail_default/models/mail_wizard_invite.py create mode 100644 bemade_attachments_cleanup/__init__.py create mode 100644 bemade_attachments_cleanup/__manifest__.py create mode 100644 bemade_attachments_cleanup/i18n/fr_CA.po create mode 100644 bemade_attachments_cleanup/security/ir.model.access.csv create mode 100644 bemade_attachments_cleanup/wizard/__init__.py create mode 100644 bemade_attachments_cleanup/wizard/attachment_cleanup_wizard.py create mode 100644 bemade_attachments_cleanup/wizard/attachment_cleanup_wizard_view.xml create mode 100644 bemade_fetchmail_only_production/__init__.py create mode 100644 bemade_fetchmail_only_production/__manifest__.py create mode 100644 bemade_fetchmail_only_production/models/__init__.py create mode 100644 bemade_fetchmail_only_production/models/fetchmail_server.py create mode 100644 bemade_hide_decimal_on_unit/__init__.py create mode 100644 bemade_hide_decimal_on_unit/__manifest__.py create mode 100644 bemade_hide_decimal_on_unit/views/purchase.xml create mode 100644 bemade_hide_decimal_on_unit/views/sale.xml create mode 100644 bemade_reordering_rules_chatter/__init__.py create mode 100644 bemade_reordering_rules_chatter/__manifest__.py create mode 100644 bemade_reordering_rules_chatter/models/__init__.py create mode 100644 bemade_reordering_rules_chatter/models/stock_warehouse_orderpoint.py create mode 100644 bemade_reordering_rules_chatter/views/stock_warehouse_orderpoint.xml create mode 100644 bemade_so_and_po_only_company/__init__.py create mode 100644 bemade_so_and_po_only_company/__manifest__.py create mode 100644 bemade_so_and_po_only_company/views/purchase_order.xml create mode 100644 bemade_so_and_po_only_company/views/sale_order.xml create mode 100644 bemade_so_followers_to_picking/__init__.py create mode 100644 bemade_so_followers_to_picking/__manifest__.py create mode 100644 bemade_so_followers_to_picking/models/__init__.py create mode 100644 bemade_so_followers_to_picking/models/stock_picking.py create mode 100644 bemade_user_custom_apps_order/__init__.py create mode 100644 bemade_user_custom_apps_order/__manifest__.py create mode 100644 bemade_user_custom_apps_order/models/__init__.py create mode 100644 bemade_user_custom_apps_order/models/ir_ui_menu.py create mode 100644 bemade_user_custom_apps_order/models/res_users.py create mode 100644 bemade_user_custom_apps_order/models/res_users_menu_order.py create mode 100644 bemade_user_custom_apps_order/security/ir.model.access.csv create mode 100644 bemade_user_custom_apps_order/static/tests/tours/custom_app_order_tour.js create mode 100644 bemade_user_custom_apps_order/tests/__init__.py create mode 100644 bemade_user_custom_apps_order/tests/test_user_custom_app_order.py create mode 100644 bemade_user_custom_apps_order/views/res_users_view.xml create mode 100644 bemade_user_custom_apps_order/views/user_menu_sequence.xml diff --git a/bemade_add_follower_no_sendmail_default/__init__.py b/bemade_add_follower_no_sendmail_default/__init__.py new file mode 100644 index 0000000..02565c9 --- /dev/null +++ b/bemade_add_follower_no_sendmail_default/__init__.py @@ -0,0 +1,5 @@ +# -*- coding: utf-8 -*- +from . import models + + + diff --git a/bemade_add_follower_no_sendmail_default/__manifest__.py b/bemade_add_follower_no_sendmail_default/__manifest__.py new file mode 100644 index 0000000..9f654d9 --- /dev/null +++ b/bemade_add_follower_no_sendmail_default/__manifest__.py @@ -0,0 +1,21 @@ +# -*- coding: utf-8 -*- +{ + "name": "Change default when adding follower", + "version": "15.0.0.0.1", + "category": "Extra Tools", + 'summary': 'Change default when adding follower', + "description": """ + Change default when adding follower + Send mail false by default + """, + "author": "Bemade", + 'website': 'https://www.bemade.org', + "depends": [ + 'mail', + ], + "data": [ + ], + "auto_install": False, + "installable": True, + 'license': 'OPL-1' +} diff --git a/bemade_add_follower_no_sendmail_default/models/__init__.py b/bemade_add_follower_no_sendmail_default/models/__init__.py new file mode 100644 index 0000000..cd332dd --- /dev/null +++ b/bemade_add_follower_no_sendmail_default/models/__init__.py @@ -0,0 +1,2 @@ +# -*- coding: utf-8 -*- +from . import mail_wizard_invite diff --git a/bemade_add_follower_no_sendmail_default/models/mail_wizard_invite.py b/bemade_add_follower_no_sendmail_default/models/mail_wizard_invite.py new file mode 100644 index 0000000..986fde3 --- /dev/null +++ b/bemade_add_follower_no_sendmail_default/models/mail_wizard_invite.py @@ -0,0 +1,8 @@ +# Copyright Bemade.org +from odoo import models, fields, api + + +class MailWizardInviteDefault(models.TransientModel): + _inherit = 'mail.wizard.invite' + + send_mail = fields.Boolean(default=False, help="If true, an invitation email will be sent to the recipient") diff --git a/bemade_attachments_cleanup/__init__.py b/bemade_attachments_cleanup/__init__.py new file mode 100644 index 0000000..4027237 --- /dev/null +++ b/bemade_attachments_cleanup/__init__.py @@ -0,0 +1 @@ +from . import wizard diff --git a/bemade_attachments_cleanup/__manifest__.py b/bemade_attachments_cleanup/__manifest__.py new file mode 100644 index 0000000..2d18b49 --- /dev/null +++ b/bemade_attachments_cleanup/__manifest__.py @@ -0,0 +1,22 @@ +{ + 'name': "Attachment Cleanup", + 'version': '1.0.1', + 'author': "Bemade", + 'website': "http://www.bemade.org", + 'category': 'Tools', + 'license': 'OPL-1', + 'summary': "Find and delete missing attachments", + 'description': """ + This module adds a wizard in the settings menu to find and delete missing attachments. + The wizard lists all attachments that are not found in the filestore, and allows the user to select and delete them. + Please use this tool with caution, as deleting attachments cannot be undone. + """, + 'depends': ['base'], + 'data': [ + 'wizard/attachment_cleanup_wizard_view.xml', + 'security/ir.model.access.csv', + + ], + 'installable': True, + 'application': False, +} diff --git a/bemade_attachments_cleanup/i18n/fr_CA.po b/bemade_attachments_cleanup/i18n/fr_CA.po new file mode 100644 index 0000000..5b3b39b --- /dev/null +++ b/bemade_attachments_cleanup/i18n/fr_CA.po @@ -0,0 +1,37 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * attachment_cleanup +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 15.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2023-06-08 12:00+0000\n" +"PO-Revision-Date: 2023-06-08 12:00+0000\n" +"Last-Translator: \n" +"Language-Team: \n" +"Language: fr_CA\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: \n" + +#. module: attachment_cleanup +#: model:ir.actions.act_window,name:attachment_cleanup.action_open_attachment_cleanup_wizard +msgid "Cleanup Attachments" +msgstr "Nettoyer les pièces jointes" + +#. module: attachment_cleanup +#: model:ir.ui.view,arch_db:attachment_cleanup.view_attachment_cleanup_wizard +msgid "Delete" +msgstr "Supprimer" + +#. module: attachment_cleanup +#: model:ir.ui.view,arch_db:attachment_cleanup.view_attachment_cleanup_wizard +msgid "Cancel" +msgstr "Annuler" + +#. module: attachment_cleanup +#: model:ir.model.fields,field_description:attachment_cleanup.field_attachment_cleanup_wizard_attachment_ids +msgid "Missing Attachments" +msgstr "Pièces jointes manquantes" diff --git a/bemade_attachments_cleanup/security/ir.model.access.csv b/bemade_attachments_cleanup/security/ir.model.access.csv new file mode 100644 index 0000000..735f299 --- /dev/null +++ b/bemade_attachments_cleanup/security/ir.model.access.csv @@ -0,0 +1,2 @@ +id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink +access_attachment_cleanup_wizard,access.attachment.cleanup.wizard,model_attachment_cleanup_wizard,base.group_system,1,1,1,1 diff --git a/bemade_attachments_cleanup/wizard/__init__.py b/bemade_attachments_cleanup/wizard/__init__.py new file mode 100644 index 0000000..c5856e0 --- /dev/null +++ b/bemade_attachments_cleanup/wizard/__init__.py @@ -0,0 +1 @@ +from . import attachment_cleanup_wizard diff --git a/bemade_attachments_cleanup/wizard/attachment_cleanup_wizard.py b/bemade_attachments_cleanup/wizard/attachment_cleanup_wizard.py new file mode 100644 index 0000000..f2446a3 --- /dev/null +++ b/bemade_attachments_cleanup/wizard/attachment_cleanup_wizard.py @@ -0,0 +1,45 @@ +from odoo import api, fields, models +import os + + +class AttachmentCleanupWizard(models.TransientModel): + _name = 'attachment.cleanup.wizard' + _description = 'Attachment Cleanup Wizard' + + attachment_ids = fields.Many2many( + 'ir.attachment', + string='Missing Attachments', + readonly=True, + help='Attachments that are not found in the filestore' + ) + + @api.model + def default_get(self, fields_list): + res = super(AttachmentCleanupWizard, self).default_get(fields_list) + + attachments_1 = self.sudo().env['ir.attachment'].search([]) + + self._cr.execute("SELECT id FROM ir_attachment WHERE company_id = %s", (self.env.company.id,)) + + attachments = self._cr.fetchall() + + filestore_location = self.env['ir.attachment']._filestore() + + missing_attachments = [] + for attachment_id in attachments: + # if attachment.id == 47984: + # print(attachment.store_fname) + attachment = self.env['ir.attachment'].browse(attachment_id) + + if attachment.store_fname: + file_path = os.path.join(filestore_location, attachment.store_fname) + if not os.path.exists(file_path): + missing_attachments.append(attachment.id) + + if missing_attachments: + res.update({'attachment_ids': [(6, 0, missing_attachments)]}) + return res + + def action_cleanup_attachments(self): + self.ensure_one() + self.attachment_ids.unlink() diff --git a/bemade_attachments_cleanup/wizard/attachment_cleanup_wizard_view.xml b/bemade_attachments_cleanup/wizard/attachment_cleanup_wizard_view.xml new file mode 100644 index 0000000..b652785 --- /dev/null +++ b/bemade_attachments_cleanup/wizard/attachment_cleanup_wizard_view.xml @@ -0,0 +1,32 @@ + + + attachment.cleanup.wizard.view + attachment.cleanup.wizard + +
+ + + + + + + + +