diff --git a/doc/changelog.rst b/doc/changelog.rst index 57a54eba506..9a84e5dfd00 100644 --- a/doc/changelog.rst +++ b/doc/changelog.rst @@ -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`. diff --git a/openerp/addons/base/i18n/es_MX.po b/openerp/addons/base/i18n/es_MX.po index 9ea0e445a62..9544457d81c 100644 --- a/openerp/addons/base/i18n/es_MX.po +++ b/openerp/addons/base/i18n/es_MX.po @@ -8,14 +8,15 @@ msgstr "" "Project-Id-Version: openobject-server\n" "Report-Msgid-Bugs-To: FULL NAME \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 \n" +"PO-Revision-Date: 2013-07-25 03:08+0000\n" +"Last-Translator: Federico Manuel Echeverri Choux - ( Vauxoo ) " +"\n" "Language-Team: Spanish (Mexico) \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 diff --git a/openerp/addons/base/ir/ir_attachment.py b/openerp/addons/base/ir/ir_attachment.py index f00cc3f85ed..704488f6938 100644 --- a/openerp/addons/base/ir/ir_attachment.py +++ b/openerp/addons/base/ir/ir_attachment.py @@ -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]: diff --git a/openerp/osv/fields.py b/openerp/osv/fields.py index 4e8eedf718b..3f0642c9229 100644 --- a/openerp/osv/fields.py +++ b/openerp/osv/fields.py @@ -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