[MERGE] Sync with trunk

bzr revid: tde@openerp.com-20130725083500-xp21mgp9w2cu8vzi
This commit is contained in:
Thibault Delavallée 2013-07-25 10:35:00 +02:00
commit 7c5429e0d1
4 changed files with 42 additions and 8 deletions

View File

@ -7,6 +7,8 @@ Changelog
-------
- Cleaned and slightly refactored ``ir.actions.server``
- Added MONTHS attribute on fields.date and fields.datetime, holding the list
(month_number, month_name)
- Almost removed ``LocalService()``. For reports,
``openerp.osv.orm.Model.print_report()`` can be used. For workflows, see
:ref:`orm-workflows`.

View File

@ -8,14 +8,15 @@ msgstr ""
"Project-Id-Version: openobject-server\n"
"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
"POT-Creation-Date: 2012-12-21 17:04+0000\n"
"PO-Revision-Date: 2012-09-07 01:11+0000\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"PO-Revision-Date: 2013-07-25 03:08+0000\n"
"Last-Translator: Federico Manuel Echeverri Choux - ( Vauxoo ) "
"<echeverrifm@gmail.com>\n"
"Language-Team: Spanish (Mexico) <es_MX@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: 2013-07-06 05:53+0000\n"
"X-Generator: Launchpad (build 16696)\n"
"X-Launchpad-Export-Date: 2013-07-25 05:12+0000\n"
"X-Generator: Launchpad (build 16700)\n"
#. module: base
#: model:ir.module.module,description:base.module_account_check_writing
@ -613,7 +614,7 @@ msgstr ""
#. module: base
#: field:res.country,name:0
msgid "Country Name"
msgstr ""
msgstr "Nombre del país"
#. module: base
#: model:res.country,name:base.co

View File

@ -233,10 +233,10 @@ class ir_attachment(osv.osv):
targets = cr.dictfetchall()
model_attachments = {}
for target_dict in targets:
if not (target_dict['res_id'] and target_dict['res_model']):
if not target_dict['res_model']:
continue
# model_attachments = { 'model': { 'res_id': [id1,id2] } }
model_attachments.setdefault(target_dict['res_model'],{}).setdefault(target_dict['res_id'],set()).add(target_dict['id'])
model_attachments.setdefault(target_dict['res_model'],{}).setdefault(target_dict['res_id'] or 0, set()).add(target_dict['id'])
# To avoid multiple queries for each attachment found, checks are
# performed in batch as much as possible.
@ -250,7 +250,7 @@ class ir_attachment(osv.osv):
# filter ids according to what access rules permit
target_ids = targets.keys()
allowed_ids = self.pool[model].search(cr, uid, [('id', 'in', target_ids)], context=context)
allowed_ids = [0] + self.pool[model].search(cr, uid, [('id', 'in', target_ids)], context=context)
disallowed_ids = set(target_ids).difference(allowed_ids)
for res_id in disallowed_ids:
for attach_id in targets[res_id]:

View File

@ -270,6 +270,21 @@ class float(_column):
class date(_column):
_type = 'date'
MONTHS = [
('01', 'January'),
('02', 'February'),
('03', 'March'),
('04', 'April'),
('05', 'May'),
('06', 'June'),
('07', 'July'),
('08', 'August'),
('09', 'September'),
('10', 'October'),
('11', 'November'),
('12', 'December')
]
@staticmethod
def today(*args):
""" Returns the current date in a format fit for being a
@ -319,6 +334,22 @@ class date(_column):
class datetime(_column):
_type = 'datetime'
MONTHS = [
('01', 'January'),
('02', 'February'),
('03', 'March'),
('04', 'April'),
('05', 'May'),
('06', 'June'),
('07', 'July'),
('08', 'August'),
('09', 'September'),
('10', 'October'),
('11', 'November'),
('12', 'December')
]
@staticmethod
def now(*args):
""" Returns the current datetime in a format fit for being a