@ -0,0 +1,51 @@ |
|||||
|
.. image:: https://img.shields.io/badge/license-AGPL--3-blue.svg |
||||
|
:target: https://www.gnu.org/licenses/agpl-3.0-standalone.html |
||||
|
:alt: License: AGPL-3 |
||||
|
|
||||
|
Text Commander |
||||
|
=============== |
||||
|
This module helps you to open models or single model record and create record |
||||
|
of a model through command palette. |
||||
|
|
||||
|
Configuration |
||||
|
============= |
||||
|
Install this module. Then use the hotkey ctrl + k. |
||||
|
|
||||
|
Company |
||||
|
======= |
||||
|
* `Cybrosys Techno Solutions <https://cybrosys.com/>`__ |
||||
|
|
||||
|
License |
||||
|
------- |
||||
|
General Public License, Version 3 (AGPL v3). |
||||
|
(https://www.gnu.org/licenses/agpl-3.0-standalone.html) |
||||
|
|
||||
|
Credits |
||||
|
======= |
||||
|
Developers: (V18) Nivedhya T |
||||
|
(V17) Shikhil Raj, |
||||
|
(V16) Ramees Jaman KT |
||||
|
contact: odoo@cybrosys.com, |
||||
|
|
||||
|
Contacts |
||||
|
======== |
||||
|
* Mail Contact : odoo@cybrosys.com |
||||
|
* Website : https://cybrosys.com |
||||
|
|
||||
|
Bug Tracker |
||||
|
=========== |
||||
|
Bugs are tracked on GitHub Issues. In case of trouble, please check there if |
||||
|
your issue has already been reported. |
||||
|
|
||||
|
Maintainer |
||||
|
========== |
||||
|
.. image:: https://cybrosys.com/images/logo.png |
||||
|
:target: https://cybrosys.com |
||||
|
|
||||
|
This module is maintained by Cybrosys Technologies. |
||||
|
|
||||
|
For support and more information, please visit `Our Website <https://cybrosys.com/>`__ |
||||
|
|
||||
|
Further information |
||||
|
=================== |
||||
|
HTML Description: `<static/description/index.html>`__ |
@ -0,0 +1,22 @@ |
|||||
|
# -*- coding: utf-8 -*- |
||||
|
############################################################################## |
||||
|
# |
||||
|
# Cybrosys Technologies Pvt. Ltd. |
||||
|
# |
||||
|
# Copyright (C) 2025-TODAY Cybrosys Technologies(<https://www.cybrosys.com>). |
||||
|
# Author: Cybrosys Techno Solutions (odoo@cybrosys.com) |
||||
|
# |
||||
|
# You can modify it under the terms of the GNU AFFERO |
||||
|
# GENERAL PUBLIC LICENSE (AGPL v3), Version 3. |
||||
|
# |
||||
|
# This program is distributed in the hope that it will be useful, |
||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
|
# GNU AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. |
||||
|
# |
||||
|
# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE |
||||
|
# (AGPL v3) along with this program. |
||||
|
# If not, see <http://www.gnu.org/licenses/>. |
||||
|
# |
||||
|
############################################################################## |
||||
|
from . import models |
@ -0,0 +1,48 @@ |
|||||
|
# -*- coding: utf-8 -*- |
||||
|
############################################################################## |
||||
|
# |
||||
|
# Cybrosys Technologies Pvt. Ltd. |
||||
|
# |
||||
|
# Copyright (C) 2025-TODAY Cybrosys Technologies(<https://www.cybrosys.com>). |
||||
|
# Author: Cybrosys Techno Solutions (odoo@cybrosys.com) |
||||
|
# |
||||
|
# You can modify it under the terms of the GNU AFFERO |
||||
|
# GENERAL PUBLIC LICENSE (AGPL v3), Version 3. |
||||
|
# |
||||
|
# This program is distributed in the hope that it will be useful, |
||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
|
# GNU AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. |
||||
|
# |
||||
|
# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE |
||||
|
# (AGPL v3) along with this program. |
||||
|
# If not, see <http://www.gnu.org/licenses/>. |
||||
|
# |
||||
|
############################################################################## |
||||
|
{ |
||||
|
'name': 'Text Commander', |
||||
|
'version': '18.0.1.0.0', |
||||
|
'category': 'Extra tools', |
||||
|
'summary': 'Customized command palette ', |
||||
|
'description': 'This module helps you to open models or single model ' |
||||
|
'record and create record of a model through command ' |
||||
|
'palette', |
||||
|
'author': 'Cybrosys Techno Solutions', |
||||
|
'company': 'Cybrosys Techno Solutions', |
||||
|
'maintainer': 'Cybrosys Techno Solutions', |
||||
|
'website': 'https://www.cybrosys.com', |
||||
|
'depends': ['base_setup'], |
||||
|
'assets': { |
||||
|
"web.assets_backend": [ |
||||
|
'/text_commander/static/src/xml/model_command_item.xml', |
||||
|
'/text_commander/static/src/js/command_palette.js', |
||||
|
'/text_commander/static/src/js/model_providers.js', |
||||
|
] |
||||
|
}, |
||||
|
'images': [ |
||||
|
'static/description/banner.jpg'], |
||||
|
'license': 'AGPL-3', |
||||
|
'installable': True, |
||||
|
'auto_install': False, |
||||
|
'application': False, |
||||
|
} |
@ -0,0 +1,5 @@ |
|||||
|
## Module <text_commander> |
||||
|
#### 03.06.2025 |
||||
|
#### Version 18.0.1.0.0 |
||||
|
#### ADD |
||||
|
- Initial commit for Text Commander |
@ -0,0 +1,22 @@ |
|||||
|
# -*- coding: utf-8 -*- |
||||
|
############################################################################### |
||||
|
# |
||||
|
# Cybrosys Technologies Pvt. Ltd. |
||||
|
# |
||||
|
# Copyright (C) 2025-TODAY Cybrosys Technologies(<https://www.cybrosys.com>). |
||||
|
# Author: Cybrosys Techno Solutions (odoo@cybrosys.com) |
||||
|
# |
||||
|
# You can modify it under the terms of the GNU AFFERO |
||||
|
# GENERAL PUBLIC LICENSE (AGPL v3), Version 3. |
||||
|
# |
||||
|
# This program is distributed in the hope that it will be useful, |
||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
|
# GNU AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. |
||||
|
# |
||||
|
# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE |
||||
|
# (AGPL v3) along with this program. |
||||
|
# If not, see <http://www.gnu.org/licenses/>. |
||||
|
# |
||||
|
############################################################################## |
||||
|
from . import ir_model |
@ -0,0 +1,106 @@ |
|||||
|
# -*- coding: utf-8 -*- |
||||
|
############################################################################## |
||||
|
# |
||||
|
# Cybrosys Technologies Pvt. Ltd. |
||||
|
# |
||||
|
# Copyright (C) 2025-TODAY Cybrosys Technologies(<https://www.cybrosys.com>). |
||||
|
# Author: Cybrosys Techno Solutions (odoo@cybrosys.com) |
||||
|
# |
||||
|
# You can modify it under the terms of the GNU AFFERO |
||||
|
# GENERAL PUBLIC LICENSE (AGPL v3), Version 3. |
||||
|
# |
||||
|
# This program is distributed in the hope that it will be useful, |
||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
|
# GNU AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. |
||||
|
# |
||||
|
# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE |
||||
|
# (AGPL v3) along with this program. |
||||
|
# If not, see <http://www.gnu.org/licenses/>. |
||||
|
# |
||||
|
############################################################################# |
||||
|
from odoo import api, models |
||||
|
|
||||
|
|
||||
|
class IrModel(models.Model): |
||||
|
""" Class to check the model and get the record values as specified by |
||||
|
the user """ |
||||
|
_inherit = 'ir.model' |
||||
|
|
||||
|
@api.model |
||||
|
def check_model(self, data): |
||||
|
""" Check model from frontend""" |
||||
|
self.env.cr.execute("""select model,name from ir_model |
||||
|
where lower(name->>'en_US')=lower('%s') limit 1""" % data) |
||||
|
model = self.env.cr.dictfetchall() |
||||
|
return model |
||||
|
|
||||
|
@api.model |
||||
|
def get_records(self, data): |
||||
|
""" Function for fetching record from database""" |
||||
|
if data['regex'] == 1: |
||||
|
if self.env[data['model']].fields_get('name')['name']['translate']: |
||||
|
self.env.cr.execute( |
||||
|
"""SELECT id FROM %s WHERE lower(name->>'en_US') |
||||
|
LIKE '%%%s%%'""" % ( |
||||
|
data['model'].replace('.', '_'), |
||||
|
data['record'].lower())) |
||||
|
record = [d['id'] for d in self.env.cr.dictfetchall()] |
||||
|
return record |
||||
|
else: |
||||
|
self.env.cr.execute( |
||||
|
"""SELECT id FROM %s WHERE lower(name) LIKE '%%%s%%'""" % ( |
||||
|
data['model'].replace('.', '_'), |
||||
|
data['record'].lower())) |
||||
|
record = [d['id'] for d in self.env.cr.dictfetchall()] |
||||
|
return record |
||||
|
if data['regex'] == 2: |
||||
|
if data['field_type'] == 'many2one': |
||||
|
self.env.cr.execute( |
||||
|
"""SELECT id FROM %s WHERE lower(name) LIKE '%%%s%%'""" % ( |
||||
|
data['field_relation'].replace('.', '_'), |
||||
|
data['field_string'].lstrip().lower())) |
||||
|
record = [d['id'] for d in self.env.cr.dictfetchall()] |
||||
|
return self.env[data['model']].search( |
||||
|
[(data['field'], 'in', record)]).ids |
||||
|
elif data['field_type'] == 'selection': |
||||
|
for state, label in self._get_selection_values(data): |
||||
|
if data['field_string'].lstrip().lower() == label.lower(): |
||||
|
data['field_string'] = state |
||||
|
return self.env[data['model']].search( |
||||
|
[(data['field'], '=', data['field_string'])]).ids |
||||
|
else: |
||||
|
self.env.cr.execute( |
||||
|
"""SELECT id from %s where lower(%s) like '%%%s%%'""" % ( |
||||
|
data['model'].replace('.', '_'), data['field'], |
||||
|
data['field_string'].lstrip().lower())) |
||||
|
record = [rec['id'] for rec in self.env.cr.dictfetchall()] |
||||
|
return record |
||||
|
|
||||
|
def _get_selection_values(self, data): |
||||
|
""" Function for getting selection values""" |
||||
|
return \ |
||||
|
self.env[data['model']].fields_get(data['field'])[data['field']][ |
||||
|
'selection'] |
||||
|
|
||||
|
@api.model |
||||
|
def check_fields_model(self, data): |
||||
|
"""Function for checking field of a model""" |
||||
|
string = "" |
||||
|
for rec in range(len(data['field_string'])): |
||||
|
if rec != 0: |
||||
|
string += " " + data['field_string'][rec] |
||||
|
else: |
||||
|
string += data['field_string'][rec] |
||||
|
self.env.cr.execute( |
||||
|
"""select name ,ttype,relation from ir_model_fields where |
||||
|
model = '%s' and lower(field_description->>'en_US') = |
||||
|
lower('%s') limit 1""" % ( |
||||
|
data['model'], string)) |
||||
|
res = self.env.cr.dictfetchall() |
||||
|
if res: |
||||
|
res[0]['del'] = string |
||||
|
return res |
||||
|
elif rec == len(data['field_string']) - 1: |
||||
|
res = [] |
||||
|
return res |
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 210 KiB |
After Width: | Height: | Size: 209 KiB |
After Width: | Height: | Size: 109 KiB |
After Width: | Height: | Size: 495 B |
After Width: | Height: | Size: 1.0 KiB |
After Width: | Height: | Size: 624 B |
After Width: | Height: | Size: 136 KiB |
After Width: | Height: | Size: 214 KiB |
After Width: | Height: | Size: 36 KiB |
After Width: | Height: | Size: 3.6 KiB |
After Width: | Height: | Size: 310 B |
After Width: | Height: | Size: 929 B |
After Width: | Height: | Size: 1.3 KiB |
After Width: | Height: | Size: 3.3 KiB |
After Width: | Height: | Size: 1.4 KiB |
After Width: | Height: | Size: 17 KiB |
After Width: | Height: | Size: 542 B |
After Width: | Height: | Size: 576 B |
After Width: | Height: | Size: 733 B |
After Width: | Height: | Size: 4.3 KiB |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 4.0 KiB |
After Width: | Height: | Size: 1.7 KiB |
After Width: | Height: | Size: 2.2 KiB |
After Width: | Height: | Size: 911 B |
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 600 B |
After Width: | Height: | Size: 673 B |
After Width: | Height: | Size: 2.0 KiB |
After Width: | Height: | Size: 462 B |
After Width: | Height: | Size: 2.1 KiB |
After Width: | Height: | Size: 926 B |
After Width: | Height: | Size: 9.0 KiB |
After Width: | Height: | Size: 23 KiB |
After Width: | Height: | Size: 7.0 KiB |
After Width: | Height: | Size: 878 B |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 653 B |
After Width: | Height: | Size: 800 B |
After Width: | Height: | Size: 905 B |
After Width: | Height: | Size: 189 KiB |
After Width: | Height: | Size: 4.3 KiB |
After Width: | Height: | Size: 839 B |
After Width: | Height: | Size: 1.7 KiB |
After Width: | Height: | Size: 5.9 KiB |
After Width: | Height: | Size: 1.6 KiB |
After Width: | Height: | Size: 34 KiB |
After Width: | Height: | Size: 26 KiB |
After Width: | Height: | Size: 3.8 KiB |
After Width: | Height: | Size: 23 KiB |
After Width: | Height: | Size: 1.9 KiB |
After Width: | Height: | Size: 2.3 KiB |
After Width: | Height: | Size: 427 B |
After Width: | Height: | Size: 627 B |
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 988 B |
After Width: | Height: | Size: 3.7 KiB |
After Width: | Height: | Size: 5.0 KiB |
After Width: | Height: | Size: 875 B |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 80 KiB |
After Width: | Height: | Size: 1.5 KiB |
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 1.9 KiB |
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 2.1 KiB |
After Width: | Height: | Size: 4.4 KiB |
After Width: | Height: | Size: 3.2 KiB |
After Width: | Height: | Size: 589 B |
After Width: | Height: | Size: 3.4 KiB |
After Width: | Height: | Size: 565 B |
After Width: | Height: | Size: 1.7 KiB |
After Width: | Height: | Size: 2.3 KiB |
After Width: | Height: | Size: 967 B |
After Width: | Height: | Size: 26 KiB |
After Width: | Height: | Size: 1.6 KiB |
After Width: | Height: | Size: 43 KiB |
After Width: | Height: | Size: 1.4 KiB |
After Width: | Height: | Size: 3.8 KiB |
After Width: | Height: | Size: 4.0 KiB |
After Width: | Height: | Size: 38 KiB |
After Width: | Height: | Size: 5.0 KiB |
After Width: | Height: | Size: 4.3 KiB |
After Width: | Height: | Size: 1.0 MiB |
After Width: | Height: | Size: 776 KiB |
After Width: | Height: | Size: 119 KiB |
After Width: | Height: | Size: 90 KiB |
After Width: | Height: | Size: 85 KiB |
After Width: | Height: | Size: 89 KiB |
After Width: | Height: | Size: 105 KiB |