diff options
| author | Divyesh Makwana (Open ERP) <mdi@tinyerp.com> | 2012-07-03 14:28:16 +0530 |
|---|---|---|
| committer | Divyesh Makwana (Open ERP) <mdi@tinyerp.com> | 2012-07-03 14:28:16 +0530 |
| commit | f28cfcfe8a16e77acd7e390e25fff2793e4e6548 (patch) | |
| tree | fe3fad1ad3f95ff11a34638ea5c7f325cecfa25c /addons/share/wizard | |
| parent | 9ce0d57fbe8357e00e72123e7e4c07326b26b261 (diff) | |
| parent | 1e123ce0c86060be9ad66fa8962912b14597c699 (diff) | |
[Merge] Merge with main addons.
bzr revid: mdi@tinyerp.com-20120703043709-c8o4k6hjfw5v8gn0
bzr revid: mdi@tinyerp.com-20120703085816-mc75d3ukecz03m79
Diffstat (limited to 'addons/share/wizard')
| -rw-r--r-- | addons/share/wizard/share_wizard.py | 16 | ||||
| -rw-r--r-- | addons/share/wizard/share_wizard_view.xml | 32 |
2 files changed, 29 insertions, 19 deletions
diff --git a/addons/share/wizard/share_wizard.py b/addons/share/wizard/share_wizard.py index 55d43453775..41871480f45 100644 --- a/addons/share/wizard/share_wizard.py +++ b/addons/share/wizard/share_wizard.py @@ -48,7 +48,7 @@ RANDOM_PASS_CHARACTERS = 'aaaabcdeeeefghjkmnpqrstuvwxyzAAAABCDEEEEFGHJKLMNPQRSTU def generate_random_pass(): return ''.join(random.sample(RANDOM_PASS_CHARACTERS,10)) -class share_wizard(osv.osv_memory): +class share_wizard(osv.TransientModel): _name = 'share.wizard' _description = 'Share Wizard' @@ -177,9 +177,10 @@ class share_wizard(osv.osv_memory): 'name': fields.char('Share Title', size=64, required=True, help="Title for the share (displayed to users as menu and shortcut name)"), 'record_name': fields.char('Record name', size=128, help="Name of the shared record, if sharing a precise record"), 'message': fields.text("Personal Message", help="An optional personal message, to be included in the email notification."), - - 'embed_code': fields.function(_embed_code, type='text'), - 'embed_option_title': fields.boolean("Display title"), + 'embed_code': fields.function(_embed_code, type='text', string='Code', + help="Embed this code in your documents to provide a link to the "\ + "shared document."), + 'embed_option_title': fields.boolean('Display title'), 'embed_option_search': fields.boolean('Display search view'), 'embed_url': fields.function(_embed_url, string='Share URL', type='char', size=512, readonly=True), } @@ -903,8 +904,11 @@ class share_result_line(osv.osv_memory): def _share_url(self, cr, uid, ids, _fieldname, _args, context=None): result = dict.fromkeys(ids, '') for this in self.browse(cr, uid, ids, context=context): - data = dict(dbname=cr.dbname, login=this.login, password='') - result[this.id] = this.share_wizard_id.share_url_template() % data + data = dict(dbname=cr.dbname, login=this.login, password=this.password) + if this.share_wizard_id and this.share_wizard_id.action_id: + data['action_id'] = this.share_wizard_id.action_id.id + ctx = dict(context, share_url_template_hash_arguments=['action_id']) + result[this.id] = this.share_wizard_id.share_url_template(context=ctx) % data return result _columns = { diff --git a/addons/share/wizard/share_wizard_view.xml b/addons/share/wizard/share_wizard_view.xml index ee5d4dd23b9..58734caa25b 100644 --- a/addons/share/wizard/share_wizard_view.xml +++ b/addons/share/wizard/share_wizard_view.xml @@ -39,17 +39,20 @@ <group> <field name="user_type" invisible="1"/> <field name="invite" invisible="1"/> - </group> + </group> <group> - <group name="emails_group" attrs="{'invisible':['|', ('user_type', '!=', 'emails'), ('invite', '=', True)]}" string="Share with these People (one email per line)"> - <field colspan="2" nolabel="1" name="new_users" attrs="{'required':[('user_type','=','emails'), ('invite', '!=', True)]}"/> + <group colspan="4" name="emails_group" attrs="{'invisible':['|', ('user_type', '!=', 'emails'), ('invite', '=', True)]}" + string="Share with these People (one email per line)"> + <field nolabel="1" name="new_users" attrs="{'required':[('user_type','=','emails'), ('invite', '!=', True)]}"/> </group> - <group name="email_lines" attrs="{'invisible':[('invite', '!=', True)]}" string="Share with these People (one email per line)"> + <group colspan="4" name="email_lines" attrs="{'invisible':['|', ('invite', '!=', True), ('user_type', '!=', 'emails')]}" + string="Share with these People (one email per line)"> <field name="email_1"/> <field name="email_2"/> <field name="email_3"/> </group> - <group attrs="{'invisible':[('user_type', '=', 'embedded')]}" string="Include an Optional Personal Message"> + <group colspan="4" attrs="{'invisible':[('user_type', '=', 'embedded')]}" + string="Include an Optional Personal Message"> <field name="message" colspan="2" nolabel="1"/> </group> <group attrs="{'invisible':[('invite', '=', True)]}" string="Sharing Options"> @@ -71,8 +74,8 @@ <field name="user_type" invisible="1"/> <field name="access_mode" invisible="1"/> </header> - <group attrs="{'invisible':[('user_type','=','embedded')]}"> - <separator string="An email notification with instructions has been sent to the following people:"/> + <group attrs="{'invisible':[('user_type','=','embedded')]}" + string="An email notification with instructions has been sent to the following people:"> <field name="result_line_ids" nolabel="1" mode="tree"> <tree string="Summary"> <field name="login"/> @@ -85,14 +88,17 @@ </field> </group> <group colspan="4" col="1" attrs="{'invisible':[('user_type','!=','embedded')]}"> - <separator string="Use this Link"/> - <field name="embed_url"/> - <separator string="Or insert the following code where you want to embed your documents"/> - <group string="Options"> - <field name="embed_option_title" on_change="onchange_embed_options(embed_option_title, embed_option_search)"/> - <field name="embed_option_search" on_change="onchange_embed_options(embed_option_title, embed_option_search)" attrs="{'invisible':[('access_mode','=','readonly')]}"/> + <group string="Use this link"> + <field name="embed_url"/> + </group> + <group string="Or insert the following code where you want to embed your documents"> <field name="embed_code"/> </group> + <group string="Embedded code options"> + <field name="embed_option_title" on_change="onchange_embed_options(embed_option_title, embed_option_search)"/> + <field name="embed_option_search" on_change="onchange_embed_options(embed_option_title, embed_option_search)" + attrs="{'invisible':[('access_mode','=','readonly')]}"/> + </group> </group> </form> |
