[MERGE] trunk

bzr revid: sle@openerp.com-20140220135606-qks6te5keyca9chx
This commit is contained in:
Simon Lejeune 2014-02-20 14:56:06 +01:00
commit 1650919181
11 changed files with 11031 additions and 62 deletions

10849
addons/account/i18n/fr_CA.po Normal file

File diff suppressed because it is too large Load Diff

View File

@ -348,11 +348,7 @@ class mail_thread(osv.AbstractModel):
message_follower_ids = values.get('message_follower_ids') or [] # webclient can send None or False
message_follower_ids.append([4, pid])
values['message_follower_ids'] = message_follower_ids
# add operation to ignore access rule checking for subscription
context_operation = dict(context, operation='create')
else:
context_operation = context
thread_id = super(mail_thread, self).create(cr, uid, values, context=context_operation)
thread_id = super(mail_thread, self).create(cr, uid, values, context=context)
# automatic logging unless asked not to (mainly for various testing purpose)
if not context.get('mail_create_nolog'):
@ -1558,12 +1554,11 @@ class mail_thread(osv.AbstractModel):
user_pid = self.pool.get('res.users').browse(cr, uid, uid, context=context).partner_id.id
if set(partner_ids) == set([user_pid]):
if context.get('operation', '') != 'create':
try:
self.check_access_rights(cr, uid, 'read')
self.check_access_rule(cr, uid, ids, 'read')
except (osv.except_osv, orm.except_orm):
return False
try:
self.check_access_rights(cr, uid, 'read')
self.check_access_rule(cr, uid, ids, 'read')
except (osv.except_osv, orm.except_orm):
return False
else:
self.check_access_rights(cr, uid, 'write')
self.check_access_rule(cr, uid, ids, 'write')

View File

@ -72,12 +72,6 @@ class note_note(osv.osv):
def onclick_note_not_done(self, cr, uid, ids, context=None):
return self.write(cr, uid, ids, {'open': True}, context=context)
#used for undisplay the follower if it's the current user
def _get_my_current_partner(self, cr, uid, ids, name, args, context=None):
user = self.pool.get('res.users').browse(cr, uid, uid, context=context)
pid = user.partner_id and user.partner_id.id or False
return dict.fromkeys(ids, pid)
#return the default stage for the uid user
def _get_default_stage_id(self,cr,uid,context=None):
ids = self.pool.get('note.stage').search(cr,uid,[('user_id','=',uid)], context=context)
@ -101,6 +95,7 @@ class note_note(osv.osv):
'name': fields.function(_get_note_first_line,
string='Note Summary',
type='text', store=True),
'user_id': fields.many2one('res.users', 'Owner'),
'memo': fields.html('Note Content'),
'sequence': fields.integer('Sequence'),
'stage_id': fields.function(_get_stage_per_user,
@ -113,9 +108,9 @@ class note_note(osv.osv):
'date_done': fields.date('Date done'),
'color': fields.integer('Color Index'),
'tag_ids' : fields.many2many('note.tag','note_tags_rel','note_id','tag_id','Tags'),
'current_partner_id' : fields.function(_get_my_current_partner, type="many2one", relation='res.partner', string="Owner"),
}
_defaults = {
'user_id': lambda self, cr, uid, ctx=None: uid,
'open' : 1,
'stage_id' : _get_default_stage_id,
}

View File

@ -49,7 +49,6 @@
<field name="open"/>
<field name="memo"/>
<field name="date_done"/>
<field name="current_partner_id"/>
<field name="message_follower_ids"/>
<field name="tag_ids"/>
<templates>
@ -82,7 +81,7 @@
<field name="tag_ids"/>
<div class="oe_right">
<t t-foreach="record.message_follower_ids.raw_value" t-as="follower">
<img t-if="record.current_partner_id.raw_value!=follower" t-att-src="kanban_image('res.partner', 'image_small', follower)" width="24" height="24" class="oe_kanban_avatar" t-att-data-member_id="follower"/>
<img t-att-src="kanban_image('res.partner', 'image_small', follower)" width="24" height="24" class="oe_kanban_avatar" t-att-data-member_id="follower"/>
</t>
</div>
<div class="oe_clear"></div>

View File

@ -1,23 +1,30 @@
<?xml version="1.0"?>
<openerp>
<data>
<record id="note_note_rule_global" model="ir.rule">
<field name="name">Only followers can access a sticky notes</field>
<field ref="model_note_note" name="model_id"/>
<field name="domain_force">[('message_follower_ids','=',user.partner_id.id)]</field>
<field eval="True" name="global"/>
<field eval="1" name="perm_unlink"/>
<field eval="0" name="perm_write"/>
<field eval="1" name="perm_read"/>
<field eval="0" name="perm_create"/>
</record>
<record id="note_note_rule_global" model="ir.rule">
<field name="name">Only followers can access a sticky notes</field>
<field name="model_id" ref="model_note_note"/>
<field name="domain_force">['|', ('user_id', '=', user.id), ('message_follower_ids', '=', user.partner_id.id)]</field>
<field name="global" eval="True"/>
<field name="perm_create" eval="False"/>
<field name="perm_unlink" eval="False"/>
</record>
<record id="note_note_create_unlink_global" model="ir.rule">
<field name="name">note: create / unlink: responsible</field>
<field name="model_id" ref="model_note_note"/>
<field name="domain_force">[('user_id', '=', user.id)]</field>
<field name="global" eval="True"/>
<field name="perm_write" eval="False"/>
<field name="perm_read" eval="False"/>
</record>
<record id="note_stage_rule_global" model="ir.rule">
<field name="name">Each user have his stage name</field>
<field name="model_id" ref="model_note_stage"/>
<field name="domain_force">['|',('user_id','=',False),('user_id','=',user.id)]</field>
<field name="global" eval="True"/>
</record>
<record id="note_stage_rule_global" model="ir.rule">
<field name="name">Each user have his stage name</field>
<field ref="model_note_stage" name="model_id"/>
<field name="domain_force">['|',('user_id','=',False),('user_id','=',user.id)]</field>
<field eval="True" name="global"/>
</record>
</data>
</openerp>

View File

@ -0,0 +1,137 @@
# Finnish translation for openobject-addons
# Copyright (c) 2014 Rosetta Contributors and Canonical Ltd 2014
# This file is distributed under the same license as the openobject-addons package.
# FIRST AUTHOR <EMAIL@ADDRESS>, 2014.
#
msgid ""
msgstr ""
"Project-Id-Version: openobject-addons\n"
"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
"POT-Creation-Date: 2012-12-21 17:06+0000\n"
"PO-Revision-Date: 2014-02-19 10:26+0000\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: Finnish <fi@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: 2014-02-20 05:14+0000\n"
"X-Generator: Launchpad (build 16916)\n"
#. module: web_linkedin
#: view:sale.config.settings:0
msgid "here:"
msgstr ""
#. module: web_linkedin
#: field:sale.config.settings,api_key:0
msgid "API Key"
msgstr ""
#. module: web_linkedin
#. openerp-web
#: code:addons/web_linkedin/static/src/js/linkedin.js:331
#, python-format
msgid "No results found"
msgstr "Haku ei tuottanut tuloksia."
#. module: web_linkedin
#. openerp-web
#: code:addons/web_linkedin/static/src/js/linkedin.js:62
#, python-format
msgid "Ok"
msgstr ""
#. module: web_linkedin
#: view:sale.config.settings:0
msgid "Log into LinkedIn."
msgstr "Kirjaudun LinkedIn:iin."
#. module: web_linkedin
#. openerp-web
#: code:addons/web_linkedin/static/src/xml/linkedin.xml:13
#, python-format
msgid "People"
msgstr "Henkilöt"
#. module: web_linkedin
#: model:ir.model,name:web_linkedin.model_sale_config_settings
msgid "sale.config.settings"
msgstr ""
#. module: web_linkedin
#: field:sale.config.settings,server_domain:0
msgid "unknown"
msgstr "tuntematon"
#. module: web_linkedin
#: view:sale.config.settings:0
msgid "https://www.linkedin.com/secure/developer"
msgstr ""
#. module: web_linkedin
#. openerp-web
#: code:addons/web_linkedin/static/src/xml/linkedin.xml:15
#, python-format
msgid "Companies"
msgstr "Yritykset"
#. module: web_linkedin
#: view:sale.config.settings:0
msgid "API key"
msgstr ""
#. module: web_linkedin
#: view:sale.config.settings:0
msgid "Copy the"
msgstr ""
#. module: web_linkedin
#. openerp-web
#: code:addons/web_linkedin/static/src/js/linkedin.js:263
#, python-format
msgid "LinkedIn search"
msgstr "LinkedIn-haku"
#. module: web_linkedin
#. openerp-web
#: code:addons/web_linkedin/static/src/xml/linkedin.xml:31
#, python-format
msgid ""
"LinkedIn access was not enabled on this server.\n"
" Please ask your administrator to configure it in Settings > "
"Configuration > Sales > Social Network Integration."
msgstr ""
#. module: web_linkedin
#: view:sale.config.settings:0
msgid ""
"To use the LinkedIn module with this database, an API Key is required. "
"Please follow this procedure:"
msgstr ""
#. module: web_linkedin
#. openerp-web
#: code:addons/web_linkedin/static/src/js/linkedin.js:60
#, python-format
msgid "LinkedIn is not enabled"
msgstr "LinkedIn ei ole vahvistettu käyttöön"
#. module: web_linkedin
#: view:sale.config.settings:0
msgid "Add a new application and fill the form:"
msgstr "Lisää uusi hakemus ja täytä lomake:"
#. module: web_linkedin
#: view:sale.config.settings:0
msgid "Go to this URL:"
msgstr "Siirry tähän URL-osoitteeseen:"
#. module: web_linkedin
#: view:sale.config.settings:0
msgid "The programming tool is Javascript"
msgstr "Ohjelmointityökalu on JavaScript"
#. module: web_linkedin
#: view:sale.config.settings:0
msgid "JavaScript API Domain:"
msgstr "JavaScript API Toimialue:"

View File

@ -1,22 +1,11 @@
import os
import openerp
inject = [
("openerp.website.Tour", os.path.join(os.path.dirname(__file__), '../static/src/js/website.tour.js')),
("openerp.website.Tour.LoginEdit", os.path.join(os.path.dirname(__file__), "../static/src/js/website.tour.test.admin.js")),
]
import openerp.tests
class TestUi(openerp.tests.HttpCase):
def test_01_pubic_homepage(self):
self.phantom_js("/", "console.log('ok')", "openerp.website.snippet");
def test_02_public_login_logout(self):
# Page injection works but i suspect multiple files doesnt
return
self.phantom_js("/", "openerp.website.Tour.run_test('login_edit')", "openerp.website.Tour", inject=inject);
def test_01_public_homepage(self):
self.phantom_js("/", "console.log('ok')", "openerp.website.snippet")
def test_03_admin_homepage(self):
self.phantom_js("/", "console.log('ok')", "openerp.website.editor", login='admin');
self.phantom_js("/", "console.log('ok')", "openerp.website.editor", login='admin')
def test_04_admin_tour_banner(self):
self.phantom_js("/", "openerp.website.Tour.run_test('banner')", "openerp.website.Tour", login='admin')

View File

@ -1,4 +1,4 @@
import openerp
import openerp.tests
class TestUi(openerp.tests.HttpCase):
def test_admin(self):

View File

@ -1,4 +1,4 @@
import openerp
import openerp.tests
class TestUi(openerp.tests.HttpCase):
def test_admin(self):

View File

@ -1,4 +1,4 @@
import openerp
import openerp.tests
inject = [
"./../../../website/static/src/js/website.tour.test.js",

View File

@ -1,6 +1,8 @@
import os
import openerp
import unittest2
import openerp.tests
inject = [
("openerp.website.Tour", os.path.join(os.path.dirname(__file__), '../../website/static/src/js/website.tour.js')),
@ -9,20 +11,16 @@ inject = [
class TestUi(openerp.tests.HttpCase):
def test_01_admin_shop_tour(self):
# Works locally probably due to a race condition on openerp.website.Tour.Shop
# object should only be define once ready
return
self.phantom_js("/", "openerp.website.Tour.run_test('shop')", "openerp.website.Tour.Shop", login="admin")
def test_02_admin_checkout(self):
return
self.phantom_js("/", "openerp.website.Tour.run_test('shop_buy_product')", "openerp.website.Tour", login="admin")
@unittest2.expectedFailure
def test_03_demo_checkout(self):
return
self.phantom_js("/", "openerp.website.Tour.run_test('shop_buy_product')", "openerp.website.Tour.ShopTest", login="demo", inject=inject)
@unittest2.expectedFailure
def test_04_public_checkout(self):
return
self.phantom_js("/", "openerp.website.Tour.run_test('shop_buy_product')", "openerp.website.Tour.ShopTest", inject=inject)