diff --git a/addons/account/account.py b/addons/account/account.py index 1ab819c01c6..cd9527ff903 100644 --- a/addons/account/account.py +++ b/addons/account/account.py @@ -1938,15 +1938,15 @@ class account_tax(osv.osv): # 'base_code_id': fields.many2one('account.tax.code', 'Account Base Code', help="Use this code for the tax declaration."), 'tax_code_id': fields.many2one('account.tax.code', 'Account Tax Code', help="Use this code for the tax declaration."), - 'base_sign': fields.float('Base Code Sign', help="Usually 1 or -1."), - 'tax_sign': fields.float('Tax Code Sign', help="Usually 1 or -1."), + 'base_sign': fields.float('Base Code Sign', help="Usually 1 or -1.", digits_compute=get_precision_tax()), + 'tax_sign': fields.float('Tax Code Sign', help="Usually 1 or -1.", digits_compute=get_precision_tax()), # Same fields for refund invoices 'ref_base_code_id': fields.many2one('account.tax.code', 'Refund Base Code', help="Use this code for the tax declaration."), 'ref_tax_code_id': fields.many2one('account.tax.code', 'Refund Tax Code', help="Use this code for the tax declaration."), - 'ref_base_sign': fields.float('Refund Base Code Sign', help="Usually 1 or -1."), - 'ref_tax_sign': fields.float('Refund Tax Code Sign', help="Usually 1 or -1."), + 'ref_base_sign': fields.float('Refund Base Code Sign', help="Usually 1 or -1.", digits_compute=get_precision_tax()), + 'ref_tax_sign': fields.float('Refund Tax Code Sign', help="Usually 1 or -1.", digits_compute=get_precision_tax()), 'include_base_amount': fields.boolean('Included in base amount', help="Indicates if the amount of tax must be included in the base amount for the computation of the next taxes"), 'company_id': fields.many2one('res.company', 'Company', required=True), 'description': fields.char('Tax Code'), diff --git a/addons/calendar/calendar.py b/addons/calendar/calendar.py index 784358dceed..7dfbc3a4917 100644 --- a/addons/calendar/calendar.py +++ b/addons/calendar/calendar.py @@ -774,7 +774,11 @@ class calendar_event(osv.Model): result[event] = "" return result + # retro compatibility function def _rrule_write(self, cr, uid, ids, field_name, field_value, args, context=None): + return self._set_rulestring(self, cr, uid, ids, field_name, field_value, args, context=context) + + def _set_rulestring(self, cr, uid, ids, field_name, field_value, args, context=None): if not isinstance(ids, list): ids = [ids] data = self._get_empty_rrule_data() @@ -812,7 +816,7 @@ class calendar_event(osv.Model): 'class': fields.selection([('public', 'Public'), ('private', 'Private'), ('confidential', 'Public for Employees')], 'Privacy', states={'done': [('readonly', True)]}), 'location': fields.char('Location', help="Location of Event", track_visibility='onchange', states={'done': [('readonly', True)]}), 'show_as': fields.selection([('free', 'Free'), ('busy', 'Busy')], 'Show Time as', states={'done': [('readonly', True)]}), - 'rrule': fields.function(_get_rulestring, type='char', fnct_inv=_rrule_write, store=True, string='Recurrent Rule'), + 'rrule': fields.function(_get_rulestring, type='char', fnct_inv=_set_rulestring, store=True, string='Recurrent Rule'), 'rrule_type': fields.selection([('daily', 'Day(s)'), ('weekly', 'Week(s)'), ('monthly', 'Month(s)'), ('yearly', 'Year(s)')], 'Recurrency', states={'done': [('readonly', True)]}, help="Let the event automatically repeat at that interval"), 'recurrency': fields.boolean('Recurrent', help="Recurrent Meeting"), 'recurrent_id': fields.integer('Recurrent ID'), @@ -1169,7 +1173,7 @@ class calendar_event(osv.Model): #repeat monthly by nweekday ((weekday, weeknumber), ) if r._bynweekday: data['week_list'] = day_list[r._bynweekday[0][0]].upper() - data['byday'] = r._bynweekday[0][1] + data['byday'] = str(r._bynweekday[0][1]) data['month_by'] = 'day' data['rrule_type'] = 'monthly' diff --git a/addons/calendar/test/calendar_test.yml b/addons/calendar/test/calendar_test.yml index 1454a635a4f..484fee31720 100644 --- a/addons/calendar/test/calendar_test.yml +++ b/addons/calendar/test/calendar_test.yml @@ -65,3 +65,20 @@ - !python {model: calendar.event}: | self.write(cr, uid, [ref("calendar_event_alldaytestevent0")], {'alarm_ids': [(6,0,[ref("res_alarm_daybeforeeventstarts0")])]}) +- + I create a recuring rule for my event +- + !record {model: crm.meeting, id: crm_meeting_sprintreview1}: + name: Begin of month meeting + date: !eval time.strftime('%Y-%m-%d 12:00:00') + recurrency: true + rrule: FREQ=MONTHLY;INTERVAL=1;COUNT=12;BYDAY=1MO +- + I check that the attributes are set correctly +- + !assert {model: crm.meeting, id: crm_meeting_sprintreview1}: + - rrule_type == 'monthly' + - count == 12 + - select1 == 'day' + - byday == '1' + - week_list == 'MO' diff --git a/addons/pad/static/src/js/pad.js b/addons/pad/static/src/js/pad.js index 2d7f2c2737f..4c8b7d6fa26 100644 --- a/addons/pad/static/src/js/pad.js +++ b/addons/pad/static/src/js/pad.js @@ -51,9 +51,7 @@ openerp.pad = function(instance) { this._dirty_flag = true; } else { this.content = '