diff --git a/addons/account/account_invoice.py b/addons/account/account_invoice.py index e5814cdb065..02903ea8f33 100644 --- a/addons/account/account_invoice.py +++ b/addons/account/account_invoice.py @@ -201,7 +201,7 @@ class account_invoice(osv.osv): ('in_invoice','Supplier Invoice'), ('out_refund','Customer Refund'), ('in_refund','Supplier Refund'), - ],'Type', readonly=True, select=True, change_default=True, track_visibility=2), + ],'Type', readonly=True, select=True, change_default=True, track_visibility='always'), 'number': fields.related('move_id','name', type='char', readonly=True, size=64, relation='account.move', store=True, string='Number'), 'internal_number': fields.char('Invoice Number', size=32, readonly=True, help="Unique number of the invoice, computed automatically when the invoice is created."), @@ -217,7 +217,7 @@ class account_invoice(osv.osv): ('open','Open'), ('paid','Paid'), ('cancel','Cancelled'), - ],'Status', select=True, readonly=True, track_visibility=1, + ],'Status', select=True, readonly=True, track_visibility='onchange', help=' * The \'Draft\' status is used when a user is encoding a new and unconfirmed Invoice. \ \n* The \'Pro-forma\' when invoice is in Pro-forma status,invoice does not have an invoice number. \ \n* The \'Open\' status is used when user create invoice,a invoice number is generated.Its in open status till user does not pay invoice. \ @@ -228,7 +228,7 @@ class account_invoice(osv.osv): 'date_due': fields.date('Due Date', readonly=True, states={'draft':[('readonly',False)]}, select=True, help="If you use payment terms, the due date will be computed automatically at the generation "\ "of accounting entries. The payment term may compute several due dates, for example 50% now and 50% in one month, but if you want to force a due date, make sure that the payment term is not set on the invoice. If you keep the payment term and the due date empty, it means direct payment."), - 'partner_id': fields.many2one('res.partner', 'Partner', change_default=True, readonly=True, required=True, states={'draft':[('readonly',False)]}, track_visibility=2), + 'partner_id': fields.many2one('res.partner', 'Partner', change_default=True, readonly=True, required=True, states={'draft':[('readonly',False)]}, track_visibility='always'), 'payment_term': fields.many2one('account.payment.term', 'Payment Term',readonly=True, states={'draft':[('readonly',False)]}, help="If you use payment terms, the due date will be computed automatically at the generation "\ "of accounting entries. If you keep the payment term and the due date empty, it means direct payment. "\ @@ -240,7 +240,7 @@ class account_invoice(osv.osv): 'tax_line': fields.one2many('account.invoice.tax', 'invoice_id', 'Tax Lines', readonly=True, states={'draft':[('readonly',False)]}), 'move_id': fields.many2one('account.move', 'Journal Entry', readonly=True, select=1, ondelete='restrict', help="Link to the automatically generated Journal Items."), - 'amount_untaxed': fields.function(_amount_all, digits_compute=dp.get_precision('Account'), string='Untaxed', track_visibility=2, + 'amount_untaxed': fields.function(_amount_all, digits_compute=dp.get_precision('Account'), string='Untaxed', track_visibility='always', store={ 'account.invoice': (lambda self, cr, uid, ids, c={}: ids, ['invoice_line'], 20), 'account.invoice.tax': (_get_invoice_tax, None, 20), @@ -261,7 +261,7 @@ class account_invoice(osv.osv): 'account.invoice.line': (_get_invoice_line, ['price_unit','invoice_line_tax_id','quantity','discount','invoice_id'], 20), }, multi='all'), - 'currency_id': fields.many2one('res.currency', 'Currency', required=True, readonly=True, states={'draft':[('readonly',False)]}, track_visibility=2), + 'currency_id': fields.many2one('res.currency', 'Currency', required=True, readonly=True, states={'draft':[('readonly',False)]}, track_visibility='always'), 'journal_id': fields.many2one('account.journal', 'Journal', required=True, readonly=True, states={'draft':[('readonly',False)]}), 'company_id': fields.many2one('res.company', 'Company', required=True, change_default=True, readonly=True, states={'draft':[('readonly',False)]}), 'check_total': fields.float('Verification Total', digits_compute=dp.get_precision('Account'), readonly=True, states={'draft':[('readonly',False)]}), @@ -285,7 +285,7 @@ class account_invoice(osv.osv): help="Remaining amount due."), 'payment_ids': fields.function(_compute_lines, relation='account.move.line', type="many2many", string='Payments'), 'move_name': fields.char('Journal Entry', size=64, readonly=True, states={'draft':[('readonly',False)]}), - 'user_id': fields.many2one('res.users', 'Salesperson', readonly=True, track_visibility=1, states={'draft':[('readonly',False)]}), + 'user_id': fields.many2one('res.users', 'Salesperson', readonly=True, track_visibility='onchange', states={'draft':[('readonly',False)]}), 'fiscal_position': fields.many2one('account.fiscal.position', 'Fiscal Position', readonly=True, states={'draft':[('readonly',False)]}) } _defaults = { diff --git a/addons/account_voucher/account_voucher.py b/addons/account_voucher/account_voucher.py index 491f50ea647..82b18f40416 100644 --- a/addons/account_voucher/account_voucher.py +++ b/addons/account_voucher/account_voucher.py @@ -299,7 +299,7 @@ class account_voucher(osv.osv): ('cancel','Cancelled'), ('proforma','Pro-forma'), ('posted','Posted') - ], 'Status', readonly=True, size=32, track_visibility=1, + ], 'Status', readonly=True, size=32, track_visibility='onchange', help=' * The \'Draft\' status is used when a user is encoding a new and unconfirmed Voucher. \ \n* The \'Pro-forma\' when voucher is in Pro-forma status,voucher does not have an voucher number. \ \n* The \'Posted\' status is used when user create voucher,a voucher number is generated and voucher entries are created in account \ diff --git a/addons/analytic/analytic.py b/addons/analytic/analytic.py index 30c01cea19c..f8d050f40f8 100644 --- a/addons/analytic/analytic.py +++ b/addons/analytic/analytic.py @@ -196,7 +196,7 @@ class account_analytic_account(osv.osv): 'date_start': fields.date('Start Date'), 'date': fields.date('Date End', select=True), 'company_id': fields.many2one('res.company', 'Company', required=False), #not required because we want to allow different companies to use the same chart of account, except for leaf accounts. - 'state': fields.selection([('template', 'Template'),('draft','New'),('open','In Progress'), ('cancelled', 'Cancelled'),('pending','To Renew'),('close','Closed')], 'Status', required=True, track_visibility=1), + 'state': fields.selection([('template', 'Template'),('draft','New'),('open','In Progress'), ('cancelled', 'Cancelled'),('pending','To Renew'),('close','Closed')], 'Status', required=True, track_visibility='onchange'), 'currency_id': fields.function(_currency, fnct_inv=_set_company_currency, #the currency_id field is readonly except if it's a view account and if there is no company store = { 'res.company': (_get_analytic_account, ['currency_id'], 10), diff --git a/addons/base_calendar/crm_meeting.py b/addons/base_calendar/crm_meeting.py index 7dfb502276c..c3b62fe366d 100644 --- a/addons/base_calendar/crm_meeting.py +++ b/addons/base_calendar/crm_meeting.py @@ -54,7 +54,7 @@ class crm_meeting(base_state, osv.Model): string='Attendees', states={'done': [('readonly', True)]}), 'state': fields.selection( [('draft', 'Unconfirmed'), ('open', 'Confirmed')], - string='Status', size=16, readonly=True, track_visibility=1), + string='Status', size=16, readonly=True, track_visibility='onchange'), # Meeting fields 'name': fields.char('Meeting Subject', size=128, required=True, states={'done': [('readonly', True)]}), 'categ_ids': fields.many2many('crm.meeting.type', 'meeting_category_rel', diff --git a/addons/crm/crm_lead.py b/addons/crm/crm_lead.py index 4bb4a12a927..bbd7e3a56b9 100644 --- a/addons/crm/crm_lead.py +++ b/addons/crm/crm_lead.py @@ -225,7 +225,7 @@ class crm_lead(base_stage, format_address, osv.osv): return [('id', '=', '0')] _columns = { - 'partner_id': fields.many2one('res.partner', 'Partner', ondelete='set null', track_visibility=1, + 'partner_id': fields.many2one('res.partner', 'Partner', ondelete='set null', track_visibility='onchange', select=True, help="Linked partner (optional). Usually created when converting the lead."), 'id': fields.integer('ID', readonly=True), @@ -235,7 +235,7 @@ class crm_lead(base_stage, format_address, osv.osv): 'date_action_next': fields.datetime('Next Action', readonly=1), 'email_from': fields.char('Email', size=128, help="Email address of the contact", select=1), 'section_id': fields.many2one('crm.case.section', 'Sales Team', - select=True, track_visibility=1, help='When sending mails, the default email address is taken from the sales team.'), + select=True, track_visibility='onchange', help='When sending mails, the default email address is taken from the sales team.'), 'create_date': fields.datetime('Creation Date' , readonly=True), 'email_cc': fields.text('Global CC', size=252 , help="These email addresses will be added to the CC field of all inbound and outbound emails for this record before being sent. Separate multiple email addresses with a comma"), 'description': fields.text('Notes'), @@ -251,9 +251,9 @@ class crm_lead(base_stage, format_address, osv.osv): 'type':fields.selection([ ('lead','Lead'), ('opportunity','Opportunity'), ],'Type', help="Type is used to separate Leads and Opportunities"), 'priority': fields.selection(crm.AVAILABLE_PRIORITIES, 'Priority', select=True), 'date_closed': fields.datetime('Closed', readonly=True), - 'stage_id': fields.many2one('crm.case.stage', 'Stage', track_visibility=1, + 'stage_id': fields.many2one('crm.case.stage', 'Stage', track_visibility='onchange', domain="['&', '&', ('fold', '=', False), ('section_ids', '=', section_id), '|', ('type', '=', type), ('type', '=', 'both')]"), - 'user_id': fields.many2one('res.users', 'Salesperson', select=True, track_visibility=1), + 'user_id': fields.many2one('res.users', 'Salesperson', select=True, track_visibility='onchange'), 'referred': fields.char('Referred By', size=64), 'date_open': fields.datetime('Opened', readonly=True), 'day_open': fields.function(_compute_day, string='Days to Open', \ @@ -266,7 +266,7 @@ class crm_lead(base_stage, format_address, osv.osv): # Only used for type opportunity 'probability': fields.float('Success Rate (%)',group_operator="avg"), - 'planned_revenue': fields.float('Expected Revenue', track_visibility=2), + 'planned_revenue': fields.float('Expected Revenue', track_visibility='always'), 'ref': fields.reference('Reference', selection=crm._links_get, size=128), 'ref2': fields.reference('Reference 2', selection=crm._links_get, size=128), 'phone': fields.char("Phone", size=64), diff --git a/addons/crm/crm_phonecall.py b/addons/crm/crm_phonecall.py index ad9b326260c..0d7004e005b 100644 --- a/addons/crm/crm_phonecall.py +++ b/addons/crm/crm_phonecall.py @@ -48,7 +48,7 @@ class crm_phonecall(base_state, osv.osv): ('pending', 'Not Held'), ('cancel', 'Cancelled'), ('done', 'Held'),], - string='Status', size=16, readonly=True, track_visibility=1, + string='Status', size=16, readonly=True, track_visibility='onchange', help='The status is set to \'Todo\', when a case is created.\ If the case is in progress the status is set to \'Open\'.\ When the call is over, the status is set to \'Held\'.\ diff --git a/addons/crm_claim/crm_claim.py b/addons/crm_claim/crm_claim.py index ec157294d58..5aaa6582e34 100644 --- a/addons/crm_claim/crm_claim.py +++ b/addons/crm_claim/crm_claim.py @@ -104,7 +104,7 @@ class crm_claim(base_stage, osv.osv): 'email_cc': fields.text('Watchers Emails', size=252, help="These email addresses will be added to the CC field of all inbound and outbound emails for this record before being sent. Separate multiple email addresses with a comma"), 'email_from': fields.char('Email', size=128, help="Destination email for email gateway."), 'partner_phone': fields.char('Phone', size=32), - 'stage_id': fields.many2one ('crm.claim.stage', 'Stage', track_visibility=1, + 'stage_id': fields.many2one ('crm.claim.stage', 'Stage', track_visibility='onchange', domain="['&',('fold', '=', False),'|', ('section_ids', '=', section_id), ('case_default', '=', True)]"), 'cause': fields.text('Root Cause'), 'state': fields.related('stage_id', 'state', type="selection", store=True, diff --git a/addons/event/event.py b/addons/event/event.py index 2eadd7a7d34..5d010bf0760 100644 --- a/addons/event/event.py +++ b/addons/event/event.py @@ -192,7 +192,7 @@ class event_event(osv.osv): ('confirm', 'Confirmed'), ('done', 'Done')], 'Status', readonly=True, required=True, - track_visibility=1, + track_visibility='onchange', help='If event is created, the status is \'Draft\'.If event is confirmed for the particular dates the status is set to \'Confirmed\'. If the event is over, the status is set to \'Done\'.If event is cancelled the status is set to \'Cancelled\'.'), 'email_registration_id' : fields.many2one('email.template','Registration Confirmation Email', help='This field contains the template of the mail that will be automatically sent each time a registration for this event is confirmed.'), 'email_confirmation_id' : fields.many2one('email.template','Event Confirmation Email', help="If you set an email template, each participant will receive this email announcing the confirmation of the event."), @@ -309,7 +309,7 @@ class event_registration(osv.osv): ('cancel', 'Cancelled'), ('open', 'Confirmed'), ('done', 'Attended')], 'Status', - track_visibility=1, + track_visibility='onchange', size=16, readonly=True), 'email': fields.char('Email', size=64), 'phone': fields.char('Phone', size=64), diff --git a/addons/hr_expense/hr_expense.py b/addons/hr_expense/hr_expense.py index 8716eb61980..6381c507f97 100644 --- a/addons/hr_expense/hr_expense.py +++ b/addons/hr_expense/hr_expense.py @@ -97,7 +97,7 @@ class hr_expense_expense(osv.osv): ('accepted', 'Approved'), ('done', 'Done'), ], - 'Status', readonly=True, track_visibility=1, + 'Status', readonly=True, track_visibility='onchange', help='When the expense request is created the status is \'Draft\'.\n It is confirmed by the user and request is sent to admin, the status is \'Waiting Confirmation\'.\ \nIf the admin accepts it, the status is \'Accepted\'.\n If a receipt is made for the expense request, the status is \'Done\'.'), } diff --git a/addons/hr_holidays/hr_holidays.py b/addons/hr_holidays/hr_holidays.py index 52995733ce9..ab078766edc 100644 --- a/addons/hr_holidays/hr_holidays.py +++ b/addons/hr_holidays/hr_holidays.py @@ -142,7 +142,7 @@ class hr_holidays(osv.osv): _columns = { 'name': fields.char('Description', size=64), 'state': fields.selection([('draft', 'To Submit'), ('cancel', 'Cancelled'),('confirm', 'To Approve'), ('refuse', 'Refused'), ('validate1', 'Second Approval'), ('validate', 'Approved')], - 'Status', readonly=True, track_visibility=1, + 'Status', readonly=True, track_visibility='onchange', help='The status is set to \'To Submit\', when a holiday request is created.\ \nThe status is \'To Approve\', when holiday request is confirmed by user.\ \nThe status is \'Refused\', when holiday request is refused by manager.\ diff --git a/addons/hr_recruitment/hr_recruitment.py b/addons/hr_recruitment/hr_recruitment.py index b2e2cb17d4d..33e32d94762 100644 --- a/addons/hr_recruitment/hr_recruitment.py +++ b/addons/hr_recruitment/hr_recruitment.py @@ -195,7 +195,7 @@ class hr_applicant(base_stage, osv.Model): 'partner_id': fields.many2one('res.partner', 'Contact'), 'create_date': fields.datetime('Creation Date', readonly=True, select=True), 'write_date': fields.datetime('Update Date', readonly=True), - 'stage_id': fields.many2one ('hr.recruitment.stage', 'Stage', track_visibility=1, + 'stage_id': fields.many2one ('hr.recruitment.stage', 'Stage', track_visibility='onchange', domain="['&', ('fold', '=', False), '|', ('department_id', '=', department_id), ('department_id', '=', False)]"), 'state': fields.related('stage_id', 'state', type="selection", store=True, selection=AVAILABLE_STATES, string="Status", readonly=True, @@ -206,7 +206,7 @@ class hr_applicant(base_stage, osv.Model): set to \'Pending\'.'), 'categ_ids': fields.many2many('hr.applicant_category', string='Tags'), 'company_id': fields.many2one('res.company', 'Company'), - 'user_id': fields.many2one('res.users', 'Responsible', track_visibility=1), + 'user_id': fields.many2one('res.users', 'Responsible', track_visibility='onchange'), # Applicant Columns 'date_closed': fields.datetime('Closed', readonly=True, select=True), 'date_open': fields.datetime('Opened', readonly=True, select=True), diff --git a/addons/idea/idea.py b/addons/idea/idea.py index 5d61930d5f8..d1e250ce9a5 100644 --- a/addons/idea/idea.py +++ b/addons/idea/idea.py @@ -54,7 +54,7 @@ class idea_idea(osv.osv): ('open', 'Accepted'), ('cancel', 'Refused'), ('close', 'Done')], - 'Status', readonly=True, track_visibility=1, + 'Status', readonly=True, track_visibility='onchange', ) } _sql_constraints = [ diff --git a/addons/mail/mail_thread.py b/addons/mail/mail_thread.py index 92082d59b5e..37f799325b3 100644 --- a/addons/mail/mail_thread.py +++ b/addons/mail/mail_thread.py @@ -340,11 +340,11 @@ class mail_thread(osv.AbstractModel): # generate tracked_values data structure: {'col_name': {col_info, new_value, old_value}} for col_name, col_info in tracked_fields.items(): - if record[col_name] == initial[col_name] and getattr(self._all_columns[col_name].column, 'track_visibility', 0) == 2: + if record[col_name] == initial[col_name] and getattr(self._all_columns[col_name].column, 'track_visibility', None) == 'always': tracked_values[col_name] = dict(col_info=col_info['string'], new_value=convert_for_display(record[col_name], col_info)) elif record[col_name] != initial[col_name]: - if getattr(self._all_columns[col_name].column, 'track_visibility', 0) in [1, 2]: + if getattr(self._all_columns[col_name].column, 'track_visibility', None) in ['always', 'onchange']: tracked_values[col_name] = dict(col_info=col_info['string'], old_value=convert_for_display(initial[col_name], col_info), new_value=convert_for_display(record[col_name], col_info)) diff --git a/addons/mail/tests/test_mail_features.py b/addons/mail/tests/test_mail_features.py index e6b61388b4e..67d718749bb 100644 --- a/addons/mail/tests/test_mail_features.py +++ b/addons/mail/tests/test_mail_features.py @@ -623,9 +623,9 @@ class test_mail(TestMailBase): public_col = self.mail_group._columns.get('public') name_col = self.mail_group._columns.get('name') group_public_col = self.mail_group._columns.get('group_public_id') - public_col.track_visibility = 1 - name_col.track_visibility = 2 - group_public_col.track_visibility = 1 + public_col.track_visibility = 'onchange' + name_col.track_visibility = 'always' + group_public_col.track_visibility = 'onchange' # Test: change name -> always tracked, not related to a subtype self.mail_group.write(cr, self.user_raoul_id, [self.group_pigs_id], {'public': 'public'}) @@ -670,7 +670,7 @@ class test_mail(TestMailBase): self.assertEqual(len(self.group_pigs.message_ids), 4, 'tracked: No message should have been produced') # Data: removed changes - public_col.track_visibility = False - name_col.track_visibility = False - group_public_col.track_visibility = False + public_col.track_visibility = None + name_col.track_visibility = None + group_public_col.track_visibility = None self.mail_group._track = {} diff --git a/addons/mrp/mrp.py b/addons/mrp/mrp.py index ca57686cf7a..44fbaafbcfe 100644 --- a/addons/mrp/mrp.py +++ b/addons/mrp/mrp.py @@ -461,7 +461,7 @@ class mrp_production(osv.osv): [('draft', 'New'), ('cancel', 'Cancelled'), ('picking_except', 'Picking Exception'), ('confirmed', 'Awaiting Raw Materials'), ('ready', 'Ready to Produce'), ('in_production', 'Production Started'), ('done', 'Done')], string='Status', readonly=True, - track_visibility=1, + track_visibility='onchange', help="When the production order is created the status is set to 'Draft'.\n\ If the order is confirmed the status is set to 'Waiting Goods'.\n\ If any exceptions are there, the status is set to 'Picking Exception'.\n\ @@ -1022,7 +1022,7 @@ class mrp_production_workcenter_line(osv.osv): 'hour': fields.float('Number of Hours', digits=(16,2)), 'sequence': fields.integer('Sequence', required=True, help="Gives the sequence order when displaying a list of work orders."), 'production_id': fields.many2one('mrp.production', 'Manufacturing Order', - track_visibility=1, select=True, ondelete='cascade', required=True), + track_visibility='onchange', select=True, ondelete='cascade', required=True), } _defaults = { 'sequence': lambda *a: 1, diff --git a/addons/mrp_repair/mrp_repair.py b/addons/mrp_repair/mrp_repair.py index 5a07f317ff2..8c43158a876 100644 --- a/addons/mrp_repair/mrp_repair.py +++ b/addons/mrp_repair/mrp_repair.py @@ -130,7 +130,7 @@ class mrp_repair(osv.osv): ('2binvoiced','To be Invoiced'), ('invoice_except','Invoice Exception'), ('done','Repaired') - ], 'Status', readonly=True, track_visibility=1, + ], 'Status', readonly=True, track_visibility='onchange', help=' * The \'Draft\' status is used when a user is encoding a new and unconfirmed repair order. \ \n* The \'Confirmed\' status is used when a user confirms the repair order. \ \n* The \'Ready to Repair\' status is used to start to repairing, user can start repairing only after repair order is confirmed. \ diff --git a/addons/note/note.py b/addons/note/note.py index d25414c558b..7de91e4703a 100644 --- a/addons/note/note.py +++ b/addons/note/note.py @@ -108,7 +108,7 @@ class note_note(osv.osv): type='many2one', relation='note.stage'), 'stage_ids': fields.many2many('note.stage','note_stage_rel','note_id','stage_id','Stages of Users'), - 'open': fields.boolean('Active', track_visibility=1), + 'open': fields.boolean('Active', track_visibility='onchange'), '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'), diff --git a/addons/procurement/procurement.py b/addons/procurement/procurement.py index b7cf929882a..50efe0f500e 100644 --- a/addons/procurement/procurement.py +++ b/addons/procurement/procurement.py @@ -112,7 +112,7 @@ class procurement_order(osv.osv): ('running','Running'), ('ready','Ready'), ('done','Done'), - ('waiting','Waiting')], 'Status', required=True, track_visibility=1, + ('waiting','Waiting')], 'Status', required=True, track_visibility='onchange', help='When a procurement is created the status is set to \'Draft\'.\n If the procurement is confirmed, the status is set to \'Confirmed\'.\ \nAfter confirming the status is set to \'Running\'.\n If any exception arises in the order then the status is set to \'Exception\'.\n Once the exception is removed the status becomes \'Ready\'.\n It is in \'Waiting\'. status when the procurement is waiting for another one to finish.'), 'note': fields.text('Note'), diff --git a/addons/project/project.py b/addons/project/project.py index 06d4f104f4c..0534ad9a264 100644 --- a/addons/project/project.py +++ b/addons/project/project.py @@ -731,7 +731,7 @@ class task(base_stage, osv.osv): 'description': fields.text('Description'), 'priority': fields.selection([('4','Very Low'), ('3','Low'), ('2','Medium'), ('1','Important'), ('0','Very important')], 'Priority', select=True), 'sequence': fields.integer('Sequence', select=True, help="Gives the sequence order when displaying a list of tasks."), - 'stage_id': fields.many2one('project.task.type', 'Stage', track_visibility=1, + 'stage_id': fields.many2one('project.task.type', 'Stage', track_visibility='onchange', domain="['&', ('fold', '=', False), ('project_ids', '=', project_id)]"), 'state': fields.related('stage_id', 'state', type="selection", store=True, selection=_TASK_STATE, string="Status", readonly=True, @@ -742,7 +742,7 @@ class task(base_stage, osv.osv): set to \'Pending\'.'), 'categ_ids': fields.many2many('project.category', string='Tags'), 'kanban_state': fields.selection([('normal', 'Normal'),('blocked', 'Blocked'),('done', 'Ready for next stage')], 'Kanban State', - track_visibility=1, + track_visibility='onchange', help="A task's kanban state indicates special situations affecting it:\n" " * Normal is the default situation\n" " * Blocked indicates something is preventing the progress of this task\n" @@ -752,7 +752,7 @@ class task(base_stage, osv.osv): 'date_start': fields.datetime('Starting Date',select=True), 'date_end': fields.datetime('Ending Date',select=True), 'date_deadline': fields.date('Deadline',select=True), - 'project_id': fields.many2one('project.project', 'Project', ondelete='set null', select="1", track_visibility=1), + 'project_id': fields.many2one('project.project', 'Project', ondelete='set null', select="1", track_visibility='onchange'), 'parent_ids': fields.many2many('project.task', 'project_task_parent_rel', 'task_id', 'parent_id', 'Parent Tasks'), 'child_ids': fields.many2many('project.task', 'project_task_parent_rel', 'parent_id', 'task_id', 'Delegated Tasks'), 'notes': fields.text('Notes'), @@ -778,7 +778,7 @@ class task(base_stage, osv.osv): 'project.task': (lambda self, cr, uid, ids, c={}: ids, ['work_ids', 'remaining_hours', 'planned_hours'], 10), 'project.task.work': (_get_task, ['hours'], 10), }), - 'user_id': fields.many2one('res.users', 'Assigned to', track_visibility=1), + 'user_id': fields.many2one('res.users', 'Assigned to', track_visibility='onchange'), 'delegated_user_id': fields.related('child_ids', 'user_id', type='many2one', relation='res.users', string='Delegated To'), 'partner_id': fields.many2one('res.partner', 'Customer'), 'work_ids': fields.one2many('project.task.work', 'task_id', 'Work done'), diff --git a/addons/project_issue/project_issue.py b/addons/project_issue/project_issue.py index e65055491a2..0015bc3fa50 100644 --- a/addons/project_issue/project_issue.py +++ b/addons/project_issue/project_issue.py @@ -249,7 +249,7 @@ class project_issue(base_stage, osv.osv): If the case needs to be reviewed then the status is \ set to \'Pending\'.'), 'kanban_state': fields.selection([('normal', 'Normal'),('blocked', 'Blocked'),('done', 'Ready for next stage')], 'Kanban State', - track_visibility=1, + track_visibility='onchange', help="A Issue's kanban state indicates special situations affecting it:\n" " * Normal is the default situation\n" " * Blocked indicates something is preventing the progress of this issue\n" @@ -266,16 +266,16 @@ class project_issue(base_stage, osv.osv): 'priority': fields.selection(crm.AVAILABLE_PRIORITIES, 'Priority', select=True), 'version_id': fields.many2one('project.issue.version', 'Version'), 'stage_id': fields.many2one ('project.task.type', 'Stage', - track_visibility=1, + track_visibility='onchange', domain="['&', ('fold', '=', False), ('project_ids', '=', project_id)]"), - 'project_id':fields.many2one('project.project', 'Project', track_visibility=1), + 'project_id':fields.many2one('project.project', 'Project', track_visibility='onchange'), 'duration': fields.float('Duration'), 'task_id': fields.many2one('project.task', 'Task', domain="[('project_id','=',project_id)]"), 'day_open': fields.function(_compute_day, string='Days to Open', \ multi='compute_day', type="float", store=True), 'day_close': fields.function(_compute_day, string='Days to Close', \ multi='compute_day', type="float", store=True), - 'user_id': fields.many2one('res.users', 'Assigned to', required=False, select=1, track_visibility=1), + 'user_id': fields.many2one('res.users', 'Assigned to', required=False, select=1, track_visibility='onchange'), 'working_hours_open': fields.function(_compute_day, string='Working Hours to Open the Issue', \ multi='compute_day', type="float", store=True), 'working_hours_close': fields.function(_compute_day, string='Working Hours to Close the Issue', \ diff --git a/addons/purchase/purchase.py b/addons/purchase/purchase.py index 15596566ad2..ac8b9bd7af8 100644 --- a/addons/purchase/purchase.py +++ b/addons/purchase/purchase.py @@ -175,7 +175,7 @@ class purchase_order(osv.osv): 'date_order':fields.date('Order Date', required=True, states={'confirmed':[('readonly',True)], 'approved':[('readonly',True)]}, select=True, help="Date on which this document has been created."), 'date_approve':fields.date('Date Approved', readonly=1, select=True, help="Date on which purchase order has been approved"), 'partner_id':fields.many2one('res.partner', 'Supplier', required=True, states={'confirmed':[('readonly',True)], 'approved':[('readonly',True)],'done':[('readonly',True)]}, - change_default=True, track_visibility=2), + change_default=True, track_visibility='always'), 'dest_address_id':fields.many2one('res.partner', 'Customer Address (Direct Delivery)', states={'confirmed':[('readonly',True)], 'approved':[('readonly',True)],'done':[('readonly',True)]}, help="Put an address if you want to deliver directly from the supplier to the customer. " \ @@ -209,7 +209,7 @@ class purchase_order(osv.osv): 'amount_untaxed': fields.function(_amount_all, digits_compute= dp.get_precision('Account'), string='Untaxed Amount', store={ 'purchase.order.line': (_get_order, None, 10), - }, multi="sums", help="The amount without tax", track_visibility=2), + }, multi="sums", help="The amount without tax", track_visibility='always'), 'amount_tax': fields.function(_amount_all, digits_compute= dp.get_precision('Account'), string='Taxes', store={ 'purchase.order.line': (_get_order, None, 10), diff --git a/addons/purchase_requisition/purchase_requisition.py b/addons/purchase_requisition/purchase_requisition.py index 9b0415fab2e..f773bbd8505 100644 --- a/addons/purchase_requisition/purchase_requisition.py +++ b/addons/purchase_requisition/purchase_requisition.py @@ -45,7 +45,7 @@ class purchase_requisition(osv.osv): 'line_ids' : fields.one2many('purchase.requisition.line','requisition_id','Products to Purchase',states={'done': [('readonly', True)]}), 'warehouse_id': fields.many2one('stock.warehouse', 'Warehouse'), 'state': fields.selection([('draft','New'),('in_progress','Sent to Suppliers'),('cancel','Cancelled'),('done','Purchase Done')], - 'Status', track_visibility=1, required=True) + 'Status', track_visibility='onchange', required=True) } _defaults = { 'date_start': lambda *args: time.strftime('%Y-%m-%d %H:%M:%S'), diff --git a/addons/sale/sale.py b/addons/sale/sale.py index 314b1b31cb8..0a5d8f01af5 100644 --- a/addons/sale/sale.py +++ b/addons/sale/sale.py @@ -193,13 +193,13 @@ class sale_order(osv.osv): ('manual', 'Sale to Invoice'), ('invoice_except', 'Invoice Exception'), ('done', 'Done'), - ], 'Status', readonly=True, track_visibility=1, + ], 'Status', readonly=True, track_visibility='onchange', help="Gives the status of the quotation or sales order. \nThe exception status is automatically set when a cancel operation occurs in the processing of a document linked to the sale order. \nThe 'Waiting Schedule' status is set when the invoice is confirmed but waiting for the scheduler to run on the order date.", select=True), 'date_order': fields.date('Date', required=True, readonly=True, select=True, states={'draft': [('readonly', False)], 'sent': [('readonly', False)]}), 'create_date': fields.datetime('Creation Date', readonly=True, select=True, help="Date on which sales order is created."), 'date_confirm': fields.date('Confirmation Date', readonly=True, select=True, help="Date on which sales order is confirmed."), - 'user_id': fields.many2one('res.users', 'Salesperson', states={'draft': [('readonly', False)], 'sent': [('readonly', False)]}, select=True, track_visibility=1), - 'partner_id': fields.many2one('res.partner', 'Customer', readonly=True, states={'draft': [('readonly', False)], 'sent': [('readonly', False)]}, required=True, change_default=True, select=True, track_visibility=2), + 'user_id': fields.many2one('res.users', 'Salesperson', states={'draft': [('readonly', False)], 'sent': [('readonly', False)]}, select=True, track_visibility='onchange'), + 'partner_id': fields.many2one('res.partner', 'Customer', readonly=True, states={'draft': [('readonly', False)], 'sent': [('readonly', False)]}, required=True, change_default=True, select=True, track_visibility='always'), 'partner_invoice_id': fields.many2one('res.partner', 'Invoice Address', readonly=True, required=True, states={'draft': [('readonly', False)], 'sent': [('readonly', False)]}, help="Invoice address for current sales order."), 'partner_shipping_id': fields.many2one('res.partner', 'Delivery Address', readonly=True, required=True, states={'draft': [('readonly', False)], 'sent': [('readonly', False)]}, help="Delivery address for current sales order."), 'order_policy': fields.selection([ @@ -225,7 +225,7 @@ class sale_order(osv.osv): 'sale.order': (lambda self, cr, uid, ids, c={}: ids, ['order_line'], 10), 'sale.order.line': (_get_order, ['price_unit', 'tax_id', 'discount', 'product_uom_qty'], 10), }, - multi='sums', help="The amount without tax.", track_visibility=2), + multi='sums', help="The amount without tax.", track_visibility='always'), 'amount_tax': fields.function(_amount_all, digits_compute=dp.get_precision('Account'), string='Taxes', store={ 'sale.order': (lambda self, cr, uid, ids, c={}: ids, ['order_line'], 10), diff --git a/addons/stock/stock.py b/addons/stock/stock.py index b1fb5f416e7..da383c2fe29 100644 --- a/addons/stock/stock.py +++ b/addons/stock/stock.py @@ -642,7 +642,7 @@ class stock_picking(osv.osv): ('confirmed', 'Waiting Availability'), ('assigned', 'Ready to Transfer'), ('done', 'Transferred'), - ], 'Status', readonly=True, select=True, track_visibility=1, help=""" + ], 'Status', readonly=True, select=True, track_visibility='onchange', help=""" * Draft: not confirmed yet and will not be scheduled until confirmed\n * Waiting Another Operation: waiting for another move to proceed before it becomes automatically available (e.g. in Make-To-Order flows)\n * Waiting Availability: still waiting for the availability of products\n @@ -664,7 +664,7 @@ class stock_picking(osv.osv): ("invoiced", "Invoiced"), ("2binvoiced", "To Be Invoiced"), ("none", "Not Applicable")], "Invoice Control", - select=True, required=True, readonly=True, track_visibility=1, states={'draft': [('readonly', False)]}), + select=True, required=True, readonly=True, track_visibility='onchange', states={'draft': [('readonly', False)]}), 'company_id': fields.many2one('res.company', 'Company', required=True, select=True, states={'done':[('readonly', True)], 'cancel':[('readonly',True)]}), } _defaults = {