-
1.travis.yml
-
31help_popup/README.rst
-
2help_popup/__init__.py
-
5help_popup/__openerp__.py
-
79help_popup/demo/help.xml
-
2help_popup/models/__init__.py
-
109help_popup/models/action_window.py
-
40help_popup/models/models.py
-
4help_popup/report/all.xml
-
2help_popup/report/help.xml
-
12help_popup/security/group.xml
-
3help_popup/security/ir.model.access.csv
-
BINhelp_popup/static/description/contributor.png
-
BINhelp_popup/static/description/doc.png
-
BINhelp_popup/static/description/nodoc.png
-
BINhelp_popup/static/description/popup.png
-
BINhelp_popup/static/description/sales.png
-
BINhelp_popup/static/description/sales_doc.png
-
3help_popup/static/src/js/popup_help.js
-
1help_popup/tests/__init__.py
-
44help_popup/tests/test_help.py
-
11help_popup/views/action_view.xml
@ -1 +1 @@ |
|||
from . import model |
|||
from . import models |
@ -0,0 +1,2 @@ |
|||
from . import models |
|||
from . import action_window |
@ -0,0 +1,40 @@ |
|||
# coding: utf-8 |
|||
# © 2015 David BEAL @ Akretion <david.beal@akretion.com> |
|||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). |
|||
|
|||
|
|||
from openerp import api, models, fields |
|||
|
|||
|
|||
class ErpHelp(models.AbstractModel): |
|||
_name = 'erp.help' |
|||
|
|||
enduser_help = fields.Html( |
|||
string="End User Help", |
|||
help="Use this field to add custom content for documentation purpose\n" |
|||
"mainly by power users ") |
|||
advanced_help = fields.Text( |
|||
string="Advanced Help", groups='base.group_no_one', |
|||
help="Use this field to add custom content for documentation purpose\n" |
|||
"mainly by developers or consultants") |
|||
|
|||
|
|||
class IrModel(models.Model): |
|||
_inherit = ['ir.model', 'erp.help'] |
|||
_name = 'ir.model' |
|||
|
|||
|
|||
class IrModuleModule(models.Model): |
|||
_inherit = 'ir.module.module' |
|||
|
|||
@api.multi |
|||
def module_uninstall(self): |
|||
if self.name != 'help_popup': |
|||
domain = ['|', |
|||
('advanced_help', 'like', '%' + self.name + '%'), |
|||
('advanced_help_model', 'like', '%' + self.name + '%')] |
|||
actions = self.env['ir.actions.act_window'].search(domain) |
|||
for record in actions: |
|||
record.with_context( |
|||
help_uninstall=True).remove_obsolete_help(self.name) |
|||
return super(IrModuleModule, self).module_uninstall() |
@ -0,0 +1,12 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
|
|||
<openerp> |
|||
<data> |
|||
|
|||
<record model="res.groups" id="group_help"> |
|||
<field name="name">Inline Help</field> |
|||
</record> |
|||
|
|||
|
|||
</data> |
|||
</openerp> |
@ -0,0 +1,3 @@ |
|||
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink |
|||
access_ir_model_group_help,ir_model_group_help,model_ir_model,group_help,1,1,0,0 |
|||
access_ir_actions_act_window_group_help,ir_actions_act_window_group_help,model_ir_actions_act_window,group_help,1,1,0,0 |
After Width: 210 | Height: 133 | Size: 6.9 KiB |
After Width: 156 | Height: 42 | Size: 3.3 KiB |
After Width: 168 | Height: 46 | Size: 3.5 KiB |
Before Width: 874 | Height: 793 | Size: 121 KiB After Width: 830 | Height: 772 | Size: 248 KiB |
After Width: 72 | Height: 25 | Size: 1.3 KiB |
After Width: 805 | Height: 687 | Size: 53 KiB |
@ -0,0 +1 @@ |
|||
from . import test_help |
@ -0,0 +1,44 @@ |
|||
# coding: utf-8 |
|||
# © 2016 David BEAL @ Akretion <david.beal@akretion.com> |
|||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). |
|||
|
|||
# import logging |
|||
|
|||
|
|||
from openerp.tests import common |
|||
|
|||
|
|||
class TestHelpPopup(common.TransactionCase): |
|||
|
|||
def test_qweb_help_report(self): |
|||
partner_act = self.env.ref('base.action_partner_form') |
|||
return partner_act.button_open_help_popup() |
|||
|
|||
# def test_update_partially_field(self): |
|||
# partner_act = self.env.ref('base.action_partner_form') |
|||
# import pdb; pdb.set_trace() |
|||
# partner_act.with_context(install_mode=True).write( |
|||
# {'advanced_help': 'new_content'}) |
|||
# partner_act.with_context(install_mode=True).write( |
|||
# {'advanced_help': 'toto'}) |
|||
# # import pdb; pdb.set_trace() |
|||
# # vals = {'advanced_help': 'toto'} |
|||
# # partner_act._update_help_field(vals, 'advanced_help', 'help_popup') |
|||
# self.assertEqual( |
|||
# partner_act.advanced_help, |
|||
# u'\nnew_content<help_base>toto</help_base>', |
|||
# "Partially updating of 'ir.model'.advanced_help is broken") |
|||
# # partner_act.remove_obsolete_help('base') |
|||
|
|||
def test_advanced_user_model_help(self): |
|||
""" test if advanced_help_model field in 'ir.actions.act_window' |
|||
propagate changes in 'ir.model' advanced_help field |
|||
""" |
|||
partner_act = self.env.ref('base.action_partner_form') |
|||
partner_act.with_context(install_mode=True).write( |
|||
{'advanced_help_model': 'new_content'}) |
|||
partner_mod = self.env['ir.model'].search( |
|||
[('model', '=', 'res.partner')]) |
|||
self.assertEqual( |
|||
partner_mod.advanced_help, 'new_content', |
|||
"advanced_help and avanced_help_model fields are not equals") |