[MERGE]: Merge with lp:openobject-addons
bzr revid: mma@tinyerp.com-20120921062628-8wlq1ou35ddekg85
This commit is contained in:
commit
3a161c4d8c
|
@ -836,6 +836,8 @@ class account_journal(osv.osv):
|
|||
|
||||
@return: Returns a list of tupples containing id, name
|
||||
"""
|
||||
if not ids:
|
||||
return []
|
||||
if isinstance(ids, (int, long)):
|
||||
ids = [ids]
|
||||
result = self.browse(cr, user, ids, context=context)
|
||||
|
|
|
@ -1103,10 +1103,10 @@ class account_invoice(osv.osv):
|
|||
if not ids:
|
||||
return []
|
||||
types = {
|
||||
'out_invoice': 'CI: ',
|
||||
'in_invoice': 'SI: ',
|
||||
'out_refund': 'OR: ',
|
||||
'in_refund': 'SR: ',
|
||||
'out_invoice': 'Invoice ',
|
||||
'in_invoice': 'Sup. Invoice ',
|
||||
'out_refund': 'Refund ',
|
||||
'in_refund': 'Supplier Refund ',
|
||||
}
|
||||
return [(r['id'], (r['number']) or types[r['type']] + (r['name'] or '')) for r in self.read(cr, uid, ids, ['type', 'number', 'name'], context, load='_classic_write')]
|
||||
|
||||
|
|
|
@ -30,7 +30,7 @@
|
|||
<menuitem id="menu_analytic" parent="menu_analytic_accounting" name="Accounts" groups="analytic.group_analytic_accounting"/>
|
||||
<menuitem id="menu_journals" sequence="15" name="Journals" parent="menu_finance_configuration" groups="group_account_manager"/>
|
||||
<menuitem id="menu_configuration_misc" name="Miscellaneous" parent="menu_finance_configuration" sequence="55"/>
|
||||
<menuitem id="base.menu_action_currency_form" parent="menu_configuration_misc" sequence="20" groups="base.group_no_one"/>
|
||||
<menuitem id="base.menu_action_currency_form" name="Currencies" parent="menu_configuration_misc" sequence="20" groups="base.group_no_one"/>
|
||||
<menuitem id="menu_finance_generic_reporting" name="Generic Reporting" parent="menu_finance_reports" sequence="100"/>
|
||||
<menuitem id="menu_finance_entries" name="Journal Entries" parent="menu_finance" sequence="5" groups="group_account_user,group_account_manager"/>
|
||||
<menuitem id="menu_account_reports" name="Financial Reports" parent="menu_finance_configuration" sequence="30" />
|
||||
|
|
|
@ -215,8 +215,10 @@ class account_move_line(osv.osv):
|
|||
def _default_get(self, cr, uid, fields, context=None):
|
||||
if context is None:
|
||||
context = {}
|
||||
if not context.get('journal_id', False) and context.get('search_default_journal_id', False):
|
||||
if not context.get('journal_id', False):
|
||||
context['journal_id'] = context.get('search_default_journal_id')
|
||||
if not context.get('period_id', False):
|
||||
context['period_id'] = context.get('search_default_period_id')
|
||||
account_obj = self.pool.get('account.account')
|
||||
period_obj = self.pool.get('account.period')
|
||||
journal_obj = self.pool.get('account.journal')
|
||||
|
@ -226,6 +228,9 @@ class account_move_line(osv.osv):
|
|||
partner_obj = self.pool.get('res.partner')
|
||||
currency_obj = self.pool.get('res.currency')
|
||||
context = self.convert_to_period(cr, uid, context)
|
||||
#pass the right context when search_defaul_journal_id
|
||||
if context.get('search_default_journal_id',False):
|
||||
context['journal_id'] = context.get('search_default_journal_id')
|
||||
# Compute simple values
|
||||
data = super(account_move_line, self).default_get(cr, uid, fields, context=context)
|
||||
# Starts: Manual entry from account.move form
|
||||
|
@ -926,6 +931,8 @@ class account_move_line(osv.osv):
|
|||
return res
|
||||
if (not context.get('journal_id', False)) or (not context.get('period_id', False)):
|
||||
return False
|
||||
if context.get('search_default_journal_id', False):
|
||||
context['journal_id'] = context.get('search_default_journal_id')
|
||||
cr.execute('SELECT code FROM account_journal WHERE id = %s', (context['journal_id'], ))
|
||||
j = cr.fetchone()[0] or ''
|
||||
cr.execute('SELECT code FROM account_period WHERE id = %s', (context['period_id'], ))
|
||||
|
|
|
@ -102,6 +102,7 @@
|
|||
<field name="arch" type="xml">
|
||||
<form string="Account Period" version="7.0">
|
||||
<header>
|
||||
<button string="Close Period" name="%(account.action_account_period_close)d" type="action" class="oe_highlight" states="draft"/>
|
||||
<button name="action_draft" states="done" string="Set to Draft" type="object" groups="account.group_account_manager"/>
|
||||
<field name="state" widget="statusbar" nolabel="1"/>
|
||||
</header>
|
||||
|
@ -1718,8 +1719,10 @@
|
|||
<field name="model">account.payment.term.line</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Payment Term" version="7.0">
|
||||
<field name="name"/>
|
||||
<field name="sequence"/>
|
||||
<group>
|
||||
<field name="name"/>
|
||||
<field name="sequence"/>
|
||||
</group>
|
||||
<group>
|
||||
<group string="Amount Computation">
|
||||
<field name="value"/>
|
||||
|
@ -1767,12 +1770,11 @@
|
|||
<field name="model">account.payment.term</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Payment Term" version="7.0">
|
||||
<group>
|
||||
<group col="4">
|
||||
<field name="name"/>
|
||||
<field name="active"/>
|
||||
</group>
|
||||
<separator string="Description on Invoices"/>
|
||||
<field name="note"/>
|
||||
<field name="note" placeholder="Note fo the invoice..."/>
|
||||
<separator string="Computation"/>
|
||||
<field name="line_ids"/>
|
||||
</form>
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
<field name="active"/>
|
||||
<field name="company_id" widget="selection" groups="base.group_multi_company"/>
|
||||
</group>
|
||||
<separator string="Mapping"/>
|
||||
<separator string="Taxes Mapping"/>
|
||||
<field name="tax_ids" widget="one2many_list">
|
||||
<tree string="Tax Mapping" editable="bottom">
|
||||
<field name="tax_src_id" domain="[('parent_id','=',False)]"/>
|
||||
|
@ -23,6 +23,7 @@
|
|||
<field name="tax_dest_id" domain="[('parent_id','=',False)]"/>
|
||||
</form>
|
||||
</field>
|
||||
<separator string="Accounts Mapping"/>
|
||||
<field name="account_ids" widget="one2many_list">
|
||||
<tree string="Account Mapping" editable="bottom">
|
||||
<field name="account_src_id"/>
|
||||
|
@ -93,8 +94,10 @@
|
|||
</group>
|
||||
<field name="bank_ids">
|
||||
<form string="Bank account" version="7.0">
|
||||
<field name="state"/>
|
||||
<field name="acc_number"/>
|
||||
<group col="4">
|
||||
<field name="state"/>
|
||||
<field name="acc_number"/>
|
||||
</group>
|
||||
<group>
|
||||
<group name="owner" string="Bank Account Owner">
|
||||
<field name="partner_id" on_change="onchange_partner_id(partner_id)"/>
|
||||
|
|
|
@ -92,7 +92,7 @@ class account_move_journal(osv.osv_memory):
|
|||
|
||||
journal = False
|
||||
if journal_id:
|
||||
journal = journal_pool.read(cr, uid, journal_id, ['name'], context=context).name
|
||||
journal = journal_pool.read(cr, uid, journal_id, ['name'], context=context).get('name',False)
|
||||
journal_string = _("Journal: %s") % tools.ustr(journal)
|
||||
else:
|
||||
journal_string = _("Journal: All")
|
||||
|
|
|
@ -36,6 +36,7 @@ Adds menu to show relevant information to each manager.You can also view the rep
|
|||
'depends': ['hr_timesheet_invoice', 'sale'], #although sale is technically not required to install this module, all menuitems are located under 'Sales' application
|
||||
'data': [
|
||||
'security/ir.model.access.csv',
|
||||
'security/account_analytic_analysis_security.xml',
|
||||
'account_analytic_analysis_view.xml',
|
||||
'account_analytic_analysis_menu.xml',
|
||||
'account_analytic_analysis_cron.xml',
|
||||
|
|
|
@ -0,0 +1,10 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<openerp>
|
||||
<data>
|
||||
|
||||
<record model="res.users" id="base.user_root">
|
||||
<field eval="[(4,ref('sale.group_analytic_accounting'))]" name="groups_id"/>
|
||||
</record>
|
||||
|
||||
</data>
|
||||
</openerp>
|
|
@ -129,7 +129,7 @@
|
|||
</group>
|
||||
</page>
|
||||
<page string="Depreciation Board">
|
||||
<field name="depreciation_line_ids" mode="tree,graph">
|
||||
<field name="depreciation_line_ids" mode="tree">
|
||||
<tree string="Depreciation Lines" colors="blue:(move_check == False);black:(move_check == True)">
|
||||
<field name="depreciation_date"/>
|
||||
<field name="sequence" invisible="1"/>
|
||||
|
@ -159,11 +159,6 @@
|
|||
</group>
|
||||
</group>
|
||||
</form>
|
||||
<graph type="bar">
|
||||
<field name="name"/>
|
||||
<field name="amount"/>
|
||||
<field name="depreciated_value"/>
|
||||
</graph>
|
||||
</field>
|
||||
<button type="object" name="compute_depreciation_board" string="Compute" icon="terp-stock_format-scientific" colspan="2" attrs="{'invisible':[('state','=','close')]}"/>
|
||||
</page>
|
||||
|
|
|
@ -62,12 +62,7 @@
|
|||
<field name="account_ids"/>
|
||||
</page>
|
||||
<page string="Budget Lines">
|
||||
<field name="crossovered_budget_line" widget="one2many_list" mode="graph,tree">
|
||||
<graph type="bar" string="Lines">
|
||||
<field name="analytic_account_id" groups="analytic.group_analytic_accounting"/>
|
||||
<field name="planned_amount" operator="+"/>
|
||||
<field group="True" name="general_budget_id"/>
|
||||
</graph>
|
||||
<field name="crossovered_budget_line" widget="one2many_list" mode="tree">
|
||||
<tree string="Budget Lines" editable="top">
|
||||
<field name="crossovered_budget_id"/>
|
||||
<field name="analytic_account_id" groups="analytic.group_analytic_accounting" domain="[('parent_id','!=',False)]"/>
|
||||
|
|
|
@ -22,6 +22,10 @@
|
|||
<field eval="True" name="global"/>
|
||||
<field name="domain_force">['|',('company_id','=',False),('company_id','child_of',[user.company_id.id])]</field>
|
||||
</record>
|
||||
|
||||
<record model="res.users" id="base.user_root">
|
||||
<field eval="[(4,ref('analytic.group_analytic_accounting'))]" name="groups_id"/>
|
||||
</record>
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
|
|
|
@ -404,9 +404,9 @@
|
|||
<field name="name"/>
|
||||
<field name="statement_id" readonly="1"/>
|
||||
<field name="ref" readonly="1"/>
|
||||
<field name="partner_id" on_change="onchange_partner_id(partner_id)"/>
|
||||
<field name="type" on_change="onchange_type(partner_id, type)"/>
|
||||
<field name="account_id" domain="[('journal_id','=',parent.journal_id)]"/>
|
||||
<field name="partner_id" />
|
||||
<field name="type" />
|
||||
<field name="account_id" />
|
||||
<field name="amount" readonly="1" sum="Total Amount"/>
|
||||
<field name="globalisation_id" string="Glob. Id"/>
|
||||
<field name="globalisation_amount" string="Glob. Am."/>
|
||||
|
@ -426,9 +426,9 @@
|
|||
<field name="val_date"/>
|
||||
<field name="name"/>
|
||||
<field name="ref" readonly="0"/>
|
||||
<field name="partner_id" on_change="onchange_partner_id(partner_id)"/>
|
||||
<field name="type" on_change="onchange_type(partner_id, type)"/>
|
||||
<field domain="[('journal_id', '=', parent.journal_id), ('type', '<>', 'view')]" name="account_id"/>
|
||||
<field name="partner_id"/>
|
||||
<field name="type" />
|
||||
<field domain="[('type', '<>', 'view')]" name="account_id"/>
|
||||
<field name="amount"/>
|
||||
<field name="globalisation_id"/>
|
||||
<field name="sequence" readonly="0"/>
|
||||
|
|
|
@ -47,16 +47,18 @@
|
|||
<field name="state" widget="statusbar" statusbar_visible="draft,posted" statusbar_colors='{"proforma":"blue"}'/>
|
||||
</header>
|
||||
<sheet string="Accounting Voucher">
|
||||
<group col="6" colspan="4">
|
||||
<group col="4" colspan="4">
|
||||
<field name="partner_id" required="1" on_change="onchange_journal_voucher(line_ids, tax_id, amount, partner_id, journal_id, type)"/>
|
||||
<field name="payment_rate_currency_id" invisible="1"/>
|
||||
<field name="date" on_change="onchange_date(date, currency_id, payment_rate_currency_id, amount, company_id)"/>
|
||||
<field name="journal_id" widget="selection" on_change="onchange_journal_voucher(line_ids, tax_id, amount, partner_id, journal_id, type)"/>
|
||||
<field name="type" required="1"/>
|
||||
<field name="name" colspan="2"/>
|
||||
<field name="company_id" widget="selection" groups="base.group_multi_company"/>
|
||||
<field name="reference"/>
|
||||
<field name="number"/>
|
||||
<field name="currency_id" groups="base.group_multi_currency"/>
|
||||
<field name="account_id" widget="selection" invisible="True"/>
|
||||
<field name="payment_rate_currency_id" invisible="1"/>
|
||||
</group>
|
||||
<notebook colspan="4">
|
||||
<page string="Voucher Entry">
|
||||
|
@ -69,20 +71,16 @@
|
|||
<field name="account_analytic_id" groups="analytic.group_analytic_accounting"/>
|
||||
</tree>
|
||||
</field>
|
||||
<group col="3">
|
||||
<group string="Internal Notes">
|
||||
<field name="narration" colspan="2" nolabel="1"/>
|
||||
</group>
|
||||
<group string="Other Information">
|
||||
<field name="number"/>
|
||||
<field name="currency_id" groups="base.group_multi_currency"/>
|
||||
</group>
|
||||
<group col="4" attrs="{'invisible':[('type','in',['payment', 'receipt', False])]}">
|
||||
<separator string="Total" colspan="4"/>
|
||||
<field name="tax_id" on_change="onchange_price(line_ids, tax_id, partner_id)" widget="selection"/>
|
||||
<group>
|
||||
<field name="narration" nolabel="1" placeholder="Internal Notes"/>
|
||||
<group class="oe_subtotal_footer oe_right" attrs="{'invisible':[('type','in',['payment', 'receipt', False])]}">
|
||||
<field name="tax_id" on_change="onchange_price(line_ids, tax_id, partner_id)" widget="selection" nolabel="1"/>
|
||||
<field name="tax_amount" nolabel="1"/>
|
||||
<button type="object" icon="terp-stock_format-scientific" name="compute_tax" string="Compute Tax" attrs="{'invisible': [('state','!=','draft')]}"/>
|
||||
<label colspan="1" string=""/><field name="amount" string="Total"/>
|
||||
<div class="oe_subtotal_footer_separator">
|
||||
<label for="amount"/>
|
||||
<button type="object" icon="terp-stock_format-scientific" name="compute_tax" class="oe_link oe_edit_only" string="(Update)" attrs="{'invisible': [('state','!=','draft')]}"/>
|
||||
</div>
|
||||
<field name="amount" class="oe_subtotal_footer_separator" nolabel="1"/>
|
||||
</group>
|
||||
</group>
|
||||
</page>
|
||||
|
|
|
@ -68,8 +68,10 @@ class ir_model_fields_anonymization(osv.osv):
|
|||
return state
|
||||
|
||||
def _check_write(self, cr, uid, context=None):
|
||||
# check that the field is created from the menu and not from an database update
|
||||
# otherwise the database update can crash:
|
||||
"""check that the field is created from the menu and not from an database update
|
||||
otherwise the database update can crash:"""
|
||||
if context is None:
|
||||
context = {}
|
||||
|
||||
if context.get('manual'):
|
||||
global_state = self._get_global_state(cr, uid, context=context)
|
||||
|
@ -295,10 +297,10 @@ class ir_model_fields_anonymize_wizard(osv.osv_memory):
|
|||
|
||||
def fields_view_get(self, cr, uid, view_id=None, view_type='form', context=None, *args, **kwargs):
|
||||
state = self.pool.get('ir.model.fields.anonymization')._get_global_state(cr, uid, context=context)
|
||||
|
||||
|
||||
if context is None:
|
||||
context = {}
|
||||
|
||||
|
||||
step = context.get('step', 'new_window')
|
||||
|
||||
res = super(ir_model_fields_anonymize_wizard, self).fields_view_get(cr, uid, view_id, view_type, context, *args, **kwargs)
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
<field name="groups_id" eval="[(5,)]"/>
|
||||
</record>
|
||||
|
||||
<record id="default_template_user" model="ir.config_parameter">
|
||||
<record id="default_template_user_config" model="ir.config_parameter">
|
||||
<field name="key">auth_signup.template_user_id</field>
|
||||
<field name="value" ref="default_template_user"/>
|
||||
</record>
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
##############################################################################
|
||||
|
||||
{
|
||||
'name': 'Calendar Layer',
|
||||
'name': 'Calendar',
|
||||
'version': '1.0',
|
||||
'depends': ['base', 'base_status', 'mail', 'base_action_rule'],
|
||||
'description': """
|
||||
|
@ -51,6 +51,7 @@ If you need to manage your meetings, you should install the CRM module.
|
|||
],
|
||||
'test' : ['test/base_calendar_test.yml'],
|
||||
'installable': True,
|
||||
'application': True,
|
||||
'auto_install': False,
|
||||
'certificate': '00694071962960352821',
|
||||
'images': ['images/base_calendar1.jpeg','images/base_calendar2.jpeg','images/base_calendar3.jpeg','images/base_calendar4.jpeg',],
|
||||
|
|
|
@ -1431,7 +1431,10 @@ rule or repeating pattern of time to exclude from the recurring rule."),
|
|||
if r['class']=='private':
|
||||
for f in r.keys():
|
||||
if f not in ('id','date','date_deadline','duration','user_id','state'):
|
||||
r[f] = False
|
||||
if isinstance(r[f], list):
|
||||
r[f] = []
|
||||
else:
|
||||
r[f] = False
|
||||
if f=='name':
|
||||
r[f] = _('Busy')
|
||||
|
||||
|
|
|
@ -428,5 +428,6 @@
|
|||
name="Events" parent="base.menu_calendar_configuration"
|
||||
sequence="15" action="action_view_event"/>
|
||||
|
||||
<menuitem name="Agenda" id="mail_menu_agenda" parent="mail.mail_my_stuff" sequence="10" action="action_view_event"/>
|
||||
</data>
|
||||
</openerp>
|
||||
|
|
|
@ -53,7 +53,7 @@ class crm_meeting(base_state, osv.Model):
|
|||
'partner_ids': fields.many2many('res.partner', 'crm_meeting_partner_rel', 'meeting_id','partner_id',
|
||||
string='Attendees', states={'done': [('readonly', True)]}),
|
||||
'state': fields.selection(
|
||||
[('draft', 'Unconfirmed'), ('open', 'Confirmed'), ('cancel', 'Cancelled'), ('done', 'Done')],
|
||||
[('draft', 'Unconfirmed'), ('open', 'Confirmed')],
|
||||
string='Status', size=16, readonly=True),
|
||||
# Meeting fields
|
||||
'name': fields.char('Meeting Subject', size=128, required=True, states={'done': [('readonly', True)]}),
|
||||
|
|
|
@ -69,9 +69,7 @@
|
|||
<field name="model">crm.meeting</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Meetings" version="7.0">
|
||||
<header>
|
||||
<field name="state" invisible="True"/>
|
||||
</header>
|
||||
<field name="state" invisible="True"/>
|
||||
<sheet>
|
||||
<div class="oe_title">
|
||||
<div class="oe_edit_only">
|
||||
|
|
Binary file not shown.
After Width: | Height: | Size: 7.5 KiB |
|
@ -69,7 +69,7 @@ class base_stage(object):
|
|||
return False
|
||||
return uid
|
||||
|
||||
def onchange_partner_address_id(self, cr, uid, ids, add, email=False):
|
||||
def onchange_partner_address_id(self, cr, uid, ids, add, email=False, context=None):
|
||||
""" This function returns value of partner email based on Partner Address
|
||||
:param add: Id of Partner's address
|
||||
:param email: Partner's email ID
|
||||
|
@ -77,10 +77,20 @@ class base_stage(object):
|
|||
data = {'value': {'email_from': False, 'phone':False}}
|
||||
if add:
|
||||
address = self.pool.get('res.partner').browse(cr, uid, add)
|
||||
data['value'] = {'email_from': address and address.email or False ,
|
||||
'phone': address and address.phone or False}
|
||||
if 'phone' not in self._columns:
|
||||
del data['value']['phone']
|
||||
data['value'] = {'partner_name': address and address.name or False,
|
||||
'email_from': address and address.email or False,
|
||||
'phone': address and address.phone or False,
|
||||
'street': address and address.street or False,
|
||||
'street2': address and address.street2 or False,
|
||||
'city': address and address.city or False,
|
||||
'state_id': address.state_id and address.state_id.id or False,
|
||||
'zip': address and address.zip or False,
|
||||
'country_id': address.country_id and address.country_id.id or False,
|
||||
}
|
||||
fields = self.fields_get(cr, uid, context=context or {})
|
||||
for key in data['value'].keys():
|
||||
if key not in fields:
|
||||
del data['value'][key]
|
||||
return data
|
||||
|
||||
def onchange_partner_id(self, cr, uid, ids, part, email=False):
|
||||
|
|
|
@ -0,0 +1,21 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
##############################################################################
|
||||
#
|
||||
# OpenERP, Open Source Management Solution
|
||||
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU Affero General Public License as
|
||||
# published by the Free Software Foundation, either version 3 of the
|
||||
# License, or (at your option) any later version.
|
||||
#
|
||||
# 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 for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Affero General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
##############################################################################
|
||||
|
|
@ -18,28 +18,27 @@
|
|||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
##############################################################################
|
||||
from osv import osv
|
||||
|
||||
class res_company(osv.osv):
|
||||
_inherit = "res.company"
|
||||
_description = 'Company'
|
||||
|
||||
def _get_default_ad(self, addresses):
|
||||
name = email = phone = city = post_code = address = country_code = ""
|
||||
for ads in addresses:
|
||||
if ads.type == 'default':
|
||||
city = ads.city or ""
|
||||
post_code = ads.zip or ""
|
||||
if ads.street:
|
||||
address = ads.street or ""
|
||||
if ads.street2:
|
||||
address += " " + ads.street2
|
||||
if ads.country_id:
|
||||
country_code = ads.country_id and ads.country_id.code or ""
|
||||
name = ads.name or ""
|
||||
email = ads.email or ""
|
||||
phone = ads.phone or ""
|
||||
return name, email, phone, city, post_code, address, country_code
|
||||
res_company()
|
||||
{
|
||||
'name': 'Address Book',
|
||||
'version': '1.0',
|
||||
'category': 'Tools',
|
||||
'description': """
|
||||
This module gives you a quick view of your address book, accessible from your home page.
|
||||
You can track your suppliers, customers and other contacts.
|
||||
""",
|
||||
'author': 'OpenERP SA',
|
||||
'website': 'http://openerp.com',
|
||||
'summary': 'Contacts, People and Companies',
|
||||
'depends': [
|
||||
'mail',
|
||||
],
|
||||
'data': [
|
||||
'contacts_view.xml',
|
||||
],
|
||||
'installable': True,
|
||||
'application': True,
|
||||
'auto_install': False,
|
||||
}
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
|
@ -0,0 +1,53 @@
|
|||
<?xml version="1.0" ?>
|
||||
<openerp>
|
||||
<data>
|
||||
|
||||
|
||||
<record id="action_contacts" model="ir.actions.act_window">
|
||||
<field name="name">Contacts</field>
|
||||
<field name="type">ir.actions.act_window</field>
|
||||
<field name="res_model">res.partner</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">kanban,tree,form</field>
|
||||
<field name="search_view_id" ref="base.view_res_partner_filter"/>
|
||||
<field name="help" type="html">
|
||||
<p class="oe_view_nocontent_create">
|
||||
Click to add a contact in your address book.
|
||||
</p><p>
|
||||
OpenERP helps you easily track all activities related to
|
||||
a customer; discussions, history of business opportunities,
|
||||
documents, etc.
|
||||
</p>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="action_contacts_view_kanban" model="ir.actions.act_window.view">
|
||||
<field eval="0" name="sequence"/>
|
||||
<field name="view_mode">kanban</field>
|
||||
<field name="view_id" ref="base.res_partner_kanban_view"/>
|
||||
<field name="act_window_id" ref="action_contacts"/>
|
||||
</record>
|
||||
<record id="action_contacts_view_tree" model="ir.actions.act_window.view">
|
||||
<field name="sequence" eval="1"/>
|
||||
<field name="view_mode">tree</field>
|
||||
<field name="view_id" ref="base.view_partner_tree"/>
|
||||
<field name="act_window_id" ref="action_contacts"/>
|
||||
</record>
|
||||
<record id="action_contacts_view_form" model="ir.actions.act_window.view">
|
||||
<field eval="2" name="sequence"/>
|
||||
<field name="view_mode">form</field>
|
||||
<field name="view_id" ref="base.view_partner_form"/>
|
||||
<field name="act_window_id" ref="action_contacts"/>
|
||||
</record>
|
||||
|
||||
<menuitem name="Contacts"
|
||||
id="menu_contacts"
|
||||
parent="mail.mail_my_stuff"
|
||||
sequence="11"
|
||||
action="action_contacts"
|
||||
groups="base.group_user,base.group_partner_manager"/>
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
|
||||
|
Binary file not shown.
After Width: | Height: | Size: 50 KiB |
|
@ -25,7 +25,7 @@
|
|||
'version': '1.0',
|
||||
'category': 'Customer Relationship Management',
|
||||
'sequence': 2,
|
||||
'summary': 'Leads, Opportunities, Agenda',
|
||||
'summary': 'Leads, Opportunities, Phone Calls',
|
||||
'description': """
|
||||
The generic OpenERP Customer Relationship Management
|
||||
=====================================================
|
||||
|
|
|
@ -92,9 +92,10 @@ class crm_case_stage(osv.osv):
|
|||
_defaults = {
|
||||
'sequence': lambda *args: 1,
|
||||
'probability': lambda *args: 0.0,
|
||||
'state': 'draft',
|
||||
'state': 'open',
|
||||
'fold': False,
|
||||
'type': 'both',
|
||||
'case_default': True,
|
||||
}
|
||||
|
||||
class crm_case_section(osv.osv):
|
||||
|
|
|
@ -132,8 +132,6 @@
|
|||
<header>
|
||||
<button name="%(crm.action_crm_lead2opportunity_partner)d" string="Convert to Opportunity" type="action"
|
||||
states="draft,open,pending" help="Convert to Opportunity" class="oe_highlight"/>
|
||||
<button name="case_escalate" string="Escalate" type="object"
|
||||
states="draft,open,pending"/>
|
||||
<button name="case_reset" string="Reset" type="object"
|
||||
states="cancel"/>
|
||||
<button name="case_cancel" string="Cancel" type="object"
|
||||
|
@ -188,7 +186,11 @@
|
|||
</group>
|
||||
<group>
|
||||
<field name="user_id"/>
|
||||
<field name="section_id"/>
|
||||
<label for="section_id"/>
|
||||
<div>
|
||||
<field name="section_id"/>
|
||||
<button name="case_escalate" string="Escalate" type="object" states="draft,open,pending"/>
|
||||
</div>
|
||||
<field name="type" invisible="1"/>
|
||||
</group>
|
||||
<group>
|
||||
|
@ -402,8 +404,6 @@
|
|||
states="draft,open,pending" class="oe_highlight"/>
|
||||
<button name="case_mark_lost" string="Mark Lost" type="object"
|
||||
states="draft,open" class="oe_highlight"/>
|
||||
<button name="case_escalate" string="Escalate" type="object"
|
||||
states="open" />
|
||||
<field name="stage_id" widget="statusbar" clickable="True"/>
|
||||
</header>
|
||||
<sheet>
|
||||
|
@ -449,7 +449,11 @@
|
|||
|
||||
<group>
|
||||
<field name="user_id"/>
|
||||
<field name="section_id" colspan="1" widget="selection"/>
|
||||
<label for="section_id"/>
|
||||
<div>
|
||||
<field name="section_id" widget="selection"/>
|
||||
<button name="case_escalate" string="Escalate" type="object" states="draft,open,pending" />
|
||||
</div>
|
||||
</group>
|
||||
<group>
|
||||
<field name="categ_ids"
|
||||
|
|
|
@ -104,56 +104,55 @@
|
|||
<field name="arch" type="xml">
|
||||
<form string="Phone Call" version="7.0">
|
||||
<header>
|
||||
<button name="case_close" string="Held" type="object" class="oe_highlight"
|
||||
<button name="case_close" string="Call Done" type="object" class="oe_highlight"
|
||||
states="open,pending"/>
|
||||
<button name="case_reset" string="Reset to Todo" type="object"
|
||||
states="cancel"/>
|
||||
<button string="Convert to Opportunity"
|
||||
name="%(phonecall2opportunity_act)d"
|
||||
type="action"
|
||||
attrs="{'invisible':[ '|', ('opportunity_id','!=',False), ('state','!=', 'open')]}"/>
|
||||
<button string="Convert to Opportunity" class="oe_highlight"
|
||||
name="%(phonecall2opportunity_act)d"
|
||||
type="action"
|
||||
attrs="{'invisible':[ '|', ('opportunity_id','!=',False), ('state','!=', 'done')]}"/>
|
||||
<button string="Schedule Other Call"
|
||||
name="%(phonecall_to_phonecall_act)d"
|
||||
type="action"/>
|
||||
<button string="Schedule a Meeting" name="action_make_meeting" type="object"/>
|
||||
<button name="case_cancel" string="Cancel" type="object"
|
||||
states="draft,open,pending"/>
|
||||
<field name="state" widget="statusbar" nolabel="1" statusbar_visible="open,done"/>
|
||||
</header>
|
||||
<sheet string="Phone Call">
|
||||
<div class="oe_title">
|
||||
<div class="oe_edit_only">
|
||||
<label for="name" string="Title"/>
|
||||
</div>
|
||||
<h1><field name="name" required="1"/></h1>
|
||||
<div class="oe_edit_only">
|
||||
<label for="partner_phone" string="Phone"/>
|
||||
</div>
|
||||
<h2><field name="partner_phone"/></h2>
|
||||
</div>
|
||||
<group col="4">
|
||||
<field name="date"/>
|
||||
<field name="user_id"/>
|
||||
<field name="duration" widget="float_time"/>
|
||||
<field name="section_id" colspan="1" widget="selection"/>
|
||||
<field name="partner_id" on_change="onchange_partner_id(partner_id)"/>
|
||||
<field name="categ_id" widget="selection"
|
||||
domain="[('object_id.model', '=', 'crm.phonecall')]"/>
|
||||
<field name="partner_mobile"/>
|
||||
<field name="priority"/>
|
||||
<field name="opportunity_id"/>
|
||||
</group>
|
||||
<sheet string="Phone Call">
|
||||
<div class="oe_right">
|
||||
<button string="Convert to Opportunity"
|
||||
name="%(phonecall2opportunity_act)d"
|
||||
type="action"
|
||||
attrs="{'invisible':[ '|', ('opportunity_id','!=',False), ('state', 'not in', ('open', 'done'))]}"/>
|
||||
<button string="Schedule Other Call"
|
||||
name="%(phonecall_to_phonecall_act)d"
|
||||
type="action"/>
|
||||
<button string="Schedule a Meeting" name="action_make_meeting" type="object"/>
|
||||
</div>
|
||||
<div class="oe_title">
|
||||
<div class="oe_edit_only">
|
||||
<label for="name" string="Title"/>
|
||||
</div>
|
||||
<h1><field name="name" required="1"/></h1>
|
||||
<div class="oe_edit_only">
|
||||
<label for="partner_phone" string="Phone"/>
|
||||
</div>
|
||||
<h2><field name="partner_phone"/></h2>
|
||||
</div>
|
||||
|
||||
<group col="4">
|
||||
<field name="date"/>
|
||||
<field name="user_id"/>
|
||||
<field name="duration" widget="float_time"/>
|
||||
<field name="section_id" colspan="1" widget="selection"/>
|
||||
<field name="partner_id" on_change="onchange_partner_id(partner_id)"/>
|
||||
<field name="categ_id" widget="selection"
|
||||
domain="[('object_id.model', '=', 'crm.phonecall')]"/>
|
||||
<field name="partner_mobile"/>
|
||||
<field name="priority"/>
|
||||
<field name="opportunity_id"/>
|
||||
</group>
|
||||
|
||||
<field name="description" placeholder="Description..."/>
|
||||
</sheet>
|
||||
<div class="oe_chatter">
|
||||
<field name="message_ids" widget="mail_thread"/>
|
||||
<field name="message_follower_ids" widget="mail_followers"/>
|
||||
</div>
|
||||
<field name="description" placeholder="Description..."/>
|
||||
</sheet>
|
||||
<div class="oe_chatter">
|
||||
<field name="message_ids" widget="mail_thread"/>
|
||||
<field name="message_follower_ids" widget="mail_followers"/>
|
||||
</div>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
|
|
@ -130,10 +130,10 @@
|
|||
<field name="arch" type="xml">
|
||||
<xpath expr="//div[@name='buttons']" position="inside">
|
||||
<button type="action"
|
||||
string="Schedule a Meeting"
|
||||
string="Meetings"
|
||||
name="%(base_calendar.action_crm_meeting)d"
|
||||
context="{'search_default_partner_ids': active_id, 'default_partner_ids' : [active_id]}"/>
|
||||
<button type="action" string="Schedule a Call"
|
||||
<button type="action" string="Calls"
|
||||
name="%(crm.crm_case_categ_phone_create_partner)d"
|
||||
context="{'search_default_partner_id': active_id, 'default_duration': 1.0}" />
|
||||
<button type="action" string="Opportunities" attrs="{'invisible': [('customer', '=', False)]}"
|
||||
|
|
|
@ -44,10 +44,6 @@ Web pages
|
|||
'auto_install': False,
|
||||
'certificate': '0086363630317',
|
||||
'images': [],
|
||||
'js': [
|
||||
'static/src/lib/wiky/wiky.js',
|
||||
'static/src/js/document_page.js'
|
||||
],
|
||||
'css' : ['static/src/css/document_page.css'],
|
||||
}
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
|
|
@ -23,24 +23,28 @@ Additional ressources
|
|||
<field name="name">OpenERP 6.1. Functional Demo</field>
|
||||
<field name="parent_id" ref="demo_category1"/>
|
||||
<field name="content">
|
||||
|
||||
The news is out, OpenERP's latest version 6.1. is here. It's more
|
||||
user-friendly, even more business oriented and efficient to manage your company
|
||||
|
||||
How to discover the latest version 6.1.?
|
||||
|
||||
Demo : [http://demo.openerp.com]
|
||||
Online: [http://openerp.com/online]
|
||||
Download: [http://openerp.com/downloads]
|
||||
|
||||
We have also put together a functional demo that presents 6.1. Watch this video
|
||||
to learn directly from us what OpenERP 6.1. can do for you. Share it in your
|
||||
company, with your clients and implement it now for your business.
|
||||
|
||||
==Watch on Youtube!==
|
||||
|
||||
[[Video:http://www.youtube.com/embed/7jES2jxKMso ]]
|
||||
|
||||
<![CDATA[
|
||||
<br>
|
||||
<br>
|
||||
The news is out, OpenERP's latest version 6.1. is here. It's more<br>
|
||||
user-friendly, even more business oriented and efficient to manage your company<br>
|
||||
<br>
|
||||
How to discover the latest version 6.1.?<br>
|
||||
<br>
|
||||
Demo : <a target="http://demo.openerp.com" href="http://demo.openerp.com" style="background: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAFZJREFUeF59z4EJADEIQ1F36k7u5E7ZKXeUQPACJ3wK7UNokVxVk9kHnQH7bY9hbDyDhNXgjpRLqFlo4M2GgfyJHhjq8V4agfrgPQX3JtJQGbofmCHgA/nAKks+JAjFAAAAAElFTkSuQmCC") no-repeat scroll right center transparent;padding-right: 13px;"></a><br>
|
||||
Online: <a target="http://openerp.com/online" href="http://openerp.com/online" style="background: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAFZJREFUeF59z4EJADEIQ1F36k7u5E7ZKXeUQPACJ3wK7UNokVxVk9kHnQH7bY9hbDyDhNXgjpRLqFlo4M2GgfyJHhjq8V4agfrgPQX3JtJQGbofmCHgA/nAKks+JAjFAAAAAElFTkSuQmCC") no-repeat scroll right center transparent;padding-right: 13px;"></a><br>
|
||||
Download: <a target="http://openerp.com/downloads" href="http://openerp.com/downloads" style="background: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAFZJREFUeF59z4EJADEIQ1F36k7u5E7ZKXeUQPACJ3wK7UNokVxVk9kHnQH7bY9hbDyDhNXgjpRLqFlo4M2GgfyJHhjq8V4agfrgPQX3JtJQGbofmCHgA/nAKks+JAjFAAAAAElFTkSuQmCC") no-repeat scroll right center transparent;padding-right: 13px;"></a><br>
|
||||
<br>
|
||||
We have also put together a functional demo that presents 6.1. Watch this video<br>
|
||||
to learn directly from us what OpenERP 6.1. can do for you. Share it in your<br>
|
||||
company, with your clients and implement it now for your business.<br>
|
||||
<br>
|
||||
<h3>Watch on Youtube!</h3><br>
|
||||
<br>
|
||||
<iframe width="480" height="390" src="http://www.youtube.com/embed/7jES2jxKMso " frameborder="0" allowfullscreen=""></iframe><br>
|
||||
<br>
|
||||
<br>
|
||||
]]>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
|
@ -48,36 +52,40 @@ company, with your clients and implement it now for your business.
|
|||
<field name="name">Personalise Dashboards</field>
|
||||
<field name="parent_id" ref="demo_category1"/>
|
||||
<field name="content">
|
||||
You like OpenERP, but feel like you want to personalise it more? Now, OpenERP
|
||||
goes a step further and lets you customize your dashboard. Thanks to a new
|
||||
feature that allows you to customize your dashboard by adding new boards of any
|
||||
search view.
|
||||
|
||||
==How is it done?==
|
||||
|
||||
Step 1: access one search view
|
||||
|
||||
Step 2: apply the filter you want to see at each connection to the application
|
||||
(eg. on sales, manufacturing, etc)
|
||||
|
||||
Step 3: add it into the dashboard in the same space where you can save the filter
|
||||
|
||||
Step 4: choose the application you want it visible on and the name of the array
|
||||
|
||||
Look at this simple example below from Purchase, where I want to put on the
|
||||
application's dashboard "Purchases to Approve". After I access the search view
|
||||
and apply the filter for "Purchases to Approve", I can add it immediately to my
|
||||
Purchase dashboard.
|
||||
|
||||
[[File:http://www.openerp.com/sites/default/files/fileattach/dashboard2_1(1).png ]]
|
||||
|
||||
In less than a minute, the search view is visible on the dashboard
|
||||
|
||||
[[File:http://www.openerp.com/sites/default/files/fileattach/dashboard2_2.png ]]
|
||||
|
||||
Of course, you are free to delete what you don't need or like, but just in case
|
||||
you change your mind there is a reset button to return to the default view.
|
||||
|
||||
<![CDATA[
|
||||
<br>
|
||||
You like OpenERP, but feel like you want to personalise it more? Now, OpenERP<br>
|
||||
goes a step further and lets you customize your dashboard. Thanks to a new<br>
|
||||
feature that allows you to customize your dashboard by adding new boards of any<br>
|
||||
search view.<br>
|
||||
<br>
|
||||
<h3>How is it done?</h3><br>
|
||||
<br>
|
||||
Step 1: access one search view <br>
|
||||
<br>
|
||||
Step 2: apply the filter you want to see at each connection to the application<br>
|
||||
(eg. on sales, manufacturing, etc)<br>
|
||||
<br>
|
||||
Step 3: add it into the dashboard in the same space where you can save the filter<br>
|
||||
<br>
|
||||
Step 4: choose the application you want it visible on and the name of the array<br>
|
||||
<br>
|
||||
Look at this simple example below from Purchase, where I want to put on the<br>
|
||||
application's dashboard "Purchases to Approve". After I access the search view<br>
|
||||
and apply the filter for "Purchases to Approve", I can add it immediately to my<br>
|
||||
Purchase dashboard.<br>
|
||||
<br>
|
||||
<img src="http://www.openerp.com/sites/default/files/fileattach/dashboard2_1(1).png" alt=""><br>
|
||||
<br>
|
||||
In less than a minute, the search view is visible on the dashboard<br>
|
||||
<br>
|
||||
<img src="http://www.openerp.com/sites/default/files/fileattach/dashboard2_2.png" alt=""><br>
|
||||
<br>
|
||||
Of course, you are free to delete what you don't need or like, but just in case<br>
|
||||
you change your mind there is a reset button to return to the default view.<br>
|
||||
<br>
|
||||
<br>
|
||||
]]>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
|
@ -85,36 +93,36 @@ you change your mind there is a reset button to return to the default view.
|
|||
<field name="name">Touchscreen Point of Sale</field>
|
||||
<field name="parent_id" ref="demo_category1"/>
|
||||
<field name="content">
|
||||
The brand new OpenERP touchscreen point of sale available with 6.1 allows you
|
||||
to manage your shop sales very easily. It's fully web based so that you don't
|
||||
have to install or deploy any software and all the sales shops can be easily
|
||||
consolidated. It works in connected and disconnected modes so that you can
|
||||
continue to sell if you lose your internet connection.
|
||||
|
||||
[[File:http://www.openerp.com/sites/default/files/fileattach/POS(2).png ]]
|
||||
|
||||
==Here's a summary of its main features and benefits:==
|
||||
|
||||
100% WEB based
|
||||
|
||||
* available for any touchscreen device (ipod, ipad, any tablet)mobile (with portable devices)
|
||||
* no installation required
|
||||
* no synchronization needed, completely integrated
|
||||
* continue working even when your connection is down if you close your browser, data won't be lost
|
||||
* fully web based with a clean interface smart interface
|
||||
|
||||
You have different options to select your products. You can do it through the
|
||||
barcode reader, just browse through the categories you have put in place (ie.
|
||||
drinks, snacks, meals, etc.), or text search in case neither of the other
|
||||
options work for you. If you need to use the POS for your restaurant, for
|
||||
example, your employees can record at the same time multiple tickets without
|
||||
having to wait to do one transaction at a time. Along, to facilitate payment,
|
||||
the application allows multiple payment methods.
|
||||
|
||||
The POS application is so simple and accessible to use that your shop or
|
||||
restaurant will never need any other tool to manage orders. Due to its smart
|
||||
and user-friendly interface you don't need any training to learn how to use it.
|
||||
Think of it as an out-of-the-box solution to boost your business' productivity.
|
||||
<![CDATA[
|
||||
<br>
|
||||
The brand new OpenERP touchscreen point of sale available with 6.1 allows you<br>
|
||||
to manage your shop sales very easily. It's fully web based so that you don't<br>
|
||||
have to install or deploy any software and all the sales shops can be easily<br>
|
||||
consolidated. It works in connected and disconnected modes so that you can<br>
|
||||
continue to sell if you lose your internet connection.<br>
|
||||
<br>
|
||||
<img src="http://www.openerp.com/sites/default/files/fileattach/POS(2).png" alt=""><br>
|
||||
<br>
|
||||
<h3>Here's a summary of its main features and benefits:</h3><br>
|
||||
<br>
|
||||
100% WEB based<br>
|
||||
<br>
|
||||
<ul><li>available for any touchscreen device (ipod, ipad, any tablet)mobile (with portable devices)</li><li>no installation required</li><li>no synchronization needed, completely integrated</li><li>continue working even when your connection is down if you close your browser, data won't be lost</li><li>fully web based with a clean interface smart interface</li></ul><br>
|
||||
<br>
|
||||
You have different options to select your products. You can do it through the<br>
|
||||
barcode reader, just browse through the categories you have put in place (ie.<br>
|
||||
drinks, snacks, meals, etc.), or text search in case neither of the other<br>
|
||||
options work for you. If you need to use the POS for your restaurant, for<br>
|
||||
example, your employees can record at the same time multiple tickets without<br>
|
||||
having to wait to do one transaction at a time. Along, to facilitate payment,<br>
|
||||
the application allows multiple payment methods.<br>
|
||||
<br>
|
||||
The POS application is so simple and accessible to use that your shop or<br>
|
||||
restaurant will never need any other tool to manage orders. Due to its smart<br>
|
||||
and user-friendly interface you don't need any training to learn how to use it.<br>
|
||||
Think of it as an out-of-the-box solution to boost your business' productivity.<br>
|
||||
<br>
|
||||
]]>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
|
|
|
@ -55,7 +55,7 @@
|
|||
</div>
|
||||
<field name="content" placeholder="e.g. Once upon a time..." class="oe_edit_only"/>
|
||||
<div class="oe_document_page">
|
||||
<field name="display_content" widget="text_wiki" class="oe_view_only"/>
|
||||
<field name="display_content" widget="html" class="oe_view_only" options='{"safe": true}'/>
|
||||
</div>
|
||||
</form>
|
||||
</field>
|
||||
|
|
|
@ -1,18 +0,0 @@
|
|||
openerp.document_page = function (openerp) {
|
||||
openerp.web.form.widgets.add('text_wiki', 'openerp.web.form.FieldTextWiki');
|
||||
|
||||
openerp.web.form.FieldTextWiki = openerp.web.form.FieldText.extend({
|
||||
render_value: function() {
|
||||
var show_value = openerp.web.format_value(this.get('value'), this, '');
|
||||
if (!this.get("effective_readonly")) {
|
||||
this.$textarea.val(show_value);
|
||||
if (show_value && this.view.options.resize_textareas) {
|
||||
this.do_resize(this.view.options.resize_textareas);
|
||||
}
|
||||
} else {
|
||||
var wiki_value = wiky.process(show_value || '');
|
||||
this.$el.html(wiki_value);
|
||||
}
|
||||
},
|
||||
});
|
||||
};
|
|
@ -1,41 +0,0 @@
|
|||
Wiky.js - a javascript library to convert Wiki Markup language to HTML.
|
||||
=======================
|
||||
|
||||
(It is buggy, please use with care)
|
||||
|
||||
Wiky.js is a javascript library that converts Wiki Markup language to HTML.
|
||||
|
||||
|
||||
How to use it
|
||||
-------------------
|
||||
Include wiki.js into your HTML file. Wiky.js has only one function, which is wiky.process(wikitext).
|
||||
|
||||
Please see index.html for an example.
|
||||
|
||||
*wiky.js does not depend on jQuery, which is included for testing purpose.
|
||||
|
||||
|
||||
|
||||
Supported Syntax
|
||||
-------------------
|
||||
* == Heading ==
|
||||
* === Subheading ===
|
||||
* [http://www.url.com Name of URLs]
|
||||
* [[File:http://www.url.com/image.png Alternative Text]]
|
||||
* -------------------- (Horizontal line)
|
||||
* : (Indentation)
|
||||
* # Ordered bullet point
|
||||
* * Unordered bullet point
|
||||
|
||||
|
||||
|
||||
License
|
||||
------------------
|
||||
Creative Commons 3.0
|
||||
|
||||
|
||||
|
||||
Contributors
|
||||
-------------------
|
||||
Tanin Na Nakorn
|
||||
Tanun Niyomjit (Designer)
|
|
@ -1,56 +0,0 @@
|
|||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||
<script type="text/javascript" src="jquery-1.4.2.min.js"></script>
|
||||
<script type="text/javascript" src="wiky.js"></script>
|
||||
<title>Untitled Document</title>
|
||||
<link href="wiky.css" rel="stylesheet" type="text/css">
|
||||
</head>
|
||||
<body>
|
||||
<textarea id="textarea" onchange="$('#preview').html(wiky.process($(this).val()));" cols="60" rows="20">=== Heading ===
|
||||
Some content
|
||||
I would like to add another line
|
||||
|
||||
== Subheading ==
|
||||
Some more content
|
||||
Some more lines1
|
||||
:A line with indent
|
||||
:: A 2-indented line
|
||||
:: more
|
||||
:back to 1-indented line
|
||||
|
||||
This is Taeyeon.
|
||||
[[File:http://www.oknation.net/blog/home/blog_data/12/2012/images/ty4.jpg Taeyeon]]
|
||||
Taeyeon is so cute.
|
||||
|
||||
This is a link:[http://www.google.com Google].
|
||||
This is a bold link:'''[http://www.google.com Google]'''.
|
||||
This is a bold-italic link:'''''[http://www.google.com Google]'''''.
|
||||
This is '''bold''', '''''bold-italic''''', and ''italic''
|
||||
|
||||
[[Video:http://www.youtube.com/embed/ovVfLancwys]]
|
||||
# First
|
||||
# secon
|
||||
## Second-First
|
||||
*** First Point
|
||||
*** Second Point
|
||||
#### z
|
||||
#### y
|
||||
#### x
|
||||
*** Third Point
|
||||
## Second-Second [ftp://www.facebook.com FacebookFTP]
|
||||
## Second-Third [http://www.google.com Google Here]
|
||||
# third
|
||||
|
||||
</textarea>
|
||||
<br/>
|
||||
<span style="display:block;width:600px;border:1px solid #999999;">
|
||||
<span style="display:block;margin:10px 10px 10px 10px;" class="wiky_preview_area" id="preview">
|
||||
</span>
|
||||
</span>
|
||||
</body>
|
||||
</html>
|
||||
<script language="javascript">
|
||||
$('#preview').html(wiky.process($('#textarea').val()));
|
||||
</script>
|
|
@ -1,35 +0,0 @@
|
|||
=== Heading ===
|
||||
Some content
|
||||
I would like to add another line
|
||||
|
||||
== Subheading ==
|
||||
Some more content
|
||||
Some more lines1
|
||||
:A line with indent
|
||||
:: A 2-indented line
|
||||
:: more
|
||||
:back to 1-indented line
|
||||
|
||||
This is Taeyeon.
|
||||
[[File:http://www.oknation.net/blog/home/blog_data/12/2012/images/ty4.jpg Taeyeon]]
|
||||
Taeyeon is so cute.
|
||||
|
||||
This is a link:[http://www.google.com Google].
|
||||
This is a bold link:'''[http://www.google.com Google]'''.
|
||||
This is a bold-italic link:'''''[http://www.google.com Google]'''''.
|
||||
This is '''bold''', '''''bold-italic''''', and ''italic''
|
||||
|
||||
|
||||
# First
|
||||
# second
|
||||
## Second-First
|
||||
*** First Point
|
||||
*** Second Point
|
||||
#### z
|
||||
#### y
|
||||
#### x
|
||||
*** Third Point
|
||||
## Second-Second [ftp://www.facebook.com FacebookFTP]
|
||||
## Second-Third [http://www.google.com Google Here]
|
||||
# third
|
||||
|
|
@ -1,79 +0,0 @@
|
|||
@charset "UTF-8";
|
||||
.wiky_preview_area {
|
||||
font-family: "Helvetica Neue", Arial, Helvetica, 'Liberation Sans', FreeSans, sans-serif;
|
||||
font-size: 13px;
|
||||
line-height: 1.5em;
|
||||
color: #666;
|
||||
font-weight:350;
|
||||
width:600px;
|
||||
display:block;
|
||||
}
|
||||
.wiky_preview_area h2{
|
||||
font-size:24px;
|
||||
color:#333;
|
||||
font-weight:400;
|
||||
|
||||
text-shadow:0 1px 0 rgba(000, 000, 000, .4);
|
||||
}
|
||||
.wiky_preview_area h3{
|
||||
font-size:18px;
|
||||
color:#555;
|
||||
font-weight:400;
|
||||
|
||||
text-shadow:0 1px 0 rgba(000, 000, 000, .4);
|
||||
}
|
||||
.wiky_preview_area img{
|
||||
background-repeat: repeat;
|
||||
width: 400px;
|
||||
-webkit-border-radius: 10px;
|
||||
-moz-border-radius: 10px;
|
||||
border-radius: 10px;
|
||||
-webkit-box-shadow:0 1px 3px rgba(0, 0, 0, .8);
|
||||
-moz-box-shadow:0 1px 3px rgba(0, 0, 0, .8);
|
||||
box-shadow:0 1px 3px rgba(0, 0, 0, .8);
|
||||
}
|
||||
.wiky_preview_area a{
|
||||
padding:5px;
|
||||
font-weight:400;
|
||||
|
||||
background: #999; /* for non-css3 browsers */
|
||||
|
||||
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#cccccc', endColorstr='#000000'); /* for IE */
|
||||
background: -webkit-gradient(linear, left top, left bottom, from(#ccc), to(#000)); /* for webkit browsers */
|
||||
background: -moz-linear-gradient(top, #ccc, #000); /* for firefox 3.6+ */
|
||||
|
||||
-webkit-border-radius: 4px;
|
||||
-moz-border-radius: 4px;
|
||||
border-radius: 4px;
|
||||
|
||||
-webkit-box-shadow:none;
|
||||
-moz-box-shadow:none;
|
||||
box-shadow:none;
|
||||
|
||||
text-shadow:0 1px 0 rgba(255, 255, 255, 1);
|
||||
}
|
||||
|
||||
.wiky_preview_area a:hover{
|
||||
color:#333;
|
||||
padding:5px;
|
||||
font-weight:400;
|
||||
text-decoration:none;
|
||||
|
||||
-webkit-border-radius: 4px;
|
||||
-moz-border-radius: 4px;
|
||||
border-radius: 4px;
|
||||
|
||||
-webkit-box-shadow:0 1px 3px rgba(0, 0, 0, .3);
|
||||
-moz-box-shadow:0 1px 3px rgba(0, 0, 0, .3);
|
||||
box-shadow:0 1px 3px rgba(0, 0, 0, .3);
|
||||
|
||||
text-shadow:0 1px 0 rgba(255, 255, 255, 1);
|
||||
}
|
||||
|
||||
|
||||
.wiky_preview_area > ol,
|
||||
.wiky_preview_area > ul,
|
||||
.wiky_preview_area > ul > li,
|
||||
.wiky_preview_area > ol > li {
|
||||
list-style: disc inside none;
|
||||
}
|
|
@ -1,303 +0,0 @@
|
|||
/**
|
||||
* Wiky.js - Javascript library to converts Wiki MarkUp language to HTML.
|
||||
* You can do whatever with it. Please give me some credits (Apache License)
|
||||
* - Tanin Na Nakorn
|
||||
*/
|
||||
|
||||
var wiky = {};
|
||||
|
||||
|
||||
wiky.process = function(wikitext) {
|
||||
var lines = wikitext.split(/\r?\n/);
|
||||
var start;
|
||||
var html = "";
|
||||
|
||||
for (var i=0;i<lines.length;i++)
|
||||
{
|
||||
var line = lines[i];
|
||||
if (line.match(/^===/)!=null && line.match(/===$/)!=null)
|
||||
{
|
||||
html += "<h2>"+line.substring(3,line.length-3)+"</h2>";
|
||||
}
|
||||
else if (line.match(/^==/)!=null && line.match(/==$/)!=null)
|
||||
{
|
||||
html += "<h3>"+line.substring(2,line.length-2)+"</h3>";
|
||||
}
|
||||
else if (line.match(/^:+/)!=null)
|
||||
{
|
||||
// find start line and ending line
|
||||
start = i;
|
||||
while (i < lines.length && lines[i].match(/^:+/)!=null) i++;
|
||||
i--;
|
||||
|
||||
html += wiky.process_indent(lines,start,i);
|
||||
}
|
||||
else if (line.match(/^----+(\s*)$/)!=null)
|
||||
{
|
||||
html += "<hr/>";
|
||||
}
|
||||
else if (line.match(/^(\*+) /)!=null)
|
||||
{
|
||||
// find start line and ending line
|
||||
start = i;
|
||||
while (i < lines.length && lines[i].match(/^(\*+|##+):? /)!=null) i++;
|
||||
i--;
|
||||
|
||||
html += wiky.process_bullet_point(lines,start,i);
|
||||
}
|
||||
else if (line.match(/^(#+) /)!=null)
|
||||
{
|
||||
// find start line and ending line
|
||||
start = i;
|
||||
while (i < lines.length && lines[i].match(/^(#+|\*\*+):? /)!=null) i++;
|
||||
i--;
|
||||
|
||||
html += wiky.process_bullet_point(lines,start,i);
|
||||
}
|
||||
else
|
||||
{
|
||||
html += wiky.process_normal(line);
|
||||
}
|
||||
|
||||
html += "<br/>\n";
|
||||
}
|
||||
|
||||
return html;
|
||||
};
|
||||
|
||||
wiky.process_indent = function(lines,start,end) {
|
||||
var html = "<dl>";
|
||||
|
||||
for(var i=start;i<=end;i++) {
|
||||
|
||||
html += "<dd>";
|
||||
|
||||
var this_count = lines[i].match(/^(:+)/)[1].length;
|
||||
|
||||
html += wiky.process_normal(lines[i].substring(this_count));
|
||||
|
||||
var nested_end = i;
|
||||
for (var j=i+1;j<=end;j++) {
|
||||
var nested_count = lines[j].match(/^(:+)/)[1].length;
|
||||
if (nested_count <= this_count) break;
|
||||
else nested_end = j;
|
||||
}
|
||||
|
||||
if (nested_end > i) {
|
||||
html += wiky.process_indent(lines,i+1,nested_end);
|
||||
i = nested_end;
|
||||
}
|
||||
|
||||
html += "</dd>";
|
||||
}
|
||||
|
||||
html += "</dl>";
|
||||
return html;
|
||||
};
|
||||
|
||||
wiky.process_bullet_point = function(lines,start,end) {
|
||||
var html = (lines[start].charAt(0)=='*')?"<ul>":"<ol>";
|
||||
|
||||
for(var i=start;i<=end;i++) {
|
||||
|
||||
html += "<li>";
|
||||
|
||||
var this_count = lines[i].match(/^(\*+|#+) /)[1].length;
|
||||
|
||||
html += wiky.process_normal(lines[i].substring(this_count+1));
|
||||
|
||||
// continue previous with #:
|
||||
{
|
||||
var nested_end = i;
|
||||
for (var j = i + 1; j <= end; j++) {
|
||||
var nested_count = lines[j].match(/^(\*+|#+):? /)[1].length;
|
||||
|
||||
if (nested_count < this_count)
|
||||
break;
|
||||
else {
|
||||
if (lines[j].charAt(nested_count) == ':') {
|
||||
html += "<br/>" + wiky.process_normal(lines[j].substring(nested_count + 2));
|
||||
nested_end = j;
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
i = nested_end;
|
||||
}
|
||||
|
||||
// nested bullet point
|
||||
{
|
||||
var nested_end = i;
|
||||
for (var j = i + 1; j <= end; j++) {
|
||||
var nested_count = lines[j].match(/^(\*+|#+):? /)[1].length;
|
||||
if (nested_count <= this_count)
|
||||
break;
|
||||
else
|
||||
nested_end = j;
|
||||
}
|
||||
|
||||
if (nested_end > i) {
|
||||
html += wiky.process_bullet_point(lines, i + 1, nested_end);
|
||||
i = nested_end;
|
||||
}
|
||||
}
|
||||
|
||||
// continue previous with #:
|
||||
{
|
||||
var nested_end = i;
|
||||
for (var j = i + 1; j <= end; j++) {
|
||||
var nested_count = lines[j].match(/^(\*+|#+):? /)[1].length;
|
||||
|
||||
if (nested_count < this_count)
|
||||
break;
|
||||
else {
|
||||
if (lines[j].charAt(nested_count) == ':') {
|
||||
html += wiky.process_normal(lines[j].substring(nested_count + 2));
|
||||
nested_end = j;
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
i = nested_end;
|
||||
}
|
||||
|
||||
html += "</li>";
|
||||
}
|
||||
|
||||
html += (lines[start].charAt(0)=='*')?"</ul>":"</ol>";
|
||||
return html;
|
||||
};
|
||||
|
||||
wiky.process_url = function(txt) {
|
||||
|
||||
var index = txt.indexOf(" ");
|
||||
|
||||
if (index == -1)
|
||||
{
|
||||
return "<a target='"+txt+"' href='"+txt+"' style='background: url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAFZJREFUeF59z4EJADEIQ1F36k7u5E7ZKXeUQPACJ3wK7UNokVxVk9kHnQH7bY9hbDyDhNXgjpRLqFlo4M2GgfyJHhjq8V4agfrgPQX3JtJQGbofmCHgA/nAKks+JAjFAAAAAElFTkSuQmCC\") no-repeat scroll right center transparent;padding-right: 13px;'></a>";
|
||||
}
|
||||
else
|
||||
{
|
||||
var url = txt.substring(0,index);
|
||||
var label = txt.substring(index+1);
|
||||
return "<a target='"+url+"' href='"+url+"' style='background: url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAFZJREFUeF59z4EJADEIQ1F36k7u5E7ZKXeUQPACJ3wK7UNokVxVk9kHnQH7bY9hbDyDhNXgjpRLqFlo4M2GgfyJHhjq8V4agfrgPQX3JtJQGbofmCHgA/nAKks+JAjFAAAAAElFTkSuQmCC\") no-repeat scroll right center transparent;padding-right: 13px;'>"+label+"</a>";
|
||||
}
|
||||
};
|
||||
|
||||
wiky.process_image = function(txt) {
|
||||
var index = txt.indexOf(" ");
|
||||
var url = txt;
|
||||
var label = "";
|
||||
|
||||
if (index > -1)
|
||||
{
|
||||
url = txt.substring(0,index);
|
||||
label = txt.substring(index+1);
|
||||
}
|
||||
|
||||
|
||||
return "<img src='"+url+"' alt=\""+label+"\" />";
|
||||
};
|
||||
|
||||
wiky.process_video = function(url) {
|
||||
|
||||
if (url.match(/^(https?:\/\/)?(www.)?youtube.com\//) == null)
|
||||
{
|
||||
return "<b>"+url+" is an invalid YouTube URL</b>";
|
||||
}
|
||||
var result;
|
||||
if ((result = url.match(/^(https?:\/\/)?(www.)?youtube.com\/watch\?(.*)v=([^&]+)/)) != null)
|
||||
{
|
||||
url = "http://www.youtube.com/embed/"+result[4];
|
||||
}
|
||||
|
||||
|
||||
return '<iframe width="480" height="390" src="'+url+'" frameborder="0" allowfullscreen></iframe>';
|
||||
};
|
||||
|
||||
wiky.process_normal = function(wikitext) {
|
||||
|
||||
// Image
|
||||
{
|
||||
var index = wikitext.indexOf("[[File:");
|
||||
var end_index = wikitext.indexOf("]]", index + 7);
|
||||
while (index > -1 && end_index > -1) {
|
||||
|
||||
wikitext = wikitext.substring(0,index)
|
||||
+ wiky.process_image(wikitext.substring(index+7,end_index))
|
||||
+ wikitext.substring(end_index+2);
|
||||
|
||||
index = wikitext.indexOf("[[File:");
|
||||
end_index = wikitext.indexOf("]]", index + 7);
|
||||
}
|
||||
}
|
||||
|
||||
// Video
|
||||
{
|
||||
var index = wikitext.indexOf("[[Video:");
|
||||
var end_index = wikitext.indexOf("]]", index + 8);
|
||||
while (index > -1 && end_index > -1) {
|
||||
|
||||
wikitext = wikitext.substring(0,index)
|
||||
+ wiky.process_video(wikitext.substring(index+8,end_index))
|
||||
+ wikitext.substring(end_index+2);
|
||||
|
||||
index = wikitext.indexOf("[[Video:");
|
||||
end_index = wikitext.indexOf("]]", index + 8);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// URL
|
||||
var protocols = ["http","ftp","news"];
|
||||
|
||||
for (var i=0;i<protocols.length;i++)
|
||||
{
|
||||
var index = wikitext.indexOf("["+protocols[i]+"://");
|
||||
var end_index = wikitext.indexOf("]", index + 1);
|
||||
while (index > -1 && end_index > -1) {
|
||||
|
||||
wikitext = wikitext.substring(0,index)
|
||||
+ wiky.process_url(wikitext.substring(index+1,end_index))
|
||||
+ wikitext.substring(end_index+1);
|
||||
|
||||
index = wikitext.indexOf("["+protocols[i]+"://",end_index+1);
|
||||
end_index = wikitext.indexOf("]", index + 1);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
var count_b = 0;
|
||||
var index = wikitext.indexOf("'''");
|
||||
while(index > -1) {
|
||||
|
||||
if ((count_b%2)==0) wikitext = wikitext.replace(/'''/,"<b>");
|
||||
else wikitext = wikitext.replace(/'''/,"</b>");
|
||||
|
||||
count_b++;
|
||||
|
||||
index = wikitext.indexOf("'''",index);
|
||||
}
|
||||
|
||||
var count_i = 0;
|
||||
var index = wikitext.indexOf("''");
|
||||
while(index > -1) {
|
||||
|
||||
if ((count_i%2)==0) wikitext = wikitext.replace(/''/,"<i>");
|
||||
else wikitext = wikitext.replace(/''/,"</i>");
|
||||
|
||||
count_i++;
|
||||
|
||||
index = wikitext.indexOf("''",index);
|
||||
}
|
||||
|
||||
wikitext = wikitext.replace(/<\/b><\/i>/g,"</i></b>");
|
||||
|
||||
return wikitext;
|
||||
};
|
|
@ -0,0 +1,33 @@
|
|||
# Icelandic translation for openobject-addons
|
||||
# Copyright (c) 2012 Rosetta Contributors and Canonical Ltd 2012
|
||||
# This file is distributed under the same license as the openobject-addons package.
|
||||
# FIRST AUTHOR <EMAIL@ADDRESS>, 2012.
|
||||
#
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: openobject-addons\n"
|
||||
"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
|
||||
"POT-Creation-Date: 2012-02-08 00:36+0000\n"
|
||||
"PO-Revision-Date: 2012-09-19 10:00+0000\n"
|
||||
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
||||
"Language-Team: Icelandic <is@li.org>\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"X-Launchpad-Export-Date: 2012-09-20 04:43+0000\n"
|
||||
"X-Generator: Launchpad (build 15985)\n"
|
||||
|
||||
#. module: google_map
|
||||
#: view:res.partner:0
|
||||
msgid "Map"
|
||||
msgstr "Landakort"
|
||||
|
||||
#. module: google_map
|
||||
#: model:ir.model,name:google_map.model_res_partner_address
|
||||
msgid "Partner Addresses"
|
||||
msgstr "Heimilisfang viðskiptaaðila"
|
||||
|
||||
#. module: google_map
|
||||
#: view:res.partner:0
|
||||
msgid "Street2 : "
|
||||
msgstr "Gata2 : "
|
|
@ -261,7 +261,6 @@ class hr_employee(osv.osv):
|
|||
_defaults = {
|
||||
'active': 1,
|
||||
'image': _get_default_image,
|
||||
'marital': 'single',
|
||||
'color': 0,
|
||||
}
|
||||
|
||||
|
|
|
@ -180,7 +180,7 @@
|
|||
<field name="name">Employees</field>
|
||||
<field name="res_model">hr.employee</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
<field name="view_mode">form,tree</field>
|
||||
<field name="view_id" eval="False"/>
|
||||
<field name="search_view_id" ref="view_employee_filter"/>
|
||||
</record>
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
<field name="name">Payroll</field>
|
||||
<field name="res_model">ir.module.module</field>
|
||||
<field name="view_mode">kanban,tree,form</field>
|
||||
<field name="context" eval="{'search_default_category_id': ref('base.module_category_localization'), 'search_default_name': 'payroll'}"/>
|
||||
<field name="context" eval="{'search_default_category_id': ref('base.module_category_localization')}"/>
|
||||
<field name="search_view_id" ref="base.view_module_filter"/>
|
||||
</record>
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
.oe_employee_vignette {
|
||||
padding: 8px 0;
|
||||
padding: 8px 8px;
|
||||
min-height: 100px;
|
||||
}
|
||||
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
<field name="arch" type="xml">
|
||||
<data>
|
||||
<xpath expr="//div[@name='button_box']" position="inside">
|
||||
<button name="%(act_hr_employee_2_hr_contract)d" string="Contracts" type="action"/>
|
||||
<button name="%(act_hr_employee_2_hr_contract)d" string="Contracts" type="action" groups="base.group_hr_manager"/>
|
||||
</xpath>
|
||||
<xpath expr="//field[@name='coach_id']" position="after">
|
||||
<field name="manager"/>
|
||||
|
|
|
@ -392,12 +392,6 @@ Once the form had been filled, the employee send it to his supervisor.
|
|||
<field name="type">char</field>
|
||||
<field eval="5" name="sequence"/>
|
||||
</record>
|
||||
<record id="survey_answer_98" model="survey.answer">
|
||||
<field name="answer">Title</field>
|
||||
<field name="question_id" ref="survey_question_2"/>
|
||||
<field name="type">char</field>
|
||||
<field eval="6" name="sequence"/>
|
||||
</record>
|
||||
<record id="survey_question_column_heading_4" model="survey.question.column.heading">
|
||||
<field name="in_visible_rating_weight">1</field>
|
||||
<field name="in_visible_menu_choice">1</field>
|
||||
|
|
|
@ -239,7 +239,7 @@
|
|||
<field name="name">Appraisal</field>
|
||||
<field name="res_model">hr_evaluation.evaluation</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">tree,form,graph</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
<field name="search_view_id" ref="hr_evaluation.evaluation_search"/>
|
||||
<field name="context">{"search_default_next_month":1}</field>
|
||||
<field name="help" type="html">
|
||||
|
|
|
@ -39,4 +39,4 @@ access_survey_response_hr_employee,survey.response.employee,survey.model_survey_
|
|||
access_survey_question_column_heading_hr_employee,survey.question.column.heading.employee,survey.model_survey_question_column_heading,base.group_user,1,0,0,0
|
||||
access_survey_response_line_hr_employee,survey.response.line.employee,survey.model_survey_response_line,base.group_user,1,1,1,0
|
||||
access_survey_response_answer_hr_employee,survey.response.answer.hr.employee,survey.model_survey_response_answer,base.group_user,1,1,1,0
|
||||
|
||||
access_survey_tbl_column_heading_hr_employee,survey.tbl.column.heading,survey.model_survey_tbl_column_heading,base.group_user,1,1,1,0
|
||||
|
|
|
|
@ -54,7 +54,6 @@
|
|||
str(ref("survey_question_2")) +"_" +str(ref("survey_answer_20")) + "_multi" :'3',
|
||||
str(ref("survey_question_2")) +"_" +str(ref("survey_answer_25")) + "_multi" :'2011-12-02 16:42:00',
|
||||
str(ref("survey_question_2")) +"_" +str(ref("survey_answer_43")) + "_multi" :'HR',
|
||||
str(ref("survey_question_2")) +"_" +str(ref("survey_answer_98")) + "_multi" :'tpa review'
|
||||
}, context = ctx)
|
||||
-
|
||||
I close this Evaluation survey by giving answer of questions.
|
||||
|
|
|
@ -130,7 +130,7 @@
|
|||
</page>
|
||||
<page string="Other Info">
|
||||
<group>
|
||||
<group string="Accounting Data">
|
||||
<group string="Accounting Data" groups="account.group_account_user">
|
||||
<field name="journal_id" widget="selection" domain="[('type', '=', 'purchase')]"/>
|
||||
<field name="voucher_id" context="{'form_view_ref': 'account_voucher.view_purchase_receipt_form'}"/>
|
||||
</group>
|
||||
|
|
|
@ -92,7 +92,7 @@
|
|||
<header>
|
||||
<button string="Approve" name="validate" states="confirm" type="workflow" groups="base.group_hr_user" class="oe_highlight"/>
|
||||
<button string="Validate" name="second_validate" states="validate1" type="workflow" groups="base.group_hr_user" class="oe_highlight"/>
|
||||
<button string="Refuse" name="refuse" states="confirm,validate1,validate" type="workflow" groups="base.group_hr_user" class="oe_highlight"/>
|
||||
<button string="Refuse" name="refuse" states="confirm,validate1,validate" type="workflow" groups="base.group_hr_user"/>
|
||||
<button string="Reset to New" name="set_to_draft" states="refuse" type="object" groups="base.group_hr_user" />
|
||||
<field name="state" widget="statusbar" statusbar_visible="draft,confirm,validate" statusbar_colors='{"confirm":"blue","validate1":"blue","refuse":"red"}'/>
|
||||
</header>
|
||||
|
@ -137,7 +137,7 @@
|
|||
<header>
|
||||
<button string="Approve" name="validate" states="confirm" type="workflow" groups="base.group_hr_user" class="oe_highlight"/>
|
||||
<button string="Validate" name="second_validate" states="validate1" type="workflow" groups="base.group_hr_user" class="oe_highlight"/>
|
||||
<button string="Refuse" name="refuse" states="confirm,validate,validate1" type="workflow" groups="base.group_hr_user" class="oe_highlight"/>
|
||||
<button string="Refuse" name="refuse" states="confirm,validate,validate1" type="workflow" groups="base.group_hr_user"/>
|
||||
<button string="Reset to New" name="set_to_draft" states="cancel,refuse" type="object" groups="base.group_hr_user" />
|
||||
<field name="state" widget="statusbar" statusbar_visible="draft,confirm,validate" statusbar_colors='{"confirm":"blue","validate1":"blue","refuse":"red"}'/>
|
||||
</header>
|
||||
|
@ -483,6 +483,7 @@
|
|||
<record id="hr_holidays_leaves_assign_tree_view" model="ir.ui.view">
|
||||
<field name="name">hr.employee.leave.tree</field>
|
||||
<field name="model">hr.employee</field>
|
||||
<field name="priority" eval="20"/>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="Assign Leaves" editable="bottom">
|
||||
<field name="name" string="Employee"/>
|
||||
|
@ -522,7 +523,7 @@
|
|||
</group>
|
||||
</xpath>
|
||||
<xpath expr="//div[@name='button_box']" position="inside">
|
||||
<button name="%(act_hr_employee_holiday_request)d" string="Leaves" type="action"/>
|
||||
<button name="%(act_hr_employee_holiday_request)d" string="Leaves" type="action" groups="base.group_hr_user"/>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
|
|
|
@ -669,26 +669,26 @@ class hr_payslip(osv.osv):
|
|||
if not context.get('contract', False):
|
||||
#fill with the first contract of the employee
|
||||
contract_ids = self.get_contract(cr, uid, employee_id, date_from, date_to, context=context)
|
||||
res['value'].update({
|
||||
'struct_id': contract_ids and contract_obj.read(cr, uid, contract_ids[0], ['struct_id'], context=context)['struct_id'][0] or False,
|
||||
'contract_id': contract_ids and contract_ids[0] or False,
|
||||
})
|
||||
else:
|
||||
if contract_id:
|
||||
#set the list of contract for which the input have to be filled
|
||||
contract_ids = [contract_id]
|
||||
#fill the structure with the one on the selected contract
|
||||
contract_record = contract_obj.browse(cr, uid, contract_id, context=context)
|
||||
res['value'].update({
|
||||
'struct_id': contract_record.struct_id.id,
|
||||
'contract_id': contract_id
|
||||
})
|
||||
else:
|
||||
#if we don't give the contract, then the input to fill should be for all current contracts of the employee
|
||||
contract_ids = self.get_contract(cr, uid, employee_id, date_from, date_to, context=context)
|
||||
if not contract_ids:
|
||||
return res
|
||||
|
||||
if not contract_ids:
|
||||
return res
|
||||
contract_record = contract_obj.browse(cr, uid, contract_ids[0], context=context)
|
||||
res['value'].update({
|
||||
'contract_id': contract_record and contract_record.id or False
|
||||
})
|
||||
struct_record = contract_record and contract_record.struct_id or False
|
||||
if not struct_record:
|
||||
return res
|
||||
res['value'].update({
|
||||
'struct_id': struct_record.id,
|
||||
})
|
||||
#computation of the salary input
|
||||
worked_days_line_ids = self.get_worked_day_lines(cr, uid, contract_ids, date_from, date_to, context=context)
|
||||
input_line_ids = self.get_inputs(cr, uid, contract_ids, date_from, date_to, context=context)
|
||||
|
|
|
@ -234,7 +234,7 @@
|
|||
</h2>
|
||||
</div>
|
||||
<group col="4">
|
||||
<field name="contract_id" domain="[('employee_id','=',employee_id)]" on_change="onchange_contract_id(date_from, date_to, employee_id, contract_id)"/>
|
||||
<field name="contract_id" domain="[('employee_id','=',employee_id)]" on_change="onchange_contract_id(date_from, date_to, employee_id, contract_id)" context="{'default_employee_id': employee_id}"/>
|
||||
<field name="number"/>
|
||||
<field name="struct_id" attrs="{'required':[('contract_id','<>',False)]}"/>
|
||||
<field name="name"/>
|
||||
|
@ -369,7 +369,7 @@
|
|||
<field name="view_id" ref="view_hr_payslip_tree"/>
|
||||
<field name="search_view_id" ref="view_hr_payslip_filter"/>
|
||||
</record>
|
||||
<menuitem action="action_view_hr_payslip_form" id="menu_department_tree" parent="menu_hr_root_payroll"/>
|
||||
<menuitem action="action_view_hr_payslip_form" id="menu_department_tree" parent="menu_hr_root_payroll" groups="base.group_hr_user"/>
|
||||
<act_window name="Payslips"
|
||||
context="{'search_default_employee_id': [active_id], 'default_employee_id': active_id}"
|
||||
res_model="hr.payslip"
|
||||
|
@ -386,7 +386,7 @@
|
|||
<field name="arch" type="xml">
|
||||
<data>
|
||||
<xpath expr="//div[@name='button_box']" position="inside">
|
||||
<button name="%(act_hr_employee_payslip_list)d" string="Payslips" type="action"/>
|
||||
<button name="%(act_hr_employee_payslip_list)d" string="Payslips" type="action" groups="base.group_hr_user"/>
|
||||
</xpath>
|
||||
</data>
|
||||
</field>
|
||||
|
|
|
@ -187,7 +187,7 @@
|
|||
</record>
|
||||
|
||||
<menuitem action="act_hr_timesheet_sheet_form" id="menu_act_hr_timesheet_sheet_form" parent="hr_attendance.menu_hr_time_tracking"
|
||||
sequence="2" groups="base.group_hr_user,base.group_hr_manager"/>
|
||||
sequence="2" groups="base.group_hr_user"/>
|
||||
|
||||
<!--
|
||||
Company inheritancy
|
||||
|
@ -350,7 +350,7 @@
|
|||
<field name="inherit_id" ref="hr_timesheet.hr_timesheet_employee_extd_form"/>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//div[@name='button_box']" position="inside">
|
||||
<button name="%(act_hr_employee_2_hr_timesheet)d" string="Timesheets" type="action"/>
|
||||
<button name="%(act_hr_employee_2_hr_timesheet)d" string="Timesheets" type="action" groups="base.group_hr_manager"/>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
|
|
|
@ -444,11 +444,9 @@ class sugar_import(import_framework):
|
|||
import Tasks
|
||||
"""
|
||||
task_state = {
|
||||
'Completed' : 'done',
|
||||
'Completed' : 'open',
|
||||
'Not Started':'draft',
|
||||
'In Progress': 'open',
|
||||
'Pending Input': 'draft',
|
||||
'deferred': 'cancel'
|
||||
}
|
||||
|
||||
def import_task(self, val):
|
||||
|
|
|
@ -19,7 +19,6 @@
|
|||
#
|
||||
##############################################################################
|
||||
|
||||
import company
|
||||
import wizard
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
|
@ -45,8 +45,8 @@ class l10n_be_vat_declaration(osv.osv_memory):
|
|||
'tax_code_id': fields.many2one('account.tax.code', 'Tax Code', domain=[('parent_id', '=', False)], required=True),
|
||||
'msg': fields.text('File created', size=64, readonly=True),
|
||||
'file_save': fields.binary('Save File'),
|
||||
'ask_restitution': fields.boolean('Ask Restitution',help='It indicates whether a restitution is to made or not?'),
|
||||
'ask_payment': fields.boolean('Ask Payment',help='It indicates whether a payment is to made or not?'),
|
||||
'ask_restitution': fields.boolean('Ask Restitution',help='It indicates whether a restitution is to make or not?'),
|
||||
'ask_payment': fields.boolean('Ask Payment',help='It indicates whether a payment is to make or not?'),
|
||||
'client_nihil': fields.boolean('Last Declaration, no clients in client listing', help='Tick this case only if it concerns only the last statement on the civil or cessation of activity: ' \
|
||||
'no clients to be included in the client listing.'),
|
||||
'comments': fields.text('Comments'),
|
||||
|
@ -70,6 +70,7 @@ class l10n_be_vat_declaration(osv.osv_memory):
|
|||
obj_tax_code = self.pool.get('account.tax.code')
|
||||
obj_acc_period = self.pool.get('account.period')
|
||||
obj_user = self.pool.get('res.users')
|
||||
obj_partner = self.pool.get('res.partner')
|
||||
mod_obj = self.pool.get('ir.model.data')
|
||||
|
||||
if context is None:
|
||||
|
@ -83,7 +84,7 @@ class l10n_be_vat_declaration(osv.osv_memory):
|
|||
obj_company = obj_user.browse(cr, uid, uid, context=context).company_id
|
||||
vat_no = obj_company.partner_id.vat
|
||||
if not vat_no:
|
||||
raise osv.except_osv(_('Insufficient Data!'), _('No VAT Number Associated with Main Company.'))
|
||||
raise osv.except_osv(_('insufficient data!'), _('No VAT number associated with your company.'))
|
||||
vat_no = vat_no.replace(' ','').upper()
|
||||
vat = vat_no[2:]
|
||||
|
||||
|
@ -93,8 +94,9 @@ class l10n_be_vat_declaration(osv.osv_memory):
|
|||
ctx['period_id'] = data['period_id'][0]
|
||||
tax_info = obj_tax_code.read(cr, uid, tax_code_ids, ['code','sum_period'], context=ctx)
|
||||
|
||||
name = email = phone = address = post_code = city = country_code = ''
|
||||
name, email, phone, city, post_code, address, country_code = self.pool.get('res.company')._get_default_ad(obj_company.partner_id)
|
||||
default_address = obj_partner.address_get(cr, uid, [obj_company.partner_id.id])
|
||||
default_address_id = default_address.get("default", obj_company.partner_id.id)
|
||||
address_id= obj_partner.browse(cr, uid, default_address_id, context)
|
||||
|
||||
account_period = obj_acc_period.browse(cr, uid, data['period_id'][0], context=context)
|
||||
issued_by = vat_no[:2]
|
||||
|
@ -106,21 +108,21 @@ class l10n_be_vat_declaration(osv.osv_memory):
|
|||
ending_month = account_period.date_stop[5:7]
|
||||
quarter = str(((int(starting_month) - 1) / 3) + 1)
|
||||
|
||||
if not email:
|
||||
if not address_id.email:
|
||||
raise osv.except_osv(_('Insufficient Data!'),_('No email address associated with the company.'))
|
||||
if not phone:
|
||||
if not address_id.phone:
|
||||
raise osv.except_osv(_('Insufficient Data!'),_('No phone associated with the company.'))
|
||||
file_data = {
|
||||
'issued_by': issued_by,
|
||||
'vat_no': vat_no,
|
||||
'only_vat': vat_no[2:],
|
||||
'cmpny_name': obj_company.name,
|
||||
'address': address,
|
||||
'post_code': post_code,
|
||||
'city': city,
|
||||
'country_code': country_code,
|
||||
'email': email,
|
||||
'phone': phone.replace('.','').replace('/','').replace('(','').replace(')','').replace(' ',''),
|
||||
'address': "%s %s"%(address_id.street or "",address_id.street2 or ""),
|
||||
'post_code': address_id.zip or "",
|
||||
'city': address_id.city or "",
|
||||
'country_code': address_id.country_id and address_id.country_id.code or "",
|
||||
'email': address_id.email or "",
|
||||
'phone': address_id.phone.replace('.','').replace('/','').replace('(','').replace(')','').replace(' ',''),
|
||||
'send_ref': send_ref,
|
||||
'quarter': quarter,
|
||||
'month': starting_month,
|
||||
|
|
|
@ -61,7 +61,7 @@ class partner_vat(osv.osv_memory):
|
|||
company_id = self.pool.get('res.users').browse(cr, uid, uid, context=context).company_id.id
|
||||
period_ids = obj_period.search(cr, uid, [('date_start' ,'>=', date_start), ('date_stop','<=',date_stop), ('company_id','=',company_id)])
|
||||
if not period_ids:
|
||||
raise osv.except_osv(_('Insufficient Data!'), _('No data for the selected year.'))
|
||||
raise osv.except_osv(_('insufficient data!'), _('No data for the selected year.'))
|
||||
|
||||
partners = []
|
||||
partner_ids = obj_partner.search(cr, uid, [('vat_subjected', '!=', False), ('vat','ilike','BE%')], context=context)
|
||||
|
@ -87,6 +87,9 @@ class partner_vat(osv.osv_memory):
|
|||
if record['turnover'] >= data['limit_amount']:
|
||||
id_client = obj_vat_lclient.create(cr, uid, record, context=context)
|
||||
partners.append(id_client)
|
||||
|
||||
if not partners:
|
||||
raise osv.except_osv(_('insufficient data!'), _('No data found for the selected year.'))
|
||||
context.update({'partner_ids': partners, 'year': data['year'], 'limit_amount': data['limit_amount']})
|
||||
model_data_ids = obj_model_data.search(cr, uid, [('model','=','ir.ui.view'), ('name','=','view_vat_listing')])
|
||||
resource_id = obj_model_data.read(cr, uid, model_data_ids, fields=['res_id'])[0]['res_id']
|
||||
|
@ -190,7 +193,7 @@ class partner_vat_list(osv.osv_memory):
|
|||
phone = ads.phone.replace(' ','') or ''
|
||||
email = ads.email or ''
|
||||
name = ads.name or ''
|
||||
city = obj_partner.get_city(cr, uid, ads.id)
|
||||
city = ads.city or ''
|
||||
zip = obj_partner.browse(cr, uid, ads.id, context=context).zip or ''
|
||||
if not city:
|
||||
city = ''
|
||||
|
|
|
@ -6,18 +6,18 @@
|
|||
<field name="model">partner.vat</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Partner VAT Listing" version="7.0">
|
||||
<header>
|
||||
<p class="oe_grey">
|
||||
This wizard will create an XML file for VAT details and total invoiced amounts per partner.
|
||||
</p>
|
||||
<group>
|
||||
<field name="year"/>
|
||||
<field name="limit_amount"/>
|
||||
</group>
|
||||
<footer>
|
||||
<button name="get_partner" string="View Customers" type="object" class="oe_highlight" />
|
||||
or
|
||||
<button string="Cancel" class="oe_link" special="cancel" />
|
||||
</header>
|
||||
<group>
|
||||
<label string="This wizard will create an XML file for VAT details and total invoiced amounts per partner." colspan="4"/>
|
||||
</group>
|
||||
<newline/>
|
||||
<field name="year"/>
|
||||
<newline/>
|
||||
<field name="limit_amount"/>
|
||||
</footer>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
|
|
@ -108,7 +108,7 @@ class partner_vat_intra(osv.osv_memory):
|
|||
# Get Company vat
|
||||
company_vat = data_company.partner_id.vat
|
||||
if not company_vat:
|
||||
raise osv.except_osv(_('Insufficient Data!'),_('No VAT number associated with the company.'))
|
||||
raise osv.except_osv(_('insufficient data!'),_('No VAT number associated with your company.'))
|
||||
company_vat = company_vat.replace(' ','').upper()
|
||||
issued_by = company_vat[:2]
|
||||
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
<field name="inherit_id" ref="account.view_partner_property_form" />
|
||||
<field name="arch" type="xml">
|
||||
<data>
|
||||
<xpath expr="//field[@name='bank_ids']/form/field[@name='acc_number']" position="before">
|
||||
<xpath expr="//field[@name='bank_ids']//field[@name='acc_number']" position="before">
|
||||
<newline />
|
||||
<field name="bank_code" />
|
||||
<field name="office" />
|
||||
|
|
|
@ -9,7 +9,8 @@
|
|||
sequence="10"/>
|
||||
|
||||
<!-- Left-side menu: Feeds -->
|
||||
<menuitem id="mail_feeds" name="Feeds" parent="mail_feeds_main" groups="base.group_user" sequence="10"/>
|
||||
<menuitem id="mail_feeds" name="Feeds" parent="mail.mail_feeds_main" groups="base.group_user" sequence="10"/>
|
||||
<menuitem id="mail_my_stuff" name="Organizer" parent="mail.mail_feeds_main"/>
|
||||
|
||||
<record id="mail_wallfeeds" model="ir.ui.menu">
|
||||
<field name="name">My Feeds</field>
|
||||
|
|
|
@ -132,8 +132,6 @@
|
|||
display: none;
|
||||
white-space: normal;
|
||||
padding: 8px;
|
||||
background: #eee;
|
||||
border-top: 1px solid #ccc;
|
||||
}
|
||||
|
||||
.openerp div.oe_mail_thread_action:after {
|
||||
|
@ -201,7 +199,7 @@
|
|||
.openerp .oe_mail_msg_email {
|
||||
padding: 8px;
|
||||
background: white;
|
||||
border-top: 1px solid #ccc;
|
||||
border-top: 1px solid #ebebeb;
|
||||
}
|
||||
|
||||
.openerp div.oe_mail_thread_subthread .oe_mail_msg_comment {
|
||||
|
|
|
@ -181,7 +181,7 @@
|
|||
</record>
|
||||
|
||||
<record id="sale.sale_order_5" model="sale.order">
|
||||
<field name="company_id" ref="res_company_oerp_in"/>
|
||||
<field name="company_id" ref="base.main_company"/>
|
||||
</record>
|
||||
|
||||
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
##############################################################################
|
||||
|
||||
{
|
||||
'name': 'Memos',
|
||||
'name': 'Notes',
|
||||
'version': '1.0',
|
||||
'category': 'Tools',
|
||||
'description': """
|
||||
|
@ -28,12 +28,12 @@ This module allows users to create their own notes inside OpenERP
|
|||
=================================================================
|
||||
|
||||
Use notes to write meeting minutes, organize ideas, organize personnal todo
|
||||
lists, etc. Each user manages his own personnal memos. Notes are available to
|
||||
lists, etc. Each user manages his own personnal Notes. Notes are available to
|
||||
their authors only, but they can share notes to others users so that several
|
||||
people can work on the same note in real time. It's very efficient to share
|
||||
meeting minutes.
|
||||
|
||||
Memos can be found in the 'Home' menu.
|
||||
Notes can be found in the 'Home' menu.
|
||||
""",
|
||||
'author': 'OpenERP SA',
|
||||
'website': 'http://openerp.com',
|
||||
|
|
|
@ -63,11 +63,8 @@ class note_note(osv.osv):
|
|||
def _get_note_first_line(self, cr, uid, ids, name="", args={}, context=None):
|
||||
res = {}
|
||||
for note in self.browse(cr, uid, ids, context=context):
|
||||
text_note = (note.memo or '').strip().split('\n')[0]
|
||||
text_note = re.sub(r'(\S?)(<br[ /]*>|<[/]?p>|<[/]?div>|<table>)[\s\S]*',r'\1',text_note)
|
||||
text_note = re.sub(r'<[^>]+>','',text_note)
|
||||
text_note = html2plaintext(text_note)
|
||||
res[note.id] = text_note
|
||||
res[note.id] = (note.memo and html2plaintext(note.memo) or "").strip().replace('*','').split("\n")[0]
|
||||
|
||||
return res
|
||||
|
||||
#unactivate a sticky note and record the date
|
||||
|
@ -98,7 +95,8 @@ class note_note(osv.osv):
|
|||
def _set_stage_per_user(self, cr, uid, id, name, value, args=None, context=None):
|
||||
note = self.browse(cr, uid, id, context=context)
|
||||
if not value: return False
|
||||
return self.write(cr, uid, [id], {'stage_ids': [(4, value)]}, context=context)
|
||||
stage_ids = [value] + [stage.id for stage in note.stage_ids if stage.user_id.id != uid ]
|
||||
return self.write(cr, uid, [id], {'stage_ids': [(6, 0, stage_ids)]}, context=context)
|
||||
|
||||
def _get_stage_per_user(self, cr, uid, ids, name, args, context=None):
|
||||
result = dict.fromkeys(ids, False)
|
||||
|
@ -187,5 +185,4 @@ class note_base_config_settings(osv.osv_memory):
|
|||
_columns = {
|
||||
'module_note_pad': fields.boolean('Use collaborative pads (etherpad)'),
|
||||
'group_note_fancy': fields.boolean('Use fancy layouts for notes', implied_group='note.group_note_fancy'),
|
||||
'group_note_tags': fields.boolean('Allow setting tags on notes', implied_group='note.group_note_tags'),
|
||||
}
|
||||
|
|
|
@ -4,74 +4,68 @@
|
|||
<record model="note.stage" id="demo_note_stage_01">
|
||||
<field name="name">Today</field>
|
||||
<field name="sequence">1</field>
|
||||
<field name="user_id" eval="ref('base.user_demo')"/>
|
||||
<field name="user_id" ref="base.user_demo"/>
|
||||
</record>
|
||||
|
||||
<record model="note.stage" id="demo_note_stage_02">
|
||||
<field name="name">Tomorrow</field>
|
||||
<field name="sequence">2</field>
|
||||
<field name="user_id" eval="ref('base.user_demo')"/>
|
||||
<field name="user_id" ref="base.user_demo"/>
|
||||
</record>
|
||||
|
||||
<record model="note.stage" id="demo_note_stage_03">
|
||||
<field name="name">Later</field>
|
||||
<field name="sequence">3</field>
|
||||
<field name="user_id" eval="ref('base.user_demo')"/>
|
||||
<field name="user_id" ref="base.user_demo"/>
|
||||
</record>
|
||||
|
||||
<record model="note.stage" id="demo_note_stage_04">
|
||||
<field name="name">Notes</field>
|
||||
<field name="name">Morning</field>
|
||||
<field name="sequence">4</field>
|
||||
<field name="user_id" eval="ref('base.user_demo')"/>
|
||||
<field name="user_id" ref="base.user_root"/>
|
||||
</record>
|
||||
|
||||
|
||||
<record id="note_1" model="note.note">
|
||||
<field name="name">Customer report #349872</field>
|
||||
<field name="memo"><![CDATA[Customer report #349872
|
||||
<field name="memo"><![CDATA[<b>Customer report #349872</b>
|
||||
<br/><br/>* Calendar app in Home
|
||||
<br/>* The base_calendar module should create a menu in Home, like described above.
|
||||
<br/>* This module should become a main application (in the first screen at installation)
|
||||
<br/>* We should use the term Calendar, not Meeting.
|
||||
]]>
|
||||
</field>
|
||||
<field name="stage_id" ref="note_stage_01"/>
|
||||
<field name="stage_id" ref="demo_note_stage_01"/>
|
||||
<field name="color">2</field>
|
||||
<field name="message_follower_ids" eval="[(4, ref('base.group_user'))]"/>
|
||||
</record>
|
||||
|
||||
<record id="note_2" model="note.note">
|
||||
<field name="memo"><![CDATA[Call Fabien
|
||||
<field name="memo"><![CDATA[<b>Call Fabien</b>
|
||||
<br/><br/>* Followed by the telephone conversation and mail about D.544.3
|
||||
]]>
|
||||
</field>
|
||||
<field name="stage_id" ref="note_stage_01"/>
|
||||
</record>
|
||||
|
||||
<record id="note_3" model="note.note">
|
||||
<field name="memo"><![CDATA[Call Marc
|
||||
<br/><br/>]]>
|
||||
</field>
|
||||
<field name="stage_id" ref="note_stage_01"/>
|
||||
<field name="stage_id" ref="demo_note_stage_01"/>
|
||||
</record>
|
||||
|
||||
<record id="note_4" model="note.note">
|
||||
<field name="memo"><![CDATA[Project N.947.5
|
||||
<field name="memo"><![CDATA[<b>Project N.947.5</b>
|
||||
<br/><br/>]]>
|
||||
</field>
|
||||
<field name="stage_id" ref="note_stage_02"/>
|
||||
</record>
|
||||
|
||||
<record id="note_5" model="note.note">
|
||||
<field name="memo"><![CDATA[Shop for family dinner
|
||||
<field name="memo"><![CDATA[<b>Shop for family dinner</b>
|
||||
<br/>* stuffed turkey
|
||||
<br/>* wine
|
||||
]]>
|
||||
</field>
|
||||
<field name="stage_id" ref="note_stage_02"/>
|
||||
<field name="stage_id" ref="demo_note_stage_02"/>
|
||||
<field name="message_follower_ids" eval="[(4, ref('base.group_user'))]"/>
|
||||
</record>
|
||||
|
||||
<record id="note_6" model="note.note">
|
||||
<field name="memo"><![CDATA[Idea to develop
|
||||
<field name="memo"><![CDATA[<b>Idea to develop</b>
|
||||
<br/><br/>* Create a module note_pad
|
||||
it transforms the html editable memo text field into widget='pad', similar to project_pad depends on 'memo' and 'pad' modules
|
||||
]]>
|
||||
|
@ -79,17 +73,8 @@
|
|||
<field name="stage_id" ref="note_stage_02"/>
|
||||
</record>
|
||||
|
||||
<record id="note_7" model="note.note">
|
||||
<field name="memo"><![CDATA[Read some documentation about OpenERP before diving into the code
|
||||
<br/><br/>* Open ERP: a modern approach to integrated business management
|
||||
<br/>* Open ERP for Retail and Industrial Management
|
||||
]]>
|
||||
</field>
|
||||
<field name="stage_id" ref="note_stage_03"/>
|
||||
</record>
|
||||
|
||||
<record id="note_8" model="note.note">
|
||||
<field name="memo"><![CDATA[New computer specs
|
||||
<field name="memo"><![CDATA[<b>New computer specs</b>
|
||||
<br/><br/>* Motherboard
|
||||
according to processor
|
||||
<br/>* Processor
|
||||
|
@ -108,34 +93,27 @@
|
|||
</field>
|
||||
<field name="stage_id" ref="note_stage_03"/>
|
||||
<field name="color">3</field>
|
||||
<field name="message_follower_ids" eval="[(4, ref('base.group_user'))]"/>
|
||||
</record>
|
||||
|
||||
<record id="note_9" model="note.note">
|
||||
<field name="memo"><![CDATA[Read those books
|
||||
<field name="memo"><![CDATA[<b>Read those books</b>
|
||||
<br/><br/>* Open ERP: a modern approach to integrated business management
|
||||
<br/>* Open ERP for Retail and Industrial Management
|
||||
]]>
|
||||
</field>
|
||||
<field name="stage_id" ref="note_stage_02"/>
|
||||
</record>
|
||||
|
||||
<record id="note_10" model="note.note">
|
||||
<field name="memo"><![CDATA[Read some documentation about OpenERP before diving into the code
|
||||
<br/><br/>* Open ERP: a modern approach to integrated business management
|
||||
<br/>* Open ERP for Retail and Industrial Management
|
||||
]]>
|
||||
</field>
|
||||
<field name="stage_id" ref="note_stage_03"/>
|
||||
<field name="stage_id" ref="demo_note_stage_02"/>
|
||||
</record>
|
||||
|
||||
<record id="note_12" model="note.note">
|
||||
<field name="memo"><![CDATA[Read some documentation about OpenERP before diving into the code
|
||||
<field name="memo"><![CDATA[<b>Read some documentation about OpenERP before diving into the code</b>
|
||||
<br/><br/>* Open ERP: a modern approach to integrated business management
|
||||
<br/>* Open ERP for Retail and Industrial Management
|
||||
]]>
|
||||
</field>
|
||||
<field name="stage_id" ref="note_stage_03"/>
|
||||
<field name="message_follower_ids" eval="[(4, ref('base.group_user'))]"/>
|
||||
<field name="color">7</field>
|
||||
<field name="stage_ids" eval="['note_stage_03','demo_note_stage_04']"/>
|
||||
</record>
|
||||
|
||||
</data>
|
||||
|
|
|
@ -1,8 +1,6 @@
|
|||
<?xml version="1.0"?>
|
||||
<openerp>
|
||||
<data>
|
||||
<menuitem name="Organizer" id="note_my_stuff" parent="mail.mail_feeds_main"/>
|
||||
|
||||
<!-- note Stage Form View -->
|
||||
<record model="ir.ui.view" id="view_note_stage_form">
|
||||
<field name="name">note.stage.form</field>
|
||||
|
@ -38,8 +36,6 @@
|
|||
<field name="domain">[('user_id','=',uid)]</field>
|
||||
</record>
|
||||
|
||||
<menuitem name="Categories" id="menu_notes_stage" parent="note_my_stuff" action="action_note_stage" sequence="40" groups="base.group_no_one"/>
|
||||
|
||||
<!-- New note Kanban View -->
|
||||
<record model="ir.ui.view" id="view_note_note_kanban">
|
||||
<field name="name">note.note.kanban</field>
|
||||
|
@ -65,7 +61,7 @@
|
|||
<div class="oe_dropdown_kanban">
|
||||
<span>
|
||||
<a name="onclick_note_is_done" type="object" t-if="record.open.raw_value" class="oe_e">W</a>
|
||||
<a name="onclick_note_not_done" type="object" t-if="!record.open.raw_value" class="oe_e">è</a>
|
||||
<a name="onclick_note_not_done" type="object" t-if="!record.open.raw_value" class="oe_e">W</a>
|
||||
</span>
|
||||
|
||||
<!-- dropdown menu -->
|
||||
|
@ -105,7 +101,7 @@
|
|||
<field name="name"/>
|
||||
<field name="open"/>
|
||||
<field name="stage_id"/>
|
||||
<field name="tag_ids" widget="many2many_tags" groups="note.group_note_tags"/>
|
||||
<field name="tag_ids" widget="many2many_tags"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
|
@ -117,12 +113,10 @@
|
|||
<field name="arch" type="xml">
|
||||
<form string="Note" version="7.0">
|
||||
<header>
|
||||
<field name="tag_ids" widget="many2many_tags" class="oe_inline" placeholder="Tags"/>
|
||||
<field name="stage_id" domain="[('user_id','=',uid)]" widget="statusbar" clickable="1"/>
|
||||
</header>
|
||||
<field name="memo" widget="html"/><!-- editor_width="100%%" editor_height="60%%" -->
|
||||
<group groups="note.group_note_tags" col="2">
|
||||
<field name="tag_ids" widget="many2many_tags"/>
|
||||
</group>
|
||||
<field name="message_follower_ids" widget="mail_followers"/>
|
||||
<field class="oe_chatter" name="message_ids" widget="mail_thread"/>
|
||||
</form>
|
||||
|
@ -136,7 +130,7 @@
|
|||
<field name="arch" type="xml">
|
||||
<search string="Notes">
|
||||
<field name="memo" string="Note"/>
|
||||
<field name="tag_ids" groups="note.group_note_tags"/>
|
||||
<field name="tag_ids"/>
|
||||
<filter name="open_true" string="Active" domain="['|',('open', '=', True),('date_done','=',time.strftime('%%Y-%%m-%%d'))]"/>
|
||||
<filter name="open_false" string="Archive" domain="[('open', '=', False)]"/>
|
||||
<group expand="0" string="Group By...">
|
||||
|
@ -165,10 +159,6 @@
|
|||
<field name="group_note_fancy" class="oe_inline"/>
|
||||
<label for="group_note_fancy"/>
|
||||
</div>
|
||||
<div>
|
||||
<field name="group_note_tags" class="oe_inline"/>
|
||||
<label for="group_note_tags"/>
|
||||
</div>
|
||||
</div>
|
||||
</group>
|
||||
</xpath>
|
||||
|
@ -185,7 +175,8 @@
|
|||
<field name="context">{'search_default_open_true':True}</field>
|
||||
</record>
|
||||
|
||||
<menuitem name="Notes" id="note_notes" parent="note_my_stuff" sequence="20" action="action_note_note"/>
|
||||
<menuitem name="Notes" id="menu_note_notes" parent="mail.mail_my_stuff" sequence="20" action="note.action_note_note"/>
|
||||
<menuitem name="Categories" id="menu_notes_stage" parent="mail.mail_my_stuff" action="note.action_note_stage" sequence="21" groups="base.group_no_one"/>
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
|
|
|
@ -1,3 +1,2 @@
|
|||
id,name,implied_ids/id
|
||||
group_note_tags,Memo / Display tags,
|
||||
group_note_fancy,Memo / Fancy mode,
|
||||
|
|
|
|
@ -1,3 +0,0 @@
|
|||
memo.css: memo.sass
|
||||
sass -t expanded memo.sass memo.css
|
||||
|
|
@ -1,93 +1,53 @@
|
|||
@charset "utf-8";
|
||||
@font-face {
|
||||
font-family: "mnmliconsRegular";
|
||||
src: url("/web/static/src/font/mnmliconsv21-webfont.eot") format("eot");
|
||||
src: url("/web/static/src/font/mnmliconsv21-webfont.woff") format("woff");
|
||||
src: url("/web/static/src/font/mnmliconsv21-webfont.ttf") format("truetype");
|
||||
src: url("/web/static/src/font/mnmliconsv21-webfont.svg") format("svg") active;
|
||||
font-weight: normal;
|
||||
font-style: normal;
|
||||
}
|
||||
|
||||
@font-face {
|
||||
font-family: "EntypoRegular";
|
||||
src: url("/web/static/src/font/entypo-webfont.eot") format("eot");
|
||||
src: url("/web/static/src/font/entypo-webfont.eot?#iefix") format("embedded-opentype");
|
||||
src: url("/web/static/src/font/entypo-webfont.woff") format("woff");
|
||||
src: url("/web/static/src/font/entypo-webfont.ttf") format("truetype");
|
||||
src: url("/web/static/src/font/entypo-webfont.svg") format("svg") active;
|
||||
font-weight: normal;
|
||||
font-style: normal;
|
||||
}
|
||||
|
||||
@-moz-keyframes bounce {
|
||||
0% {
|
||||
-moz-transform: scale(0);
|
||||
opacity: 0;
|
||||
}
|
||||
|
||||
50% {
|
||||
-moz-transform: scale(1.3);
|
||||
opacity: 0.4;
|
||||
}
|
||||
|
||||
75% {
|
||||
-moz-transform: scale(0.9);
|
||||
opacity: 0.7;
|
||||
}
|
||||
|
||||
100% {
|
||||
-moz-transform: scale(1);
|
||||
opacity: 1;
|
||||
}
|
||||
}
|
||||
|
||||
@-webkit-keyframes bounce {
|
||||
0% {
|
||||
-webkit-transform: scale(0);
|
||||
opacity: 0;
|
||||
}
|
||||
|
||||
50% {
|
||||
-webkit-transform: scale(1.3);
|
||||
opacity: 0.4;
|
||||
}
|
||||
|
||||
75% {
|
||||
-webkit-transform: scale(0.9);
|
||||
opacity: 0.7;
|
||||
}
|
||||
|
||||
100% {
|
||||
-webkit-transform: scale(1);
|
||||
opacity: 1;
|
||||
}
|
||||
}
|
||||
|
||||
.oe_kanban_color_2 {
|
||||
background-color: red;
|
||||
}
|
||||
|
||||
.oe_kanban_column .note_text_line_through {
|
||||
text-decoration: line-through;
|
||||
}
|
||||
|
||||
.openerp .oe_fold_column .oe_kanban_card_fancy {
|
||||
text-decoration: none;
|
||||
color: black;
|
||||
display: block;
|
||||
padding: 1em;
|
||||
margin-right: 1em;
|
||||
margin-bottom: 1em;
|
||||
-moz-box-shadow: 5px 5px 7px #212121;
|
||||
-webkit-box-shadow: 5px 5px 7px rgba(33, 33, 33, 0.7);
|
||||
box-shadow: 5px 5px 7px rgba(33, 33, 33, 0.7);
|
||||
.openerp .oe_kanban_view.oe_notes .oe_kanban_card_fancy.oe_kanban_color_0 {
|
||||
box-shadow: 0px 4px 9px rgba(48, 48, 48, 0.15);
|
||||
}
|
||||
.openerp .oe_kanban_view.oe_notes .oe_kanban_card_fancy.oe_kanban_color_1 {
|
||||
box-shadow: 0px 4px 9px rgba(0, 0, 0, 0.15);
|
||||
}
|
||||
.openerp .oe_kanban_view.oe_notes .oe_kanban_card_fancy.oe_kanban_color_2 {
|
||||
box-shadow: 0px 4px 9px rgba(48, 0, 0, 0.15);
|
||||
}
|
||||
.openerp .oe_kanban_view.oe_notes .oe_kanban_card_fancy.oe_kanban_color_3 {
|
||||
box-shadow: 0px 4px 9px rgba(97, 93, 0, 0.16);
|
||||
}
|
||||
.openerp .oe_kanban_view.oe_notes .oe_kanban_card_fancy.oe_kanban_color_4 {
|
||||
box-shadow: 0px 4px 9px rgba(77, 128, 0, 0.17);
|
||||
}
|
||||
.openerp .oe_kanban_view.oe_notes .oe_kanban_card_fancy.oe_kanban_color_5 {
|
||||
box-shadow: 0px 4px 9px rgba(0, 88, 11, 0.15);
|
||||
}
|
||||
.openerp .oe_kanban_view.oe_notes .oe_kanban_card_fancy.oe_kanban_color_6 {
|
||||
box-shadow: 0px 4px 9px rgba(0, 80, 95, 0.15);
|
||||
}
|
||||
.openerp .oe_kanban_view.oe_notes .oe_kanban_card_fancy.oe_kanban_color_7 {
|
||||
box-shadow: 0px 4px 9px rgba(3, 13, 133, 0.18);
|
||||
}
|
||||
.openerp .oe_kanban_view.oe_notes .oe_kanban_card_fancy.oe_kanban_color_8 {
|
||||
box-shadow: 0px 4px 9px rgba(56, 0, 128, 0.15);
|
||||
}
|
||||
.openerp .oe_kanban_view.oe_notes .oe_kanban_card_fancy.oe_kanban_color_9 {
|
||||
box-shadow: 0px 4px 9px rgba(102, 0, 116, 0.15);
|
||||
}
|
||||
|
||||
.openerp .oe_kanban_record .oe_kanban_card_fancy {
|
||||
text-shadow: none;
|
||||
border-radius: 2px;
|
||||
padding: 12px;
|
||||
margin-left: 3px;
|
||||
margin-right: 3px;
|
||||
padding-bottom: 16px;
|
||||
margin-bottom: 16px;
|
||||
-webkit-transform: rotate(-2deg);
|
||||
-o-transform: rotate(-2deg);
|
||||
-moz-transform: rotate(-2deg);
|
||||
-webkit-transition: all 300ms cubic-bezier(0.5, 0, 0.5, 1);
|
||||
-moz-transition: all 300ms cubic-bezier(0.5, 0, 0.5, 1);
|
||||
-ms-transition: all 300ms cubic-bezier(0.5, 0, 0.5, 1);
|
||||
transition: all 300ms cubic-bezier(0.5, 0, 0.5, 1);
|
||||
}
|
||||
.openerp .oe_kanban_record:nth-of-type(even) .oe_kanban_card_fancy {
|
||||
-webkit-transform: rotate(1deg);
|
||||
|
@ -132,12 +92,14 @@
|
|||
|
||||
.openerp .oe_kanban_column .oe_fold_column .oe_kanban_card_fancy:hover,
|
||||
.openerp .oe_kanban_column .oe_fold_column .oe_kanban_card_fancy:focus {
|
||||
box-shadow: 10px 10px 7px rgba(0, 0, 0, 0.7);
|
||||
-moz-box-shadow: 10px 10px 7px rgba(0, 0, 0, 0.7);
|
||||
-webkit-box-shadow: 10px 10px 7px rgba(0, 0, 0, 0.7);
|
||||
position: relative;
|
||||
z-index: 5;
|
||||
-webkit-transform: rotate(0);
|
||||
-o-transform: rotate(0);
|
||||
-moz-transform: rotate(0);
|
||||
border-color: rgba(0, 0, 0, 0.4);
|
||||
-webkit-transition: all 150ms cubic-bezier(0.5, 0, 0.5, 1);
|
||||
-moz-transition: all 150ms cubic-bezier(0.5, 0, 0.5, 1);
|
||||
-ms-transition: all 150ms cubic-bezier(0.5, 0, 0.5, 1);
|
||||
transition: all 150ms cubic-bezier(0.5, 0, 0.5, 1);
|
||||
-webkit-transform: rotate(0) !important;
|
||||
-o-transform: rotate(0) !important;
|
||||
-moz-transform: rotate(0) !important;
|
||||
}
|
||||
|
|
|
@ -1,168 +1,54 @@
|
|||
@charset "utf-8"
|
||||
|
||||
// Variables {{{
|
||||
$section-title-color: #8786b7
|
||||
$tag-bg-light: #f0f0fa
|
||||
$tag-bg-dark: #8786b7
|
||||
$tag-border: #afafb6
|
||||
$tag-border-selected: #a6a6fe
|
||||
$hover-background: #f0f0fa
|
||||
$link-color: #8a89ba
|
||||
$sheet-max-width: 860px
|
||||
// }}}
|
||||
// Mixins {{{
|
||||
@font-face
|
||||
font-family: 'mnmliconsRegular'
|
||||
src: url('/web/static/src/font/mnmliconsv21-webfont.eot') format('eot')
|
||||
src: url('/web/static/src/font/mnmliconsv21-webfont.woff') format('woff')
|
||||
src: url('/web/static/src/font/mnmliconsv21-webfont.ttf') format('truetype')
|
||||
src: url('/web/static/src/font/mnmliconsv21-webfont.svg') format('svg') active
|
||||
font-weight: normal
|
||||
font-style: normal
|
||||
|
||||
@font-face
|
||||
font-family: 'EntypoRegular'
|
||||
src: url('/web/static/src/font/entypo-webfont.eot') format('eot')
|
||||
src: url('/web/static/src/font/entypo-webfont.eot?#iefix') format('embedded-opentype')
|
||||
src: url('/web/static/src/font/entypo-webfont.woff') format('woff')
|
||||
src: url('/web/static/src/font/entypo-webfont.ttf') format('truetype')
|
||||
src: url('/web/static/src/font/entypo-webfont.svg') format('svg') active
|
||||
font-weight: normal
|
||||
font-style: normal
|
||||
|
||||
@mixin reset()
|
||||
border: none
|
||||
padding: 0
|
||||
margin: 0
|
||||
background: none
|
||||
@include radius(none)
|
||||
@include box-shadow(none)
|
||||
|
||||
@mixin vertical-gradient($startColor: #555, $endColor: #333)
|
||||
background-color: $startColor
|
||||
background-image: -webkit-gradient(linear, left top, left bottom, from($startColor), to($endColor)) /* Saf4+, Chrome */
|
||||
background-image: -webkit-linear-gradient(top, $startColor, $endColor) /* Chrome 10+, Saf5.1+, iOS 5+ */
|
||||
background-image: -moz-linear-gradient(top, $startColor, $endColor) /* FF3.6 */
|
||||
background-image: -ms-linear-gradient(top, $startColor, $endColor) /* IE10 */
|
||||
background-image: -o-linear-gradient(top, $startColor, $endColor) /* Opera 11.10+ */
|
||||
background-image: linear-gradient(to bottom, $startColor, $endColor)
|
||||
|
||||
@mixin radial-gradient($gradient)
|
||||
background-position: center center
|
||||
background-image: -webkit-radial-gradient(circle, $gradient)
|
||||
background-image: -moz-radial-gradient($gradient)
|
||||
background-image: -ms-radial-gradient($gradient)
|
||||
background-image: radial-gradient($gradient)
|
||||
|
||||
@mixin radius($radius: 5px)
|
||||
-moz-border-radius: $radius
|
||||
-webkit-border-radius: $radius
|
||||
border-radius: $radius
|
||||
|
||||
@mixin box-shadow($bsval: 0px 1px 4px #777)
|
||||
-moz-box-shadow: $bsval
|
||||
-webkit-box-shadow: $bsval
|
||||
box-shadow: $bsval
|
||||
|
||||
@mixin transition($transval: (border linear 0.2s, box-shadow linear 0.2s))
|
||||
-webkit-transition: $transval
|
||||
-moz-transition: $transval
|
||||
-ms-transition: $transval
|
||||
-o-transition: $transval
|
||||
transition: $transval
|
||||
|
||||
@mixin opacity($opacity: .5)
|
||||
filter: alpha(opacity=$opacity * 100)
|
||||
opacity: $opacity
|
||||
|
||||
@mixin background-clip($clip: padding-box)
|
||||
-webkit-background-clip: $clip
|
||||
-moz-background-clip: $clip
|
||||
background-clip: $clip
|
||||
|
||||
@mixin box-sizing($type: content)
|
||||
// type = border || content || padding
|
||||
-webkit-box-sizing: #{$type}-box
|
||||
-moz-box-sizing: #{$type}-box
|
||||
-ms-box-sizing: #{$type}-box
|
||||
box-sizing: #{$type}-box
|
||||
|
||||
// Transforms the (readable) text of an inline element into an mmlicons icon,
|
||||
// allows for actual readable text in-code (and in readers?) with iconic looks
|
||||
@mixin text-to-icon($icon-name, $color: #404040)
|
||||
font-size: 1px
|
||||
letter-spacing: -1px
|
||||
color: transparent
|
||||
&: before
|
||||
font: 21px "mnmliconsRegular"
|
||||
content: $icon-name
|
||||
color: $color
|
||||
|
||||
// }}}
|
||||
// CSS animation bounces {{{
|
||||
@-moz-keyframes bounce
|
||||
0%
|
||||
-moz-transform: scale(0)
|
||||
opacity: 0
|
||||
50%
|
||||
-moz-transform: scale(1.3)
|
||||
opacity: 0.4
|
||||
75%
|
||||
-moz-transform: scale(0.9)
|
||||
opacity: 0.7
|
||||
100%
|
||||
-moz-transform: scale(1)
|
||||
opacity: 1
|
||||
|
||||
@-webkit-keyframes bounce
|
||||
0%
|
||||
-webkit-transform: scale(0)
|
||||
opacity: 0
|
||||
50%
|
||||
-webkit-transform: scale(1.3)
|
||||
opacity: 0.4
|
||||
75%
|
||||
-webkit-transform: scale(0.9)
|
||||
opacity: 0.7
|
||||
100%
|
||||
-webkit-transform: scale(1)
|
||||
opacity: 1
|
||||
// }}}
|
||||
|
||||
|
||||
.oe_kanban_color_2
|
||||
background-color: red
|
||||
|
||||
// au BufWritePost,FileWritePost *.sass : !sass --style expanded --line-numbers <afile> > "%: p: r.css"
|
||||
|
||||
.oe_kanban_column
|
||||
.note_text_line_through
|
||||
text-decoration: line-through
|
||||
|
||||
|
||||
.openerp
|
||||
.oe_fold_column
|
||||
.oe_kanban_card_fancy
|
||||
text-decoration: none
|
||||
color: #000
|
||||
display: block
|
||||
padding: 1em
|
||||
margin-right: 1em
|
||||
margin-bottom: 1em
|
||||
-moz-box-shadow: 5px 5px 7px rgba(33,33,33,1)
|
||||
-webkit-box-shadow: 5px 5px 7px rgba(33,33,33,.7)
|
||||
box-shadow: 5px 5px 7px rgba(33,33,33,.7)
|
||||
|
||||
|
||||
@mixin rotate($a)
|
||||
-webkit-transform: rotate($a)
|
||||
-o-transform: rotate($a)
|
||||
-webkit-transform: rotate($a)
|
||||
-o-transform: rotate($a)
|
||||
-moz-transform: rotate($a)
|
||||
|
||||
@mixin transition($what:all,$duration:100ms)
|
||||
-webkit-transition: $what $duration cubic-bezier(0.5,0,0.5,1)
|
||||
-moz-transition: $what $duration cubic-bezier(0.5,0,0.5,1)
|
||||
-ms-transition: $what $duration cubic-bezier(0.5,0,0.5,1)
|
||||
transition: $what $duration cubic-bezier(0.5,0,0.5,1)
|
||||
|
||||
|
||||
.openerp
|
||||
.oe_kanban_view.oe_notes
|
||||
.oe_kanban_card_fancy.oe_kanban_color_0
|
||||
box-shadow: 0px 4px 9px rgba(48,48,48,0.15)
|
||||
.oe_kanban_card_fancy.oe_kanban_color_1
|
||||
box-shadow: 0px 4px 9px rgba(0,0,0,0.15)
|
||||
.oe_kanban_card_fancy.oe_kanban_color_2
|
||||
box-shadow: 0px 4px 9px rgba(48,0,0,0.15)
|
||||
.oe_kanban_card_fancy.oe_kanban_color_3
|
||||
box-shadow: 0px 4px 9px rgba(97,93,0,0.16)
|
||||
.oe_kanban_card_fancy.oe_kanban_color_4
|
||||
box-shadow: 0px 4px 9px rgba(77,128,0,0.17)
|
||||
.oe_kanban_card_fancy.oe_kanban_color_5
|
||||
box-shadow: 0px 4px 9px rgba(0,88,11,0.15)
|
||||
.oe_kanban_card_fancy.oe_kanban_color_6
|
||||
box-shadow: 0px 4px 9px rgba(0,80,95,0.15)
|
||||
.oe_kanban_card_fancy.oe_kanban_color_7
|
||||
box-shadow: 0px 4px 9px rgba(3,13,133,0.18)
|
||||
.oe_kanban_card_fancy.oe_kanban_color_8
|
||||
box-shadow: 0px 4px 9px rgba(56,0,128,0.15)
|
||||
.oe_kanban_card_fancy.oe_kanban_color_9
|
||||
box-shadow: 0px 4px 9px rgba(102,0,116,0.15)
|
||||
.oe_kanban_record
|
||||
.oe_kanban_card_fancy
|
||||
text-shadow: none
|
||||
border-radius: 2px
|
||||
padding: 12px
|
||||
margin-left: 3px
|
||||
margin-right: 3px
|
||||
padding-bottom: 16px
|
||||
margin-bottom: 16px
|
||||
@include rotate(-2deg)
|
||||
@include transition($what:all, $duration:300ms)
|
||||
.oe_kanban_record:nth-of-type(even)
|
||||
.oe_kanban_card_fancy
|
||||
@include rotate(1deg)
|
||||
|
@ -193,17 +79,16 @@ $sheet-max-width: 860px
|
|||
@include rotate(-1deg)
|
||||
|
||||
|
||||
@mixin oe_kanban_card_fancy
|
||||
box-shadow: 10px 10px 7px rgba(0,0,0,.7)
|
||||
-moz-box-shadow: 10px 10px 7px rgba(0,0,0,.7)
|
||||
-webkit-box-shadow: 10px 10px 7px rgba(0,0,0,.7)
|
||||
position: relative
|
||||
z-index: 5
|
||||
@include rotate(0)
|
||||
|
||||
.openerp
|
||||
.oe_kanban_column
|
||||
.oe_fold_column
|
||||
.oe_kanban_card_fancy:hover,
|
||||
.oe_kanban_card_fancy:focus
|
||||
@include oe_kanban_card_fancy
|
||||
position: relative
|
||||
z-index: 5
|
||||
border-color: rgba(0,0,0,0.4)
|
||||
@include transition($what:all, $duration:150ms)
|
||||
-webkit-transform: rotate(0) !important
|
||||
-o-transform: rotate(0) !important
|
||||
-moz-transform: rotate(0) !important
|
||||
|
||||
|
|
|
@ -31,11 +31,5 @@ class note_pad_note(osv.osv):
|
|||
_pad_fields = ['note_pad']
|
||||
|
||||
_columns = {
|
||||
'note_pad_url': fields.char('Pad Url',
|
||||
pad_content_field='memo',
|
||||
size=250 ),
|
||||
}
|
||||
|
||||
#_defaults = {
|
||||
# 'note_pad_url': lambda self, cr, uid, context: self.pad_generate_url(cr, uid, context),
|
||||
#}
|
||||
'note_pad_url': fields.char('Pad Url', pad_content_field='memo'),
|
||||
}
|
|
@ -5,24 +5,56 @@ import re
|
|||
import string
|
||||
import urllib2
|
||||
from tools.translate import _
|
||||
from openerp.tools.misc import html2plaintext
|
||||
from py_etherpad import EtherpadLiteClient
|
||||
|
||||
class pad_common(osv.osv_memory):
|
||||
_name = 'pad.common'
|
||||
|
||||
def pad_generate_url(self, cr, uid, context=None):
|
||||
pad_server = self.pool.get('res.users').browse(cr, uid, uid, context).company_id.pad_server
|
||||
company = self.pool.get('res.users').browse(cr, uid, uid, context=context).company_id;
|
||||
|
||||
pad = {
|
||||
"server" : company.pad_server,
|
||||
"key" : company.pad_key or "4DxmsNIbnQUVQMW9S9tx2oLOSjFdrx1l",
|
||||
}
|
||||
|
||||
# make sure pad server in the form of http://hostname
|
||||
if not pad_server:
|
||||
if not pad["server"]:
|
||||
return ''
|
||||
if not pad_server.startswith('http'):
|
||||
pad_server = 'http://' + pad_server
|
||||
pad_server = pad_server.rstrip('/')
|
||||
if not pad["server"].startswith('http'):
|
||||
pad["server"] = 'http://' + pad["server"]
|
||||
pad["server"] = pad["server"].rstrip('/')
|
||||
# generate a salt
|
||||
s = string.ascii_uppercase + string.digits
|
||||
salt = ''.join([s[random.randint(0, len(s) - 1)] for i in range(10)])
|
||||
#path
|
||||
path = '%s-%s-%s' % (cr.dbname.replace('_','-'), self._name, salt)
|
||||
# contruct the url
|
||||
url = '%s/p/%s-%s-%s' % (pad_server, cr.dbname, self._name, salt)
|
||||
return url
|
||||
url = '%s/p/%s' % (pad["server"], path)
|
||||
|
||||
#if create with content
|
||||
if "field_name" in context and "model" in context and "object_id" in context:
|
||||
myPad = EtherpadLiteClient( pad["key"], pad["server"]+'/api')
|
||||
myPad.createPad(path)
|
||||
|
||||
#get attr on the field model
|
||||
model = self.pool.get(context["model"])
|
||||
field = model._all_columns[context['field_name']]
|
||||
real_field = field.column.pad_content_field
|
||||
|
||||
#get content of the real field
|
||||
for record in model.browse(cr, uid, [context["object_id"]]):
|
||||
if record[real_field]:
|
||||
myPad.setText(path, html2plaintext(record[real_field]))
|
||||
#Etherpad for html not functional
|
||||
#myPad.setHTML(path, record[real_field])
|
||||
|
||||
return {
|
||||
"server": pad["server"],
|
||||
"path": path,
|
||||
"url": url,
|
||||
}
|
||||
|
||||
def pad_get_content(self, cr, uid, url, context=None):
|
||||
content = ''
|
||||
|
@ -35,22 +67,21 @@ class pad_common(osv.osv_memory):
|
|||
|
||||
# TODO
|
||||
# reverse engineer protocol to be setHtml without using the api key
|
||||
# override read and copy to generate url and store the content if empty
|
||||
|
||||
def default_get(self, cr, uid, fields, context=None):
|
||||
data = super(pad_common, self).default_get(cr, uid, fields, context)
|
||||
for k in fields:
|
||||
field = self._all_columns[k].column
|
||||
if hasattr(field,'pad_content_field'):
|
||||
data[k] = self.pad_generate_url(cr, uid, context=context)
|
||||
return data
|
||||
|
||||
def write(self, cr, uid, ids, vals, context=None):
|
||||
self._set_pad_value(cr, uid, vals, context)
|
||||
return super(pad_common, self).write(cr, uid, ids, vals, context=context)
|
||||
|
||||
def create(self, cr, uid, vals, context=None):
|
||||
self._set_pad_value(cr, uid, vals, context)
|
||||
return super(pad_common, self).create(cr, uid, vals, context=context)
|
||||
|
||||
# Set the pad content in vals
|
||||
def _set_pad_value(self, cr, uid, vals, context=None):
|
||||
for k,v in vals.items():
|
||||
field = self._all_columns[k].column
|
||||
if hasattr(field,'pad_content_field'):
|
||||
vals[field.pad_content_field] = self.pad_get_content(cr, uid, v, context=context)
|
||||
return super(pad_common, self).write(cr, uid, ids, vals, context=context)
|
||||
vals[field.pad_content_field] = self.pad_get_content(cr, uid, v, context=context)
|
||||
|
||||
def copy(self, cr, uid, id, default=None, context=None):
|
||||
if not default:
|
||||
|
@ -58,7 +89,8 @@ class pad_common(osv.osv_memory):
|
|||
for k,v in self._all_columns:
|
||||
field = v.column
|
||||
if hasattr(field,'pad_content_field'):
|
||||
default[k] = self.pad_generate_url(cr, uid, context)
|
||||
pad = self.pad_generate_url(cr, uid, context)
|
||||
default[k] = pad['url']
|
||||
return super(pad_common, self).copy(cr, uid, id, default, context)
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
|
|
@ -0,0 +1,253 @@
|
|||
#!/usr/bin/env python
|
||||
"""Module to talk to EtherpadLite API."""
|
||||
|
||||
import json
|
||||
import urllib
|
||||
import urllib2
|
||||
|
||||
|
||||
class EtherpadLiteClient:
|
||||
"""Client to talk to EtherpadLite API."""
|
||||
API_VERSION = 1 # TODO probably 1.1 sometime soon
|
||||
|
||||
CODE_OK = 0
|
||||
CODE_INVALID_PARAMETERS = 1
|
||||
CODE_INTERNAL_ERROR = 2
|
||||
CODE_INVALID_FUNCTION = 3
|
||||
CODE_INVALID_API_KEY = 4
|
||||
TIMEOUT = 20
|
||||
|
||||
apiKey = ""
|
||||
baseUrl = "http://localhost:9001/api"
|
||||
|
||||
def __init__(self, apiKey=None, baseUrl=None):
|
||||
if apiKey:
|
||||
self.apiKey = apiKey
|
||||
|
||||
if baseUrl:
|
||||
self.baseUrl = baseUrl
|
||||
|
||||
def call(self, function, arguments=None):
|
||||
"""Create a dictionary of all parameters"""
|
||||
url = '%s/%d/%s' % (self.baseUrl, self.API_VERSION, function)
|
||||
|
||||
params = arguments or {}
|
||||
params.update({'apikey': self.apiKey})
|
||||
data = urllib.urlencode(params, True)
|
||||
|
||||
try:
|
||||
opener = urllib2.build_opener()
|
||||
request = urllib2.Request(url=url, data=data)
|
||||
response = opener.open(request, timeout=self.TIMEOUT)
|
||||
result = response.read()
|
||||
response.close()
|
||||
except urllib2.HTTPError:
|
||||
raise
|
||||
|
||||
result = json.loads(result)
|
||||
if result is None:
|
||||
raise ValueError("JSON response could not be decoded")
|
||||
|
||||
return self.handleResult(result)
|
||||
|
||||
def handleResult(self, result):
|
||||
"""Handle API call result"""
|
||||
if 'code' not in result:
|
||||
raise Exception("API response has no code")
|
||||
if 'message' not in result:
|
||||
raise Exception("API response has no message")
|
||||
|
||||
if 'data' not in result:
|
||||
result['data'] = None
|
||||
|
||||
if result['code'] == self.CODE_OK:
|
||||
return result['data']
|
||||
elif result['code'] == self.CODE_INVALID_PARAMETERS or result['code'] == self.CODE_INVALID_API_KEY:
|
||||
raise ValueError(result['message'])
|
||||
elif result['code'] == self.CODE_INTERNAL_ERROR:
|
||||
raise Exception(result['message'])
|
||||
elif result['code'] == self.CODE_INVALID_FUNCTION:
|
||||
raise Exception(result['message'])
|
||||
else:
|
||||
raise Exception("An unexpected error occurred whilst handling the response")
|
||||
|
||||
# GROUPS
|
||||
# Pads can belong to a group. There will always be public pads that do not belong to a group (or we give this group the id 0)
|
||||
|
||||
def createGroup(self):
|
||||
"""creates a new group"""
|
||||
return self.call("createGroup")
|
||||
|
||||
def createGroupIfNotExistsFor(self, groupMapper):
|
||||
"""this functions helps you to map your application group ids to etherpad lite group ids"""
|
||||
return self.call("createGroupIfNotExistsFor", {
|
||||
"groupMapper": groupMapper
|
||||
})
|
||||
|
||||
def deleteGroup(self, groupID):
|
||||
"""deletes a group"""
|
||||
return self.call("deleteGroup", {
|
||||
"groupID": groupID
|
||||
})
|
||||
|
||||
def listPads(self, groupID):
|
||||
"""returns all pads of this group"""
|
||||
return self.call("listPads", {
|
||||
"groupID": groupID
|
||||
})
|
||||
|
||||
def createGroupPad(self, groupID, padName, text=''):
|
||||
"""creates a new pad in this group"""
|
||||
params = {
|
||||
"groupID": groupID,
|
||||
"padName": padName,
|
||||
}
|
||||
if text:
|
||||
params['text'] = text
|
||||
return self.call("createGroupPad", params)
|
||||
|
||||
# AUTHORS
|
||||
# Theses authors are bind to the attributes the users choose (color and name).
|
||||
|
||||
def createAuthor(self, name=''):
|
||||
"""creates a new author"""
|
||||
params = {}
|
||||
if name:
|
||||
params['name'] = name
|
||||
return self.call("createAuthor", params)
|
||||
|
||||
def createAuthorIfNotExistsFor(self, authorMapper, name=''):
|
||||
"""this functions helps you to map your application author ids to etherpad lite author ids"""
|
||||
params = {
|
||||
'authorMapper': authorMapper
|
||||
}
|
||||
if name:
|
||||
params['name'] = name
|
||||
return self.call("createAuthorIfNotExistsFor", params)
|
||||
|
||||
# SESSIONS
|
||||
# Sessions can be created between a group and a author. This allows
|
||||
# an author to access more than one group. The sessionID will be set as
|
||||
# a cookie to the client and is valid until a certain date.
|
||||
|
||||
def createSession(self, groupID, authorID, validUntil):
|
||||
"""creates a new session"""
|
||||
return self.call("createSession", {
|
||||
"groupID": groupID,
|
||||
"authorID": authorID,
|
||||
"validUntil": validUntil
|
||||
})
|
||||
|
||||
def deleteSession(self, sessionID):
|
||||
"""deletes a session"""
|
||||
return self.call("deleteSession", {
|
||||
"sessionID": sessionID
|
||||
})
|
||||
|
||||
def getSessionInfo(self, sessionID):
|
||||
"""returns informations about a session"""
|
||||
return self.call("getSessionInfo", {
|
||||
"sessionID": sessionID
|
||||
})
|
||||
|
||||
def listSessionsOfGroup(self, groupID):
|
||||
"""returns all sessions of a group"""
|
||||
return self.call("listSessionsOfGroup", {
|
||||
"groupID": groupID
|
||||
})
|
||||
|
||||
def listSessionsOfAuthor(self, authorID):
|
||||
"""returns all sessions of an author"""
|
||||
return self.call("listSessionsOfAuthor", {
|
||||
"authorID": authorID
|
||||
})
|
||||
|
||||
# PAD CONTENT
|
||||
# Pad content can be updated and retrieved through the API
|
||||
|
||||
def getText(self, padID, rev=None):
|
||||
"""returns the text of a pad"""
|
||||
params = {"padID": padID}
|
||||
if rev is not None:
|
||||
params['rev'] = rev
|
||||
return self.call("getText", params)
|
||||
|
||||
# introduced with pull request merge
|
||||
def getHtml(self, padID, rev=None):
|
||||
"""returns the html of a pad"""
|
||||
params = {"padID": padID}
|
||||
if rev is not None:
|
||||
params['rev'] = rev
|
||||
return self.call("getHTML", params)
|
||||
|
||||
def setText(self, padID, text):
|
||||
"""sets the text of a pad"""
|
||||
return self.call("setText", {
|
||||
"padID": padID,
|
||||
"text": text
|
||||
})
|
||||
|
||||
def setHtml(self, padID, html):
|
||||
"""sets the text of a pad from html"""
|
||||
return self.call("setHTML", {
|
||||
"padID": padID,
|
||||
"html": html
|
||||
})
|
||||
|
||||
# PAD
|
||||
# Group pads are normal pads, but with the name schema
|
||||
# GROUPID$PADNAME. A security manager controls access of them and its
|
||||
# forbidden for normal pads to include a in the name.
|
||||
|
||||
def createPad(self, padID, text=''):
|
||||
"""creates a new pad"""
|
||||
params = {
|
||||
"padID": padID,
|
||||
}
|
||||
if text:
|
||||
params['text'] = text
|
||||
return self.call("createPad", params)
|
||||
|
||||
def getRevisionsCount(self, padID):
|
||||
"""returns the number of revisions of this pad"""
|
||||
return self.call("getRevisionsCount", {
|
||||
"padID": padID
|
||||
})
|
||||
|
||||
def deletePad(self, padID):
|
||||
"""deletes a pad"""
|
||||
return self.call("deletePad", {
|
||||
"padID": padID
|
||||
})
|
||||
|
||||
def getReadOnlyID(self, padID):
|
||||
"""returns the read only link of a pad"""
|
||||
return self.call("getReadOnlyID", {
|
||||
"padID": padID
|
||||
})
|
||||
|
||||
def setPublicStatus(self, padID, publicStatus):
|
||||
"""sets a boolean for the public status of a pad"""
|
||||
return self.call("setPublicStatus", {
|
||||
"padID": padID,
|
||||
"publicStatus": publicStatus
|
||||
})
|
||||
|
||||
def getPublicStatus(self, padID):
|
||||
"""return true of false"""
|
||||
return self.call("getPublicStatus", {
|
||||
"padID": padID
|
||||
})
|
||||
|
||||
def setPassword(self, padID, password):
|
||||
"""returns ok or a error message"""
|
||||
return self.call("setPassword", {
|
||||
"padID": padID,
|
||||
"password": password
|
||||
})
|
||||
|
||||
def isPasswordProtected(self, padID):
|
||||
"""returns true or false"""
|
||||
return self.call("isPasswordProtected", {
|
||||
"padID": padID
|
||||
})
|
|
@ -1,7 +1,12 @@
|
|||
.oe_pad_head {
|
||||
box-sizing: border-box;
|
||||
width: 100%;
|
||||
display: block;
|
||||
padding: 4px;
|
||||
text-align: right;
|
||||
}
|
||||
.oe_pad_head .oe_pad_switch {
|
||||
|
||||
}
|
||||
|
||||
.oe_pad_readonly {
|
||||
|
@ -13,14 +18,38 @@
|
|||
position: fixed;
|
||||
top: 0px;
|
||||
left: 0px;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
right: 0px;
|
||||
bottom: 0px;
|
||||
background-color: white;
|
||||
margin:0;
|
||||
padding:0;
|
||||
border:none;
|
||||
z-index: 1000;
|
||||
}
|
||||
|
||||
.oe_pad_content {
|
||||
border: solid 1px #c4c4c4;
|
||||
height: 150px;
|
||||
-webkit-box-shadow: 0 5px 10px rgba(0,0,0,0.1);
|
||||
-moz-box-shadow: 0 5px 10px rgba(0,0,0,0.1);
|
||||
-ms-box-shadow: 0 5px 10px rgba(0,0,0,0.1);
|
||||
-o-box-shadow: 0 5px 10px rgba(0,0,0,0.1);
|
||||
box-shadow: 0 5px 10px rgba(0,0,0,0.1);
|
||||
}
|
||||
|
||||
.oe_pad_content > p {
|
||||
text-align: center;
|
||||
opacity: 0.75;
|
||||
}
|
||||
|
||||
.oe_pad_fullscreen .oe_pad_content {
|
||||
height: 100%;
|
||||
border: none;
|
||||
-webkit-box-shadow: none;
|
||||
-moz-box-shadow: none;
|
||||
-ms-box-shadow: none;
|
||||
-o-box-shadow: none;
|
||||
box-shadow: none;
|
||||
}
|
||||
|
||||
.etherpad_readonly ul, .etherpad_readonly ol {
|
||||
|
|
|
@ -16,11 +16,24 @@ instance.web.form.FieldPad = instance.web.form.AbstractField.extend({
|
|||
var self = this;
|
||||
var _super = self._super;
|
||||
_super.apply(self,[val]);
|
||||
|
||||
if (val === false || val === "") {
|
||||
self.field_manager.dataset.call('pad_generate_url',{context:{
|
||||
model: self.field_manager.model,
|
||||
field_name: self.name,
|
||||
object_id: self.field_manager.datarecord.id
|
||||
}}).then(function(data) {
|
||||
if(data&&data.url){
|
||||
_super.apply(self,[data.url]);
|
||||
self.render_value();
|
||||
}
|
||||
});
|
||||
} else {
|
||||
self.render_value();
|
||||
}
|
||||
this._dirty_flag = true;
|
||||
self.render_value();
|
||||
},
|
||||
render_value: function() {
|
||||
console.log("display");
|
||||
var self = this;
|
||||
var value = this.get('value');
|
||||
|
||||
|
|
|
@ -5,12 +5,14 @@
|
|||
<t t-name="FieldPad">
|
||||
<div class="oe_form_field_text oe_pad">
|
||||
<div class="oe_pad_head">
|
||||
<span class="oe_pad_switch">Fullscreen</span>
|
||||
<button class="oe_pad_switch oe_button">Fullscreen</button>
|
||||
</div>
|
||||
<div class="oe_pad_content"></div>
|
||||
</div>
|
||||
</t>
|
||||
<t t-name="FieldPad.unconfigured">
|
||||
<p>
|
||||
You must configure the etherpad through the menu Setting > Companies > Companies, in the configuration tab of your company.<br/>
|
||||
</p>
|
||||
</t>
|
||||
</templates>
|
||||
|
|
|
@ -0,0 +1,109 @@
|
|||
# Icelandic translation for openobject-addons
|
||||
# Copyright (c) 2012 Rosetta Contributors and Canonical Ltd 2012
|
||||
# This file is distributed under the same license as the openobject-addons package.
|
||||
# FIRST AUTHOR <EMAIL@ADDRESS>, 2012.
|
||||
#
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: openobject-addons\n"
|
||||
"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
|
||||
"POT-Creation-Date: 2012-02-09 00:36+0000\n"
|
||||
"PO-Revision-Date: 2012-09-19 10:08+0000\n"
|
||||
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
||||
"Language-Team: Icelandic <is@li.org>\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"X-Launchpad-Export-Date: 2012-09-20 04:43+0000\n"
|
||||
"X-Generator: Launchpad (build 15985)\n"
|
||||
|
||||
#. module: plugin_thunderbird
|
||||
#: field:plugin_thunderbird.installer,pdf_file:0
|
||||
msgid "Installation Manual"
|
||||
msgstr "Uppsetningarhandbók"
|
||||
|
||||
#. module: plugin_thunderbird
|
||||
#: field:plugin_thunderbird.installer,description:0
|
||||
msgid "Description"
|
||||
msgstr "Lýsing"
|
||||
|
||||
#. module: plugin_thunderbird
|
||||
#: view:plugin_thunderbird.installer:0
|
||||
msgid "title"
|
||||
msgstr "titill"
|
||||
|
||||
#. module: plugin_thunderbird
|
||||
#: model:ir.model,name:plugin_thunderbird.model_plugin_thunderbird_installer
|
||||
msgid "plugin_thunderbird.installer"
|
||||
msgstr "plugin_thunderbird.installer"
|
||||
|
||||
#. module: plugin_thunderbird
|
||||
#: field:plugin_thunderbird.installer,config_logo:0
|
||||
msgid "Image"
|
||||
msgstr "Mynd"
|
||||
|
||||
#. module: plugin_thunderbird
|
||||
#: field:plugin_thunderbird.installer,plugin_file:0
|
||||
#: field:plugin_thunderbird.installer,thunderbird:0
|
||||
msgid "Thunderbird Plug-in"
|
||||
msgstr "Thunderbird viðbót"
|
||||
|
||||
#. module: plugin_thunderbird
|
||||
#: view:plugin_thunderbird.installer:0
|
||||
msgid ""
|
||||
"This plug-in allows you to link your email to OpenERP's documents. You can "
|
||||
"attach it to any existing one in OpenERP or create a new one."
|
||||
msgstr ""
|
||||
|
||||
#. module: plugin_thunderbird
|
||||
#: help:plugin_thunderbird.installer,thunderbird:0
|
||||
msgid ""
|
||||
"Allows you to select an object that you would like to add to your email and "
|
||||
"its attachments."
|
||||
msgstr ""
|
||||
"Gerir þér kleift að velja hlut sem þú vilt bæta við póstinn og viðhengi hans."
|
||||
|
||||
#. module: plugin_thunderbird
|
||||
#: help:plugin_thunderbird.installer,pdf_file:0
|
||||
msgid "The documentation file :- how to install Thunderbird Plug-in."
|
||||
msgstr "Handbókin :- hvernig á að setja inn Thunderbird viðbót."
|
||||
|
||||
#. module: plugin_thunderbird
|
||||
#: view:plugin_thunderbird.installer:0
|
||||
msgid "_Close"
|
||||
msgstr "_Loka"
|
||||
|
||||
#. module: plugin_thunderbird
|
||||
#: view:plugin_thunderbird.installer:0
|
||||
msgid "Installation and Configuration Steps"
|
||||
msgstr ""
|
||||
|
||||
#. module: plugin_thunderbird
|
||||
#: field:plugin_thunderbird.installer,name:0
|
||||
#: field:plugin_thunderbird.installer,pdf_name:0
|
||||
msgid "File name"
|
||||
msgstr "Skrárheiti"
|
||||
|
||||
#. module: plugin_thunderbird
|
||||
#: help:plugin_thunderbird.installer,plugin_file:0
|
||||
msgid ""
|
||||
"Thunderbird plug-in file. Save as this file and install this plug-in in "
|
||||
"thunderbird."
|
||||
msgstr ""
|
||||
"Skrá með Thunderbird viðbót. Vistaðu skrána og settu viðbótina inn í "
|
||||
"Thunderbird."
|
||||
|
||||
#. module: plugin_thunderbird
|
||||
#: model:ir.actions.act_window,name:plugin_thunderbird.action_thunderbird_installer
|
||||
#: model:ir.ui.menu,name:plugin_thunderbird.menu_base_config_plugins_thunderbird
|
||||
#: view:plugin_thunderbird.installer:0
|
||||
msgid "Install Thunderbird Plug-In"
|
||||
msgstr "Setja inn Thunderbird viðbót"
|
||||
|
||||
#~ msgid ""
|
||||
#~ "This plug-in allows you to link your e-mail to OpenERP's documents. You can "
|
||||
#~ "attach it to any existing one in OpenERP or create a new one."
|
||||
#~ msgstr ""
|
||||
#~ "Þessi viðbót gerir þér kleift að tengja tölvupóst við OpenERP skjöl. Þú "
|
||||
#~ "getur viðhengt póstinn við skjöl sem þegar eru til í OpenERP eða búið til "
|
||||
#~ "nýtt."
|
|
@ -43,7 +43,7 @@ class mail_mail_portal(osv.Model):
|
|||
:param partner: browse_record of the specific recipient partner
|
||||
"""
|
||||
if partner:
|
||||
portal_ref = self.pool.get('ir.model.data').get_object_reference(cr, uid, 'portal', 'portal')
|
||||
portal_ref = self.pool.get('ir.model.data').get_object_reference(cr, uid, 'portal', 'group_portal')
|
||||
portal_id = portal_ref and portal_ref[1] or False
|
||||
url = self._generate_signin_url(cr, uid, partner.id, portal_id, 1234, context=context)
|
||||
body = tools.append_content_to_html(mail.body_html, url)
|
||||
|
|
|
@ -20,196 +20,14 @@
|
|||
##############################################################################
|
||||
|
||||
from osv import osv, fields
|
||||
from tools.translate import _
|
||||
|
||||
|
||||
|
||||
class portal(osv.osv):
|
||||
""" A portal is simply a group of users with the flag 'is_portal' set to True.
|
||||
The flag 'is_portal' makes a user group usable as a portal.
|
||||
"""
|
||||
A portal is a group of users with specific menu, widgets, and typically
|
||||
restricted access rights.
|
||||
"""
|
||||
_name = 'res.portal'
|
||||
_description = 'Portal'
|
||||
_inherits = {'res.groups': 'group_id'}
|
||||
|
||||
_inherit = 'res.groups'
|
||||
_columns = {
|
||||
'group_id': fields.many2one('res.groups', required=True, ondelete='cascade',
|
||||
string='Group',
|
||||
help='The group corresponding to this portal'),
|
||||
'url': fields.char('URL',
|
||||
help="The url where portal users can connect to the server"),
|
||||
'home_action_id': fields.many2one('ir.actions.actions',
|
||||
string='Home Action',
|
||||
help="if set, replaces the standard home action (first screen after loggin) for the portal's users"),
|
||||
'menu_action_id': fields.many2one('ir.actions.act_window', readonly=True,
|
||||
# ISSUE: 'ondelete' constraints do not seem effective on this field...
|
||||
string='Menu Action',
|
||||
help="If set, replaces the standard menu for the portal's users"),
|
||||
'parent_menu_id': fields.many2one('ir.ui.menu', ondelete='restrict',
|
||||
string='Parent Menu',
|
||||
help='The menu action opens the submenus of this menu item'),
|
||||
'widget_ids': fields.one2many('res.portal.widget', 'portal_id',
|
||||
string='Widgets',
|
||||
help='Widgets assigned to portal users'),
|
||||
'is_portal': fields.boolean('Portal', help="If checked, this group is usable as a portal."),
|
||||
}
|
||||
|
||||
def copy(self, cr, uid, id, values, context=None):
|
||||
""" override copy(): menu_action_id must be different """
|
||||
values['menu_action_id'] = None
|
||||
return super(portal, self).copy(cr, uid, id, values, context)
|
||||
|
||||
def create(self, cr, uid, values, context=None):
|
||||
""" extend create() to assign the portal menu to users """
|
||||
if context is None:
|
||||
context = {}
|
||||
|
||||
# create portal (admin should not be included)
|
||||
context['noadmin'] = True
|
||||
portal_id = super(portal, self).create(cr, uid, values, context)
|
||||
|
||||
# assign menu action and widgets to users
|
||||
if values.get('users') or values.get('menu_action_id'):
|
||||
self._assign_menu(cr, uid, [portal_id], context)
|
||||
if values.get('users') or values.get('widget_ids'):
|
||||
self._assign_widgets(cr, uid, [portal_id], context)
|
||||
|
||||
return portal_id
|
||||
|
||||
def write(self, cr, uid, ids, values, context=None):
|
||||
""" extend write() to reflect changes on users """
|
||||
# first apply portal changes
|
||||
super(portal, self).write(cr, uid, ids, values, context)
|
||||
|
||||
# assign menu action and widgets to users
|
||||
if values.get('users') or values.get('menu_action_id'):
|
||||
self._assign_menu(cr, uid, ids, context)
|
||||
if values.get('users') or values.get('widget_ids'):
|
||||
self._assign_widgets(cr, uid, ids, context)
|
||||
|
||||
# if parent_menu_id has changed, apply the change on menu_action_id
|
||||
if 'parent_menu_id' in values:
|
||||
act_window_obj = self.pool.get('ir.actions.act_window')
|
||||
portals = self.browse(cr, uid, ids, context)
|
||||
action_ids = [p.menu_action_id.id for p in portals if p.menu_action_id]
|
||||
if action_ids:
|
||||
action_values = {'domain': [('parent_id', '=', values['parent_menu_id'])]}
|
||||
act_window_obj.write(cr, uid, action_ids, action_values, context)
|
||||
|
||||
return True
|
||||
|
||||
def _assign_menu(self, cr, uid, ids, context=None):
|
||||
""" assign portal_menu_settings to users of portals (ids) """
|
||||
user_obj = self.pool.get('res.users')
|
||||
for p in self.browse(cr, uid, ids, context):
|
||||
# user menu action = portal menu action if set in portal
|
||||
if p.menu_action_id:
|
||||
user_ids = [u.id for u in p.users if u.id != 1]
|
||||
user_values = {'menu_id': p.menu_action_id.id}
|
||||
user_obj.write(cr, uid, user_ids, user_values, context)
|
||||
|
||||
def _assign_widgets(self, cr, uid, ids, context=None):
|
||||
""" assign portal widgets to users of portals (ids) """
|
||||
widget_user_obj = self.pool.get('res.widget.user')
|
||||
for p in self.browse(cr, uid, ids, context):
|
||||
for w in p.widget_ids:
|
||||
values = {'sequence': w.sequence, 'widget_id': w.widget_id.id}
|
||||
for u in p.users:
|
||||
if u.id == 1: continue
|
||||
values['user_id'] = u.id
|
||||
widget_user_obj.create(cr, uid, values, context)
|
||||
|
||||
def _res_xml_id(self, cr, uid, module, xml_id):
|
||||
""" return the resource id associated to the given xml_id """
|
||||
data_obj = self.pool.get('ir.model.data')
|
||||
data_id = data_obj._get_id(cr, uid, module, xml_id)
|
||||
return data_obj.browse(cr, uid, data_id).res_id
|
||||
|
||||
portal()
|
||||
|
||||
|
||||
|
||||
class portal_override_menu(osv.osv):
|
||||
"""
|
||||
Extend res.portal with a boolean field 'Override Users Menu', that
|
||||
triggers the creation or removal of menu_action_id
|
||||
"""
|
||||
_name = 'res.portal'
|
||||
_inherit = 'res.portal'
|
||||
|
||||
def _get_override_menu(self, cr, uid, ids, field_name, arg, context=None):
|
||||
assert field_name == 'override_menu'
|
||||
result = {}
|
||||
for p in self.browse(cr, uid, ids, context):
|
||||
result[p.id] = bool(p.menu_action_id)
|
||||
return result
|
||||
|
||||
def _set_override_menu(self, cr, uid, id, field_name, field_value, arg, context=None):
|
||||
assert field_name == 'override_menu'
|
||||
if field_value:
|
||||
self.create_menu_action(cr, uid, id, context)
|
||||
else:
|
||||
self.write(cr, uid, [id], {'menu_action_id': False}, context)
|
||||
|
||||
def create_menu_action(self, cr, uid, id, context=None):
|
||||
""" create, if necessary, a menu action that opens the menu items below
|
||||
parent_menu_id """
|
||||
p = self.browse(cr, uid, id, context)
|
||||
if not p.menu_action_id:
|
||||
actions_obj = self.pool.get('ir.actions.act_window')
|
||||
parent_id = p.parent_menu_id.id if p.parent_menu_id else False
|
||||
action_values = {
|
||||
'name': _('%s Menu') % p.name,
|
||||
'type': 'ir.actions.act_window',
|
||||
'usage': 'menu',
|
||||
'res_model': 'ir.ui.menu',
|
||||
'view_type': 'tree',
|
||||
'view_id': self._res_xml_id(cr, uid, 'base', 'view_menu'),
|
||||
'domain': [('parent_id', '=', parent_id)],
|
||||
}
|
||||
action_id = actions_obj.create(cr, uid, action_values, context)
|
||||
self.write(cr, uid, [id], {'menu_action_id': action_id}, context)
|
||||
|
||||
_columns = {
|
||||
'override_menu': fields.function(
|
||||
_get_override_menu, fnct_inv=_set_override_menu,
|
||||
type='boolean', string='Override Menu Action of Users',
|
||||
help='Enable this option to override the Menu Action of portal users'),
|
||||
}
|
||||
|
||||
portal_override_menu()
|
||||
|
||||
|
||||
|
||||
class portal_widget(osv.osv):
|
||||
"""
|
||||
Similar to res.widget.user (res_widget.py), but with a portal instead.
|
||||
New users in a portal are assigned the portal's widgets.
|
||||
"""
|
||||
_name='res.portal.widget'
|
||||
_description = 'Portal Widgets'
|
||||
_order = 'sequence'
|
||||
_columns = {
|
||||
'sequence': fields.integer('Sequence'),
|
||||
'portal_id': fields.many2one('res.portal', select=1, ondelete='cascade',
|
||||
string='Portal'),
|
||||
'widget_id': fields.many2one('res.widget', required=True, ondelete='cascade',
|
||||
string='Widget'),
|
||||
}
|
||||
|
||||
def create(self, cr, uid, values, context=None):
|
||||
domain = [('portal_id', '=', values.get('portal_id')),
|
||||
('widget_id', '=', values.get('widget_id'))]
|
||||
existing = self.search(cr, uid, domain, context=context)
|
||||
if existing:
|
||||
res = existing[0]
|
||||
else:
|
||||
res = super(portal_widget, self).create(cr, uid, values, context=context)
|
||||
return res
|
||||
|
||||
portal_widget()
|
||||
|
||||
|
||||
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
|
|
@ -2,14 +2,6 @@
|
|||
<openerp>
|
||||
<data noupdate="1">
|
||||
|
||||
<record id="portal" model="res.portal">
|
||||
<field name="name">Portal</field>
|
||||
<field name="group_id" ref="group_portal_member"/>
|
||||
<field name="override_menu" eval="False"/>
|
||||
<!-- Insert the template user from auth_signup in the portal members group -->
|
||||
<field name="users" eval="[(4,ref('auth_signup.default_template_user'))]"/>
|
||||
</record>
|
||||
|
||||
<!-- Mail group for the company's news -->
|
||||
<record id="company_news_feed" model="mail.group">
|
||||
<field name="name">Company's news</field>
|
||||
|
|
|
@ -13,13 +13,13 @@
|
|||
</record>
|
||||
|
||||
<!-- Add the demo user to the portal (and therefore to the portal member group) -->
|
||||
<record id="portal" model="res.portal">
|
||||
<record id="group_portal" model="res.groups">
|
||||
<field name="users" eval="[(4,ref('demo_user0'))]"/>
|
||||
</record>
|
||||
|
||||
<!-- Company news and comments -->
|
||||
<record id="message_company_news0" model="mail.message">
|
||||
<field name="subject">Our first company's blogpost !</field>
|
||||
<field name="subject">Our company's first blog-post !</field>
|
||||
<field name="model">mail.group</field>
|
||||
<field name="res_id" ref="company_news_feed"/>
|
||||
<field name="body"><![CDATA[Hello, and welcome to our company's portal !
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
<!-- Top menu item -->
|
||||
<menuitem name="Portal"
|
||||
id="portal_menu"
|
||||
groups="base.group_no_one,portal.group_portal_member,auth_anonymous.group_anonymous"
|
||||
groups="base.group_no_one,portal.group_portal,auth_anonymous.group_anonymous"
|
||||
sequence="20"/>
|
||||
|
||||
<menuitem name="Our company" id="portal_company" parent="portal_menu" sequence="10"/>
|
||||
|
@ -21,71 +21,31 @@
|
|||
<menuitem name="Projects" id="portal_projects" parent="portal_menu" sequence="40"/>
|
||||
<menuitem name="After Sale Services" id="portal_after_sales" parent="portal_menu" sequence="50"/>
|
||||
|
||||
<!-- portal tree view -->
|
||||
<record id="portal_list_view" model="ir.ui.view">
|
||||
<field name="name">Portal List</field>
|
||||
<field name="model">res.portal</field>
|
||||
<!-- extend res.groups search view -->
|
||||
<record id="group_search_view" model="ir.ui.view">
|
||||
<field name="name">Group Search</field>
|
||||
<field name="model">res.groups</field>
|
||||
<field name="inherit_id" ref="base.view_groups_search"/>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="Portals">
|
||||
<field name="name" string="Portal Name"/>
|
||||
</tree>
|
||||
<field name="name" position="after">
|
||||
<filter name="portal" string="Portal Groups" domain="[('is_portal','=',True)]"/>
|
||||
<filter name="no_portal" string="Non-Portal Groups" domain="[('is_portal','=',False)]"/>
|
||||
<separator orientation="vertical"/>
|
||||
</field>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<!-- portal form view -->
|
||||
<record id="portal_form_view" model="ir.ui.view">
|
||||
<!-- extend res.groups form view -->
|
||||
<record id="group_form_view" model="ir.ui.view">
|
||||
<field name="name">Portal Form</field>
|
||||
<field name="model">res.portal</field>
|
||||
<field name="model">res.groups</field>
|
||||
<field name="inherit_id" ref="base.view_groups_form"/>
|
||||
<field name="arch" type="xml">
|
||||
<page string="Users" position="before">
|
||||
<page string="Portal">
|
||||
<group>
|
||||
<group>
|
||||
<field name="url" widget="url" string="Portal URL"/>
|
||||
<field name="home_action_id"/>
|
||||
</group>
|
||||
<group>
|
||||
<field name="override_menu"/>
|
||||
<field name="parent_menu_id"
|
||||
context="{'ir.ui.menu.full_list': True}"/>
|
||||
<label for="partent_menu_id" colspan="1"/>
|
||||
</group>
|
||||
<separator string="Widgets Assigned to Users" colspan="2"/>
|
||||
<field name="widget_ids" nolabel="1" colspan="2">
|
||||
<tree string="Widgets" editable="bottom">
|
||||
<field name="sequence"/>
|
||||
<field name="widget_id"/>
|
||||
</tree>
|
||||
</field>
|
||||
</group>
|
||||
</page>
|
||||
</page>
|
||||
<field name="name" position="after">
|
||||
<field name="is_portal"/>
|
||||
</field>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<!-- action Administration/Portals/Portals -->
|
||||
<record id="portal_list_action" model="ir.actions.act_window">
|
||||
<field name="name">Portals</field>
|
||||
<field name="res_model">res.portal</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
<!-- a context is necessary to get the right portal form view -->
|
||||
<field name="context">{'form_view_ref': 'portal.portal_form_view'}</field>
|
||||
<field name="help" type="html">
|
||||
<p class="oe_view_nocontent_create">
|
||||
Click to create a new portal.
|
||||
</p><p>
|
||||
A portal helps defining specific views and rules for a group of
|
||||
users (the portal group). A portal menu, widgets and specific
|
||||
groups may be assigned to the portal's users.
|
||||
</p>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<!-- menu Administration/Portals/Portals -->
|
||||
<menuitem name="Portals Settings" id="portal_menu_settings" parent="base.menu_administration" groups="group_portal_manager"/>
|
||||
<menuitem name="Portals" id="portal_list_menu" parent="portal_menu_settings" action="portal_list_action"/>
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
|
|
|
@ -1,12 +1,8 @@
|
|||
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
|
||||
access_all,access.portal.all,model_res_portal,,1,0,0,0
|
||||
access_widget_all,access.portal.widget.all,model_res_portal_widget,,1,0,0,0
|
||||
access_manager,access.portal.manager,model_res_portal,group_portal_manager,1,1,1,1
|
||||
access_widget_manager,access.portal.widget.manager,model_res_portal_widget,group_portal_manager,1,1,1,1
|
||||
access_mail_message,mail.message,mail.model_mail_message,group_portal_member,1,0,1,1
|
||||
access_mail_message_all,mail.message.all,mail.model_mail_message,group_portal_member,1,0,0,0
|
||||
access_mail_thread,mail.thread,mail.model_mail_thread,group_portal_member,1,0,0,0
|
||||
access_mail_followers,mail.followers,mail.model_mail_followers,group_portal_member,1,0,1,1
|
||||
access_mail_notification,mail.notification,mail.model_mail_notification,group_portal_member,1,0,1,0
|
||||
access_mail_group,mail.group,mail.model_mail_group,group_portal_member,1,0,0,0
|
||||
access_mail_alias,mail.alias,mail.model_mail_alias,group_portal_member,1,0,0,0
|
||||
access_mail_message,mail.message,mail.model_mail_message,group_portal,1,0,1,1
|
||||
access_mail_message_all,mail.message.all,mail.model_mail_message,group_portal,1,0,0,0
|
||||
access_mail_thread,mail.thread,mail.model_mail_thread,group_portal,1,0,0,0
|
||||
access_mail_followers,mail.followers,mail.model_mail_followers,group_portal,1,0,1,1
|
||||
access_mail_notification,mail.notification,mail.model_mail_notification,group_portal,1,0,1,0
|
||||
access_mail_group,mail.group,mail.model_mail_group,group_portal,1,0,0,0
|
||||
access_mail_alias,mail.alias,mail.model_mail_alias,group_portal,1,0,0,0
|
||||
|
|
|
|
@ -2,31 +2,14 @@
|
|||
<openerp>
|
||||
<data noupdate="1">
|
||||
|
||||
<!-- Don't use any implied_ids here; this group's behavior is particular -->
|
||||
<record id="group_portal_member" model="res.groups">
|
||||
<field name="name">Portal Member</field>
|
||||
<field name="comment">Portal members can access information through the portal menu. Also, they are chrooted in this specific menu.</field>
|
||||
</record>
|
||||
|
||||
<record id="module_category_portal" model="ir.module.category">
|
||||
<!-- The portal group -->
|
||||
<record id="group_portal" model="res.groups">
|
||||
<field name="name">Portal</field>
|
||||
<field name="parent_id" ref="base.module_category_tools"/>
|
||||
<field name="sequence">25</field>
|
||||
</record>
|
||||
|
||||
<!-- No implied ids with 'member' since this group is highly restrictive (chrooted menu) -->
|
||||
<record id="group_portal_officer" model="res.groups">
|
||||
<field name="name">Officer</field>
|
||||
<field name="comment">Portal officers can create new portal users with the portal wizard.</field>
|
||||
<field name="category_id" ref="module_category_portal"/>
|
||||
</record>
|
||||
|
||||
<record id="group_portal_manager" model="res.groups">
|
||||
<field name="name">Manager</field>
|
||||
<field name="comment">Portal managers have access to the portal definitions, and can easily configure the users, access rights and menus of portal users.</field>
|
||||
<field name="category_id" ref="module_category_portal"/>
|
||||
<field name="implied_ids" eval="[(4, ref('group_portal_officer'))]"/>
|
||||
<field name="users" eval="[(4, ref('base.user_root'))]"/>
|
||||
<field name="comment">Portal members have specific access rights (such as record rules and restricted menus).
|
||||
They usually do not belong to the usual OpenERP groups.</field>
|
||||
<field name="is_portal" eval="True"/>
|
||||
<!-- Insert the template user from auth_signup in the portal members group -->
|
||||
<field name="users" eval="[(4,ref('auth_signup.default_template_user'))]"/>
|
||||
</record>
|
||||
|
||||
</data>
|
||||
|
|
|
@ -42,7 +42,7 @@ class test_portal(test_mail.TestMailMockups):
|
|||
user_admin = self.res_users.browse(cr, uid, uid)
|
||||
self.mail_invite = self.registry('mail.wizard.invite')
|
||||
base_url = self.registry('ir.config_parameter').get_param(cr, uid, 'web.base.url', default='')
|
||||
portal_ref = self.registry('ir.model.data').get_object_reference(cr, uid, 'portal', 'portal')
|
||||
portal_ref = self.registry('ir.model.data').get_object_reference(cr, uid, 'portal', 'group_portal')
|
||||
portal_id = portal_ref and portal_ref[1] or False
|
||||
|
||||
# 0 - Admin
|
||||
|
|
|
@ -23,33 +23,43 @@ import logging
|
|||
import random
|
||||
|
||||
from osv import osv, fields
|
||||
from tools.misc import email_re
|
||||
from tools.translate import _
|
||||
from tools.misc import email_re
|
||||
from openerp import SUPERUSER_ID
|
||||
|
||||
from base.res.res_partner import _lang_get
|
||||
_logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
# welcome email sent to new portal users (note that calling tools.translate._
|
||||
# has no effect except exporting those strings for translation)
|
||||
# welcome/goodbye email sent to portal users
|
||||
# (note that calling '_' has no effect except exporting those strings for translation)
|
||||
WELCOME_EMAIL_SUBJECT = _("Your OpenERP account at %(company)s")
|
||||
WELCOME_EMAIL_BODY = _("""Dear %(name)s,
|
||||
|
||||
You have been created an OpenERP account at %(url)s.
|
||||
You have been given access to %(portal)s at %(url)s.
|
||||
|
||||
Your login account data is:
|
||||
Database: %(db)s
|
||||
User: %(login)s
|
||||
Password: %(password)s
|
||||
|
||||
%(message)s
|
||||
%(welcome_message)s
|
||||
|
||||
--
|
||||
OpenERP - Open Source Business Applications
|
||||
http://www.openerp.com
|
||||
""")
|
||||
|
||||
ROOT_UID = 1
|
||||
GOODBYE_EMAIL_SUBJECT = _("Your OpenERP account at %(company)s")
|
||||
GOODBYE_EMAIL_BODY = _("""Dear %(name)s,
|
||||
|
||||
Your access to %(portal)s has been withdrawn.
|
||||
|
||||
%(goodbye_message)s
|
||||
|
||||
--
|
||||
OpenERP - Open Source Business Applications
|
||||
http://www.openerp.com
|
||||
""")
|
||||
|
||||
# character sets for passwords, excluding 0, O, o, 1, I, l
|
||||
_PASSU = 'ABCDEFGHIJKLMNPQRSTUVWXYZ'
|
||||
|
@ -71,169 +81,173 @@ def extract_email(email):
|
|||
|
||||
class wizard(osv.osv_memory):
|
||||
"""
|
||||
A wizard to create portal users from instances of 'res.partner'. The purpose
|
||||
is to provide an OpenERP database access to customers or suppliers.
|
||||
A wizard to manage the creation/removal of portal users.
|
||||
"""
|
||||
_name = 'res.portal.wizard'
|
||||
_description = 'Portal Wizard'
|
||||
|
||||
_name = 'portal.wizard'
|
||||
_description = 'Portal Access Management'
|
||||
|
||||
_columns = {
|
||||
'portal_id': fields.many2one('res.portal', required=True,
|
||||
string='Portal',
|
||||
help="The portal in which new users must be added"),
|
||||
'user_ids': fields.one2many('res.portal.wizard.user', 'wizard_id',
|
||||
string='Users'),
|
||||
'message': fields.text(string='Invitation message',
|
||||
help="This text is included in the welcome email sent to the users"),
|
||||
'portal_id': fields.many2one('res.groups', domain=[('is_portal', '=', True)], required=True,
|
||||
string='Portal', help="The portal that users can be added in or removed from."),
|
||||
'user_ids': fields.one2many('portal.wizard.user', 'wizard_id', string='Users'),
|
||||
'welcome_message': fields.text(string='Invitation Message',
|
||||
help="This text is included in the email sent to new users of the portal."),
|
||||
'goodbye_message': fields.text(string='Withdrawal Message',
|
||||
help="This text is included in the email sent to users withdrawn from the portal."),
|
||||
}
|
||||
|
||||
def _default_user_ids(self, cr, uid, context):
|
||||
""" determine default user_ids from the active records """
|
||||
def create_user_from_address(address):
|
||||
if isinstance(address, int):
|
||||
res_partner_obj = self.pool.get('res.partner')
|
||||
address = res_partner_obj.browse(cr, uid, address, context=context)
|
||||
lang = address.id and address.lang or 'en_US'
|
||||
partner_id = address.id
|
||||
|
||||
else:
|
||||
lang = address.parent_id and address.parent_id.lang or 'en_US'
|
||||
partner_id = address.parent_id and address.parent_id.id
|
||||
|
||||
return{
|
||||
'name': address.name,
|
||||
'email': extract_email(address.email),
|
||||
'lang': lang,
|
||||
'partner_id': partner_id,
|
||||
}
|
||||
|
||||
user_ids = []
|
||||
if context.get('active_model') == 'res.partner':
|
||||
partner_obj = self.pool.get('res.partner')
|
||||
partner_ids = context.get('active_ids', [])
|
||||
partners = partner_obj.browse(cr, uid, partner_ids, context)
|
||||
for p in partners:
|
||||
# add one user per contact, or one user if no contact
|
||||
if p.child_ids:
|
||||
user_ids.extend(map(create_user_from_address, p.child_ids))
|
||||
elif p.is_company == False and p.customer == True:
|
||||
user_ids.extend(map(create_user_from_address, [p.id]))
|
||||
else:
|
||||
user_ids.append({'lang': p.lang or 'en_US', 'parent_id': p.id})
|
||||
|
||||
return user_ids
|
||||
def _default_portal(self, cr, uid, context):
|
||||
portal_ids = self.pool.get('res.groups').search(cr, uid, [('is_portal', '=', True)])
|
||||
return portal_ids and portal_ids[0] or False
|
||||
|
||||
_defaults = {
|
||||
'user_ids': _default_user_ids
|
||||
'portal_id': _default_portal,
|
||||
}
|
||||
|
||||
def action_create(self, cr, uid, ids, context=None):
|
||||
""" create new users in portal(s), and notify them by email """
|
||||
# we copy the context to change the language for translating emails
|
||||
context0 = context or {}
|
||||
context0['noshortcut'] = True # prevent shortcut creation
|
||||
context = context0.copy()
|
||||
|
||||
user_obj = self.pool.get('res.users')
|
||||
user = user_obj.browse(cr, ROOT_UID, uid, context0)
|
||||
if not user.email:
|
||||
raise osv.except_osv(_('Email required'),
|
||||
_('You must have an email address in your User Preferences'
|
||||
' to send emails.'))
|
||||
|
||||
portal_obj = self.pool.get('res.portal')
|
||||
for wiz in self.browse(cr, uid, ids, context):
|
||||
# determine existing users
|
||||
login_cond = [('login', 'in', [u.email for u in wiz.user_ids])]
|
||||
existing_uids = user_obj.search(cr, ROOT_UID, login_cond)
|
||||
existing_users = user_obj.browse(cr, ROOT_UID, existing_uids)
|
||||
existing_logins = [u.login for u in existing_users]
|
||||
|
||||
# create new users in portal (skip existing logins)
|
||||
new_users_data = [ {
|
||||
'name': u.name,
|
||||
'login': u.email,
|
||||
'password': random_password(),
|
||||
'email': u.email,
|
||||
'lang': u.lang,
|
||||
'share': True,
|
||||
'action_id': wiz.portal_id.home_action_id and wiz.portal_id.home_action_id.id or False,
|
||||
'partner_id': u.partner_id and u.partner_id.id,
|
||||
'groups_id': [(6, 0, [])],
|
||||
} for u in wiz.user_ids if u.email not in existing_logins ]
|
||||
portal_obj.write(cr, ROOT_UID, [wiz.portal_id.id],
|
||||
{'users': [(0, 0, data) for data in new_users_data]}, context0)
|
||||
|
||||
# send email to all users (translated in their language)
|
||||
data = {
|
||||
'company': user.company_id.name,
|
||||
'message': wiz.message or "",
|
||||
'url': wiz.portal_id.url or _("(missing url)"),
|
||||
'db': cr.dbname,
|
||||
}
|
||||
mail_mail_obj = self.pool.get('mail.mail')
|
||||
dest_uids = user_obj.search(cr, ROOT_UID, login_cond)
|
||||
dest_users = user_obj.browse(cr, ROOT_UID, dest_uids)
|
||||
for dest_user in dest_users:
|
||||
context['lang'] = dest_user.lang
|
||||
data['login'] = dest_user.login
|
||||
data['password'] = dest_user.password
|
||||
data['name'] = dest_user.name
|
||||
|
||||
email_from = user.email
|
||||
email_to = dest_user.email
|
||||
subject = _(WELCOME_EMAIL_SUBJECT) % data
|
||||
body = _(WELCOME_EMAIL_BODY) % data
|
||||
mail_id = mail_mail_obj.create(cr, uid, {
|
||||
'email_from': email_from ,
|
||||
'email_to': email_to,
|
||||
'subject': subject,
|
||||
'state': 'outgoing',
|
||||
'body_html': '<pre>%s</pre>' % body}, context=context)
|
||||
|
||||
def onchange_portal_id(self, cr, uid, ids, portal_id, context=None):
|
||||
# for each partner, determine corresponding portal.wizard.user records
|
||||
res_partner = self.pool.get('res.partner')
|
||||
partner_ids = context and context.get('active_ids') or []
|
||||
contact_ids = set()
|
||||
user_changes = []
|
||||
for partner in res_partner.browse(cr, SUPERUSER_ID, partner_ids, context):
|
||||
for contact in (partner.child_ids or [partner]):
|
||||
# make sure that each contact appears at most once in the list
|
||||
if contact.id not in contact_ids:
|
||||
contact_ids.add(contact.id)
|
||||
in_portal = False
|
||||
if contact.user_ids:
|
||||
in_portal = portal_id in [g.id for g in contact.user_ids[0].groups_id]
|
||||
user_changes.append((0, 0, {
|
||||
'partner_id': contact.id,
|
||||
'email': contact.email,
|
||||
'in_portal': in_portal,
|
||||
}))
|
||||
return {'value': {'user_ids': user_changes}}
|
||||
|
||||
def action_apply(self, cr, uid, ids, context=None):
|
||||
wizard = self.browse(cr, uid, ids[0], context)
|
||||
portal_user_ids = [user.id for user in wizard.user_ids]
|
||||
self.pool.get('portal.wizard.user').action_apply(cr, uid, portal_user_ids, context)
|
||||
return {'type': 'ir.actions.act_window_close'}
|
||||
|
||||
wizard()
|
||||
|
||||
|
||||
|
||||
class wizard_user(osv.osv_memory):
|
||||
"""
|
||||
A model to configure users in the portal wizard.
|
||||
"""
|
||||
_name = 'res.portal.wizard.user'
|
||||
_name = 'portal.wizard.user'
|
||||
_description = 'Portal User Config'
|
||||
|
||||
_columns = {
|
||||
'wizard_id': fields.many2one('res.portal.wizard', required=True,
|
||||
string='Wizard'),
|
||||
'name': fields.char(size=64, required=True,
|
||||
string='User Name',
|
||||
help="The user's real name"),
|
||||
'email': fields.char(size=64, required=True,
|
||||
string='Email',
|
||||
help="Will be used as user login. "
|
||||
"Also necessary to send the account information to new users"),
|
||||
'lang': fields.selection(_lang_get, required=True,
|
||||
string='Language',
|
||||
help="The language for the user's user interface"),
|
||||
'partner_id': fields.many2one('res.partner',
|
||||
string='Partner'),
|
||||
'wizard_id': fields.many2one('portal.wizard', string='Wizard', required=True),
|
||||
'partner_id': fields.many2one('res.partner', string='Contact', required=True, readonly=True),
|
||||
'email': fields.char(size=240, string='Email'),
|
||||
'in_portal': fields.boolean('In Portal'),
|
||||
}
|
||||
|
||||
def _check_email(self, cr, uid, ids):
|
||||
""" check syntax of email address """
|
||||
for wuser in self.browse(cr, uid, ids):
|
||||
if not email_re.match(wuser.email): return False
|
||||
return True
|
||||
def create(self, cr, uid, values, context=None):
|
||||
""" overridden to update the partner's email (if necessary) """
|
||||
id = super(wizard_user, self).create(cr, uid, values, context)
|
||||
wuser = self.browse(cr, uid, id, context)
|
||||
if wuser.partner_id.email != wuser.email:
|
||||
wuser.partner_id.write({'email': wuser.email})
|
||||
return id
|
||||
|
||||
_constraints = [
|
||||
(_check_email, 'Invalid email address', ['email']),
|
||||
]
|
||||
def action_apply(self, cr, uid, ids, context=None):
|
||||
res_users = self.pool.get('res.users')
|
||||
for wizard_user in self.browse(cr, SUPERUSER_ID, ids, context):
|
||||
portal = wizard_user.wizard_id.portal_id
|
||||
user = self._retrieve_user(cr, SUPERUSER_ID, wizard_user, context)
|
||||
if wizard_user.in_portal:
|
||||
# create a user if necessary, and make sure it is in the portal group
|
||||
if not user:
|
||||
user = self._create_user(cr, SUPERUSER_ID, wizard_user, context)
|
||||
if (not user.active) or (portal not in user.groups_id):
|
||||
user.write({'active': True, 'groups_id': [(4, portal.id)]})
|
||||
wizard_user = self.browse(cr, SUPERUSER_ID, wizard_user.id, context)
|
||||
self._send_email(cr, uid, wizard_user, context)
|
||||
else:
|
||||
# remove the user (if it exists) from the portal group
|
||||
if user and (portal in user.groups_id):
|
||||
# if user belongs to portal only, deactivate it
|
||||
if len(user.groups_id) <= 1:
|
||||
user.write({'groups_id': [(3, portal.id)], 'active': False})
|
||||
else:
|
||||
user.write({'groups_id': [(3, portal.id)]})
|
||||
wizard_user = self.browse(cr, SUPERUSER_ID, wizard_user.id, context)
|
||||
self._send_email(cr, uid, wizard_user, context)
|
||||
|
||||
wizard_user()
|
||||
def _retrieve_user(self, cr, uid, wizard_user, context=None):
|
||||
""" retrieve the (possibly inactive) user corresponding to wizard_user.partner_id
|
||||
@param wizard_user: browse record of model portal.wizard.user
|
||||
@return: browse record of model res.users
|
||||
"""
|
||||
if wizard_user.partner_id.user_ids:
|
||||
return wizard_user.partner_id.user_ids[0]
|
||||
# the user may be inactive, search for it
|
||||
res_users = self.pool.get('res.users')
|
||||
domain = [('partner_id', '=', wizard_user.partner_id.id), ('active', '=', False)]
|
||||
user_ids = res_users.search(cr, uid, domain)
|
||||
return user_ids and res_users.browse(cr, uid, user_ids[0], context) or False
|
||||
|
||||
def _create_user(self, cr, uid, wizard_user, context=None):
|
||||
""" create a new user for wizard_user.partner_id
|
||||
@param wizard_user: browse record of model portal.wizard.user
|
||||
@return: browse record of model res.users
|
||||
"""
|
||||
res_users = self.pool.get('res.users')
|
||||
create_context = dict(context or {}, noshortcut=True) # to prevent shortcut creation
|
||||
values = {
|
||||
'login': extract_email(wizard_user.email),
|
||||
'password': random_password(),
|
||||
'partner_id': wizard_user.partner_id.id,
|
||||
'groups_id': [(6, 0, [])],
|
||||
'share': True,
|
||||
}
|
||||
user_id = res_users.create(cr, uid, values, context=create_context)
|
||||
return res_users.browse(cr, uid, user_id, context)
|
||||
|
||||
def _send_email(self, cr, uid, wizard_user, context=None):
|
||||
""" send notification email to a new/former portal user
|
||||
@param wizard_user: browse record of model portal.wizard.user
|
||||
@return: the id of the created mail.mail record
|
||||
"""
|
||||
this_context = context
|
||||
this_user = self.pool.get('res.users').browse(cr, SUPERUSER_ID, uid, context)
|
||||
if not this_user.email:
|
||||
raise osv.except_osv(_('Email required'),
|
||||
_('You must have an email address in your User Preferences to send emails.'))
|
||||
|
||||
# determine subject and body in the portal user's language
|
||||
url = self.pool.get('ir.config_parameter').get_param(cr, SUPERUSER_ID, 'web.base.url', context=this_context)
|
||||
user = self._retrieve_user(cr, SUPERUSER_ID, wizard_user, context)
|
||||
context = dict(this_context or {}, lang=user.lang)
|
||||
data = {
|
||||
'company': this_user.company_id.name,
|
||||
'portal': wizard_user.wizard_id.portal_id.name,
|
||||
'welcome_message': wizard_user.wizard_id.welcome_message or "",
|
||||
'goodbye_message': wizard_user.wizard_id.goodbye_message or "",
|
||||
'url': url or _("(missing url)"),
|
||||
'db': cr.dbname,
|
||||
'login': user.login,
|
||||
'password': user.password,
|
||||
'name': user.name
|
||||
}
|
||||
if wizard_user.in_portal:
|
||||
subject = _(WELCOME_EMAIL_SUBJECT) % data
|
||||
body = _(WELCOME_EMAIL_BODY) % data
|
||||
else:
|
||||
subject = _(GOODBYE_EMAIL_SUBJECT) % data
|
||||
body = _(GOODBYE_EMAIL_BODY) % data
|
||||
|
||||
mail_mail = self.pool.get('mail.mail')
|
||||
mail_values = {
|
||||
'email_from': this_user.email,
|
||||
'email_to': user.email,
|
||||
'subject': subject,
|
||||
'body_html': '<pre>%s</pre>' % body,
|
||||
'state': 'outgoing',
|
||||
}
|
||||
return mail_mail.create(cr, uid, mail_values, context=this_context)
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
|
|
@ -3,28 +3,34 @@
|
|||
<data>
|
||||
<!-- wizard action on res.partner -->
|
||||
<act_window id="partner_wizard_action"
|
||||
name="Add Portal Access"
|
||||
name="Portal Access Management"
|
||||
src_model="res.partner"
|
||||
res_model="res.portal.wizard"
|
||||
res_model="portal.wizard"
|
||||
view_type="form" view_mode="form"
|
||||
key2="client_action_multi" target="new"
|
||||
groups="group_portal_officer"/>
|
||||
groups="base.group_partner_manager"/>
|
||||
|
||||
<!-- wizard view -->
|
||||
<record id="wizard_view" model="ir.ui.view">
|
||||
<field name="name">Add Portal Access</field>
|
||||
<field name="model">res.portal.wizard</field>
|
||||
<field name="name">Portal Access Management</field>
|
||||
<field name="model">portal.wizard</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Add Portal Access" version="7.0">
|
||||
<group col="4">
|
||||
<field name="portal_id" widget="selection"/>
|
||||
<form string="Portal Access Management" version="7.0">
|
||||
<group>
|
||||
<field name="portal_id" widget="selection" on_change="onchange_portal_id(portal_id, context)"/>
|
||||
</group>
|
||||
<div>
|
||||
Select which contacts should belong to the portal in the list below.
|
||||
The email address of each selected contact must be valid and unique.
|
||||
If necessary, you can fix any contact's email address directly in the list.
|
||||
</div>
|
||||
<field name="user_ids"/>
|
||||
<label string="The following text will be included in the welcome email sent to users."/>
|
||||
<field name="message"/>
|
||||
<field name="welcome_message"
|
||||
placeholder="This text is included in the email sent to new portal users."/>
|
||||
<field name="goodbye_message"
|
||||
placeholder="This text is included in the email sent to users withdrawn from the portal."/>
|
||||
<footer>
|
||||
<button string="Send Invitations"
|
||||
name="action_create" type="object" class="oe_highlight" />
|
||||
<button string="Apply" name="action_apply" type="object" class="oe_highlight"/>
|
||||
or
|
||||
<button string="Cancel" class="oe_link" special="cancel" />
|
||||
</footer>
|
||||
|
@ -35,32 +41,15 @@
|
|||
<!-- wizard user list view -->
|
||||
<record id="wizard_user_tree_view" model="ir.ui.view">
|
||||
<field name="name">Portal Users</field>
|
||||
<field name="model">res.portal.wizard.user</field>
|
||||
<field name="model">portal.wizard.user</field>
|
||||
<field name="arch" type="xml">
|
||||
<!-- the attribute 'editable' is set below to make the elements
|
||||
editable in the web client 6.0 -->
|
||||
<tree string="Portal Users" editable="bottom">
|
||||
<field name="name"/>
|
||||
<field name="email"/>
|
||||
<!-- the contact list is editable, but one cannot add or delete rows -->
|
||||
<tree string="Contacts" editable="bottom" create="false" delete="false">
|
||||
<field name="partner_id"/>
|
||||
<field name="email"/>
|
||||
<field name="in_portal"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<!-- wizard user form view -->
|
||||
<record id="wizard_user_form_view" model="ir.ui.view">
|
||||
<field name="name">Portal User</field>
|
||||
<field name="model">res.portal.wizard.user</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Portal User" version="7.0">
|
||||
<group colspan="2" col="2">
|
||||
<field name="name"/>
|
||||
<field name="email"/>
|
||||
<field name="lang"/>
|
||||
<field name="partner_id"/>
|
||||
</group>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
</data>
|
||||
</openerp>
|
||||
|
|
|
@ -44,9 +44,6 @@ class share_wizard_portal(osv.TransientModel):
|
|||
'group_ids': fields.many2many('res.groups', 'share_wizard_res_group_rel', 'share_id', 'group_id', 'Existing groups', domain=[('share', '=', False)]),
|
||||
}
|
||||
|
||||
def is_portal_manager(self, cr, uid, context=None):
|
||||
return self.has_group(cr, uid, module='portal', group_xml_id='group_portal_manager', context=context)
|
||||
|
||||
def _check_preconditions(self, cr, uid, wizard_data, context=None):
|
||||
if wizard_data.user_type == 'existing':
|
||||
self._assert(wizard_data.user_ids,
|
||||
|
@ -122,16 +119,14 @@ class share_wizard_portal(osv.TransientModel):
|
|||
# alter the rules of the groups so they can see the shared data
|
||||
if wizard_data.group_ids:
|
||||
# get the list of portals and the related groups to install their menus.
|
||||
Portals = self.pool.get('res.portal')
|
||||
all_portals = Portals.browse(cr, UID_ROOT, Portals.search(cr, UID_ROOT, [])) #no context!
|
||||
all_portal_group_ids = [p.group_id.id for p in all_portals]
|
||||
res_groups = self.pool.get('res.groups')
|
||||
all_portal_group_ids = res_groups.search(cr, UID_ROOT, [('is_portal', '=', True)])
|
||||
|
||||
# populate result lines with the users of each group and
|
||||
# setup the menu for portal groups
|
||||
for group in wizard_data.group_ids:
|
||||
if group.id in all_portal_group_ids:
|
||||
portal = all_portals[all_portal_group_ids.index(group.id)]
|
||||
self._create_shared_data_menu(cr, uid, wizard_data, portal, context=context)
|
||||
self._create_shared_data_menu(cr, uid, wizard_data, group.id, context=context)
|
||||
|
||||
for user in group.users:
|
||||
new_line = {'user_id': user.id,
|
||||
|
|
|
@ -36,12 +36,12 @@
|
|||
<field name="inherit_id" ref="share.share_step2_form"/>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//field[@name='result_line_ids']//field[@name='login']" position="after">
|
||||
<field name="share_url" groups="portal.group_portal_manager"/>
|
||||
<field name="share_url" groups="base.group_no_one"/>
|
||||
</xpath>
|
||||
<xpath expr="//field[@name='result_line_ids']" position="after">
|
||||
<newline/>
|
||||
<group string="Details">
|
||||
<field name="share_root_url" groups="portal.group_portal_manager"/>
|
||||
<group string="Details" groups="base.group_no_one">
|
||||
<field name="share_root_url"/>
|
||||
</group>
|
||||
</xpath>
|
||||
</field>
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
|
||||
access_crm_claim,crm.claim,crm_claim.model_crm_claim,portal.group_portal_member,1,0,0,0
|
||||
access_crm_claim_stage,crm.claim.stage,crm_claim.model_crm_claim_stage,portal.group_portal_member,1,0,0,0
|
||||
access_crm_claim,crm.claim,crm_claim.model_crm_claim,portal.group_portal,1,0,0,0
|
||||
access_crm_claim_stage,crm.claim.stage,crm_claim.model_crm_claim_stage,portal.group_portal,1,0,0,0
|
||||
|
|
|
|
@ -6,7 +6,7 @@
|
|||
<field name="name">Portal Personal Claims</field>
|
||||
<field ref="crm_claim.model_crm_claim" name="model_id"/>
|
||||
<field name="domain_force">[('partner_id','child_of',user.partner_id.id)]</field>
|
||||
<field name="groups" eval="[(4, ref('portal.group_portal_member'))]"/>
|
||||
<field name="groups" eval="[(4, ref('portal.group_portal'))]"/>
|
||||
</record>
|
||||
|
||||
</data>
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
|
||||
access_event,event,event.model_event_event,portal.group_portal_member,1,0,0,0
|
||||
access_registration,registration,event.model_event_registration,portal.group_portal_member,1,0,0,0
|
||||
access_event,event,event.model_event_event,portal.group_portal,1,0,0,0
|
||||
access_registration,registration,event.model_event_registration,portal.group_portal,1,0,0,0
|
||||
|
|
|
|
@ -6,14 +6,14 @@
|
|||
<field name="name">Portal Visible Events</field>
|
||||
<field ref="event.model_event_event" name="model_id"/>
|
||||
<field name="domain_force">[('visibility', '=', 'public')]</field>
|
||||
<field name="groups" eval="[(4, ref('portal.group_portal_member'))]"/>
|
||||
<field name="groups" eval="[(4, ref('portal.group_portal'))]"/>
|
||||
</record>
|
||||
|
||||
<record id="portal_registration_rule" model="ir.rule">
|
||||
<field name="name">Portal Personal Registrations</field>
|
||||
<field ref="event.model_event_registration" name="model_id"/>
|
||||
<field name="domain_force">[('partner_id','child_of',user.partner_id.id)]</field>
|
||||
<field name="groups" eval="[(4, ref('portal.group_portal_member'))]"/>
|
||||
<field name="groups" eval="[(4, ref('portal.group_portal'))]"/>
|
||||
</record>
|
||||
|
||||
</data>
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
|
||||
access_hr_employee_user,hr.employee user,hr.model_hr_employee,portal.group_portal_member,1,0,0,0
|
||||
access_res_partner,res.partner,base.model_res_partner,portal.group_portal_member,1,0,0,0
|
||||
access_res_partner_address,res.partner_address,base.model_res_partner_address,portal.group_portal_member,1,0,0,0
|
||||
access_res_partner_category,res.partner_category,base.model_res_partner_category,portal.group_portal_member,1,0,0,0
|
||||
access_res_partner_title,res.partner_title,base.model_res_partner_title,portal.group_portal_member,1,0,0,0
|
||||
access_hr_employee_user,hr.employee user,hr.model_hr_employee,portal.group_portal,1,0,0,0
|
||||
access_res_partner,res.partner,base.model_res_partner,portal.group_portal,1,0,0,0
|
||||
access_res_partner_address,res.partner_address,base.model_res_partner_address,portal.group_portal,1,0,0,0
|
||||
access_res_partner_category,res.partner_category,base.model_res_partner_category,portal.group_portal,1,0,0,0
|
||||
access_res_partner_title,res.partner_title,base.model_res_partner_title,portal.group_portal,1,0,0,0
|
||||
|
|
|
|
@ -1,5 +1,5 @@
|
|||
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
|
||||
access_task,tasks,project.model_project_task,portal.group_portal_member,1,0,0,0
|
||||
access_task_type,task_type,project.model_project_task_type,portal.group_portal_member,1,0,0,0
|
||||
access_task_work,task_work,project.model_project_task_work,portal.group_portal_member,1,0,0,0
|
||||
access_project_category,project_category,project.model_project_category,portal.group_portal_member,1,0,0,0
|
||||
access_task,tasks,project.model_project_task,portal.group_portal,1,0,0,0
|
||||
access_task_type,task_type,project.model_project_task_type,portal.group_portal,1,0,0,0
|
||||
access_task_work,task_work,project.model_project_task_work,portal.group_portal,1,0,0,0
|
||||
access_project_category,project_category,project.model_project_category,portal.group_portal,1,0,0,0
|
||||
|
|
|
|
@ -6,7 +6,7 @@
|
|||
<field name="name">Portal Personal Task</field>
|
||||
<field ref="project.model_project_task" name="model_id"/>
|
||||
<field name="domain_force">[('partner_id','child_of',user.partner_id.id)]</field>
|
||||
<field name="groups" eval="[(4, ref('portal.group_portal_member'))]"/>
|
||||
<field name="groups" eval="[(4, ref('portal.group_portal'))]"/>
|
||||
</record>
|
||||
|
||||
</data>
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue