Merge branch 'dev_odex25_base' of https://github.com/expsa/odex25-standard-modules into bakry_base
This commit is contained in:
commit
9e93129065
|
|
@ -66,7 +66,7 @@ jobs:
|
|||
run: |
|
||||
sudo chmod +x /home/${{ secrets.CLIENT_USER }}/scripts/pull/preprod_pull_standard_code.sh
|
||||
sudo /home/${{ secrets.CLIENT_USER }}/scripts/pull/preprod_pull_standard_code.sh
|
||||
sudo systemctl restart ${{ secrets.ENSAN_APP_PREPROD_SERVICE }} ${{ secrets.ODEX25_GENERAL_PREPROD_SERVICE }} ${{ secrets.ODEX25_STANDARD_PREPROD_SERVICE }} ${{ secrets.TWAHOD_APP_PREPROD_SERVICE }} ${{ secrets.ODEX25_DEMO_PREPROD_SERVICE }} ${{ secrets.HELPDESK_PREPROD_SERVICE }} ${{ secrets.TRAHUM_PREPROD_SERVICE }} ${{ secrets.CYBER_APP_PREPROD_SERVICE }}
|
||||
sudo systemctl restart ${{ secrets.ENSAN_APP_PREPROD_SERVICE }} ${{ secrets.ODEX25_GENERAL_PREPROD_SERVICE }} ${{ secrets.ODEX25_STANDARD_PREPROD_SERVICE }} ${{ secrets.TWAHOD_APP_PREPROD_SERVICE }} ${{ secrets.ODEX25_DEMO_PREPROD_SERVICE }} ${{ secrets.HELPDESK_PREPROD_SERVICE }} ${{ secrets.CYBER_APP_PREPROD_SERVICE }}
|
||||
if [ $? -eq 0 ]; then
|
||||
echo "** [INFO] "PREPROD" services have been restarted."
|
||||
else
|
||||
|
|
@ -82,7 +82,7 @@ jobs:
|
|||
run: |
|
||||
sudo chmod +x /home/${{ secrets.CLIENT_USER }}/scripts/pull/dev_pull_standard_code.sh
|
||||
sudo /home/${{ secrets.CLIENT_USER }}/scripts/pull/dev_pull_standard_code.sh
|
||||
sudo systemctl restart ${{ secrets.ENSAN_APP_TEST_SERVICE }} ${{ secrets.ODEX25_GENERAL_TEST_SERVICE }} ${{ secrets.ODEX25_STANDARD_TEST_SERVICE }} ${{ secrets.TWAHOD_APP_TEST_SERVICE }} ${{ secrets.HELPDESK_TEST_SERVICE }} ${{ secrets.KAZ_LIBRARY_TEST_SERVICE }} ${{ secrets.TRAHUM_TEST_SERVICE }} ${{ secrets.CYBER_APP_TEST_SERVICE }}
|
||||
sudo systemctl restart ${{ secrets.ENSAN_APP_TEST_SERVICE }} ${{ secrets.ODEX25_GENERAL_TEST_SERVICE }} ${{ secrets.ODEX25_STANDARD_TEST_SERVICE }} ${{ secrets.TWAHOD_APP_TEST_SERVICE }} ${{ secrets.HELPDESK_TEST_SERVICE }} ${{ secrets.KAZ_LIBRARY_TEST_SERVICE }} ${{ secrets.CYBER_APP_TEST_SERVICE }}
|
||||
if [ $? -eq 0 ]; then
|
||||
echo "** [INFO] "DEV" services have been restarted."
|
||||
else
|
||||
|
|
|
|||
|
|
@ -67,6 +67,7 @@ jobs:
|
|||
|
||||
sudo chmod +x ${{ secrets.KAZ_STANDARD_FOLDER_PATH }}/scripts/pull_code.sh
|
||||
sudo ${{ secrets.KAZ_STANDARD_FOLDER_PATH }}/scripts/pull_code.sh ${{ secrets.KAZ_PROJECT_USER }} ${{ secrets.KAZ_STANDARD_FOLDER_PATH }} ${{ secrets.KAZ_MASTER_SERVICE }} master ${GITHUB_REF#refs/heads/master_} ${GITHUB_REF#refs/heads/}
|
||||
sudo systemctl restart odoo-server-stage.service
|
||||
|
||||
# Twahod project
|
||||
twahod_master_server:
|
||||
|
|
|
|||
|
|
@ -0,0 +1,29 @@
|
|||
from odoo import api, SUPERUSER_ID
|
||||
from odoo.exceptions import ValidationError
|
||||
|
||||
|
||||
def post_init_hook(cr, registry):
|
||||
"""
|
||||
This function serves as the hook to apply data patches and commit changes
|
||||
before raising an intentional error.
|
||||
"""
|
||||
# Example functions to call (define these functions elsewhere in this file)
|
||||
update_due_date_in_transaction_model(cr, registry)
|
||||
|
||||
# Commit the changes
|
||||
cr.commit()
|
||||
|
||||
# Raise an intentional error to prevent module installation
|
||||
raise ValidationError("Intentional error: This module is not designed to be installed.\nData Applied Successfully!")
|
||||
|
||||
def update_due_date_in_transaction_model(cr, registry):
|
||||
"""
|
||||
Recalculate the is_late field for all records after module upgrade.
|
||||
"""
|
||||
env = api.Environment(cr, SUPERUSER_ID, {})
|
||||
|
||||
transaction_models = ['outgoing.transaction', 'internal.transaction', 'incoming.transaction']
|
||||
for transaction_model in transaction_models:
|
||||
model = env[transaction_model]
|
||||
records = model.search([]) # Fetch all records
|
||||
records.compute_due_date() # Trigger computation
|
||||
|
|
@ -0,0 +1,15 @@
|
|||
{
|
||||
'name': 'Data Patches with Hook',
|
||||
'version': '1.0',
|
||||
'summary': 'A module to apply data patches using a hook.',
|
||||
'category': 'Tools',
|
||||
'author': 'Expert Co.',
|
||||
'description': """
|
||||
This module apply data patches via hooks.
|
||||
""",
|
||||
'depends': ['base'],
|
||||
'data': [],
|
||||
'installable': True,
|
||||
'application': False,
|
||||
'post_init_hook': 'post_init_hook',
|
||||
}
|
||||
|
|
@ -0,0 +1 @@
|
|||
|
||||
|
|
@ -0,0 +1,13 @@
|
|||
{
|
||||
'name': 'Hide Contacts',
|
||||
'version': '14.0',
|
||||
'author': 'Experts Co.',
|
||||
'license': 'LGPL-3',
|
||||
'depends': [
|
||||
'contacts'
|
||||
],
|
||||
'data': [
|
||||
'security/security.xml',
|
||||
'views/contact_views.xml'
|
||||
]
|
||||
}
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<odoo>
|
||||
|
||||
<record id="group_show_contact_module" model="res.groups">
|
||||
<field name="name">Show Contacts</field>
|
||||
<field name="category_id" ref="base.module_category_hidden"/>
|
||||
</record>
|
||||
|
||||
</odoo>
|
||||
|
|
@ -0,0 +1,8 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<odoo>
|
||||
|
||||
<record id="contacts.menu_contacts" model="ir.ui.menu">
|
||||
<field name="groups_id" eval="[(6, 0, [ref('hide_contacts.group_show_contact_module')])]"/>
|
||||
</record>
|
||||
|
||||
</odoo>
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
.container{
|
||||
/* .container{
|
||||
max-width: 100%;
|
||||
}
|
||||
} */
|
||||
#background{
|
||||
height:100%;
|
||||
display: block;
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
<t t-set="no_header" t-value="True"/>
|
||||
<t t-set="no_footer" t-value="True"/>
|
||||
<div id="background" t-attf-style="background-image: url('#{background_src}'); background-color: #{background_color};">
|
||||
<div class="container body_login" style="height: 100%;">
|
||||
<div class="container-fluid body_login" style="height: 100%;">
|
||||
<div id="bcard" t-attf-class="card border-0 mx-auto bg-100 {{login_card_classes}} o_database_list" style="float:left;">
|
||||
<div class="card-body">
|
||||
<div style="margin-top: 30%;">
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@
|
|||
</t>
|
||||
<t t-set="body_classname" t-value="'bg-100'"/>
|
||||
<div id="background" t-attf-style="background-image: url('#{background_src}'); background-color: #{background_color};">
|
||||
<div class="container body_login">
|
||||
<div class="container-fluid body_login">
|
||||
<div t-attf-class="card border-0 mx-auto bg-100 {{login_card_classes}} o_database_list" id="mcard">
|
||||
<div class="card-body">
|
||||
<div>
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
<t t-set="no_header" t-value="True"/>
|
||||
<t t-set="no_footer" t-value="True"/>
|
||||
<div id="background" t-attf-style="background-image: url('#{background_src}'); background-color: #{background_color};">
|
||||
<div class="container body_login" style="height: 100%;">
|
||||
<div class="container-fluid body_login" style="height: 100%;">
|
||||
<div id="bcard" t-attf-class="card border-0 mx-auto bg-100 {{login_card_classes}} o_database_list" style="float:right;">
|
||||
<div class="card-body">
|
||||
<div style="margin-top: 30%;">
|
||||
|
|
|
|||
|
|
@ -8,3 +8,12 @@ class ResUsers(models.Model):
|
|||
|
||||
sign_signature = fields.Binary(string="Digital Signature", )
|
||||
sign_initials = fields.Binary(string="Digitial Initials",)
|
||||
|
||||
|
||||
def __init__(self, pool, cr):
|
||||
"""Custom initialization of the model"""
|
||||
super(ResUsers, self).__init__(pool, cr)
|
||||
|
||||
# Dynamically add fields to SELF_WRITEABLE_FIELDS and SELF_READABLE_FIELDS
|
||||
type(self).SELF_WRITEABLE_FIELDS = list(self.SELF_WRITEABLE_FIELDS) + ['sign_signature', 'sign_initials']
|
||||
type(self).SELF_READABLE_FIELDS = list(self.SELF_READABLE_FIELDS) + ['sign_signature', 'sign_initials']
|
||||
|
|
|
|||
|
|
@ -33,4 +33,9 @@
|
|||
</div>
|
||||
</xpath>
|
||||
</template>
|
||||
|
||||
<template id="show_website_info_inherit" inherit_id="website.show_website_info" customize_show="True" name="Show Odoo Information">>
|
||||
<xpath expr="//section[@class='container']" position="replace">
|
||||
</xpath>
|
||||
</template>
|
||||
</odoo>
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@ from odoo import models, fields, api, exceptions, tools, _
|
|||
from datetime import datetime, date, timedelta
|
||||
from odoo.exceptions import Warning, ValidationError
|
||||
from odoo.modules.module import get_module_resource
|
||||
import re
|
||||
|
||||
class ResPartner(models.Model):
|
||||
_inherit = 'res.partner'
|
||||
|
|
@ -55,7 +56,7 @@ class ResPartner(models.Model):
|
|||
|
||||
@api.constrains('email')
|
||||
def _check_email_format(self):
|
||||
email_regex = r'^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$'
|
||||
for record in self:
|
||||
if record.email:
|
||||
if '@' not in record.email or not record.email.endswith('.com'):
|
||||
raise ValidationError(_("The email address must contain '@' and end with '.com'."))
|
||||
if record.email and not re.match(email_regex, record.email):
|
||||
raise ValidationError(_("Invalid email address."))
|
||||
|
|
@ -95,7 +95,10 @@ odoo.define('pdf_report_options.report', function(require) {
|
|||
});
|
||||
} else if (action.report_type === 'qweb-text') {
|
||||
return self._triggerDownload(action, options, 'text');
|
||||
} else {
|
||||
} else if (action.report_type === 'xlsx') {
|
||||
return self._triggerDownload(action, options, 'xlsx');
|
||||
}
|
||||
else {
|
||||
console.error("The ActionManager can't handle reports of type " +
|
||||
action.report_type, action);
|
||||
return Promise.reject();
|
||||
|
|
|
|||
Loading…
Reference in New Issue