From 06fb14130a4bb88399c38979d1d07f37fbacf658 Mon Sep 17 00:00:00 2001 From: Olivier Dony Date: Sat, 2 Jul 2011 01:41:24 +0200 Subject: [PATCH] [IMP] removed method=True params from all fields.function Server revision 3495 odo@openerp.com-20110701232328-flgxulxva70vnyxr removed the need for passing method=True to function fields, so this is the equivalent addons fix, removing it everywhere. Please be careful from now on, and do not pass it anymore! bzr revid: odo@openerp.com-20110701234124-a61zl0idvdfz3hyb --- addons/account/account.py | 22 ++++----- addons/account/account_bank_statement.py | 4 +- addons/account/account_cash_statement.py | 8 ++-- addons/account/account_move_line.py | 8 ++-- addons/account/invoice.py | 20 ++++---- addons/account/partner.py | 4 +- addons/account/report/account_report.py | 2 +- .../account/report/account_treasury_report.py | 4 +- .../account_analytic_analysis.py | 40 ++++++++-------- .../account_analytic_plans.py | 2 +- addons/account_budget/account_budget.py | 6 +-- .../account_invoice_layout.py | 2 +- addons/account_payment/account_invoice.py | 2 +- addons/account_payment/account_move_line.py | 2 +- addons/account_payment/account_payment.py | 10 ++-- addons/account_voucher/account_voucher.py | 8 ++-- addons/analytic/analytic.py | 14 +++--- addons/anonymization/anonymization.py | 4 +- addons/auction/auction.py | 24 +++++----- addons/base_calendar/base_calendar.py | 22 ++++----- addons/base_contact/base_contact.py | 2 +- .../base_report_creator.py | 2 +- addons/crm/crm.py | 2 +- addons/crm/crm_lead.py | 2 +- addons/crm/crm_meeting.py | 2 +- addons/delivery/delivery.py | 2 +- addons/delivery/stock.py | 8 ++-- addons/document/directory_report.py | 2 +- addons/document/document.py | 2 +- addons/event/event.py | 6 +-- addons/hr/hr.py | 6 +-- addons/hr/hr_department.py | 2 +- addons/hr_attendance/hr_attendance.py | 4 +- addons/hr_contract/hr_contract.py | 2 +- addons/hr_expense/hr_expense.py | 4 +- addons/hr_holidays/hr_holidays.py | 8 ++-- addons/hr_payroll/hr_payroll.py | 46 +++++++++---------- .../hr_payroll_account/hr_payroll_account.py | 4 +- .../hr_timesheet_invoice.py | 2 +- .../hr_timesheet_sheet/hr_timesheet_sheet.py | 18 ++++---- addons/idea/idea.py | 10 ++-- addons/l10n_ch/invoice.py | 2 +- addons/lunch/lunch.py | 4 +- addons/mail_gateway/mail_gateway.py | 2 +- .../marketing_campaign/marketing_campaign.py | 6 +-- .../report/campaign_analysis.py | 2 +- addons/membership/membership.py | 10 ++-- addons/mrp/mrp.py | 12 ++--- addons/mrp_operations/mrp_operations.py | 6 +-- addons/mrp_repair/mrp_repair.py | 12 ++--- addons/point_of_sale/point_of_sale.py | 18 ++++---- addons/procurement/procurement.py | 2 +- addons/product/product.py | 26 +++++------ addons/product_margin/product_margin.py | 34 +++++++------- addons/project/project.py | 20 ++++---- addons/project_issue/project_issue.py | 2 +- addons/project_long_term/project_long_term.py | 4 +- addons/project_planning/project_planning.py | 20 ++++---- addons/project_scrum/project_scrum.py | 12 ++--- .../project_timesheet/report/task_report.py | 4 +- addons/purchase/purchase.py | 16 +++---- addons/sale/sale.py | 16 +++---- addons/sale_journal/sale_journal.py | 1 - addons/sale_margin/sale_margin.py | 4 +- addons/sale_mrp/sale_mrp.py | 4 +- addons/sale_order_dates/sale_order_dates.py | 4 +- addons/stock/product.py | 18 ++++---- addons/stock/stock.py | 12 ++--- addons/stock_planning/stock_planning.py | 10 ++-- addons/survey/survey.py | 6 +-- 70 files changed, 316 insertions(+), 317 deletions(-) diff --git a/addons/account/account.py b/addons/account/account.py index e50e18e8a1d..aced4041f13 100644 --- a/addons/account/account.py +++ b/addons/account/account.py @@ -368,16 +368,16 @@ class account_account(osv.osv): 'parent_id': fields.many2one('account.account', 'Parent', ondelete='cascade', domain=[('type','=','view')]), 'child_parent_ids': fields.one2many('account.account','parent_id','Children'), 'child_consol_ids': fields.many2many('account.account', 'account_account_consol_rel', 'child_id', 'parent_id', 'Consolidated Children'), - 'child_id': fields.function(_get_child_ids, method=True, type='many2many', relation="account.account", string="Child Accounts"), - 'balance': fields.function(__compute, digits_compute=dp.get_precision('Account'), method=True, string='Balance', multi='balance'), - 'credit': fields.function(__compute, digits_compute=dp.get_precision('Account'), method=True, string='Credit', multi='balance'), - 'debit': fields.function(__compute, digits_compute=dp.get_precision('Account'), method=True, string='Debit', multi='balance'), + 'child_id': fields.function(_get_child_ids, type='many2many', relation="account.account", string="Child Accounts"), + 'balance': fields.function(__compute, digits_compute=dp.get_precision('Account'), string='Balance', multi='balance'), + 'credit': fields.function(__compute, digits_compute=dp.get_precision('Account'), string='Credit', multi='balance'), + 'debit': fields.function(__compute, digits_compute=dp.get_precision('Account'), string='Debit', multi='balance'), 'reconcile': fields.boolean('Reconcile', help="Check this if the user is allowed to reconcile entries in this account."), 'shortcut': fields.char('Shortcut', size=12), 'tax_ids': fields.many2many('account.tax', 'account_account_tax_default_rel', 'account_id', 'tax_id', 'Default Taxes'), 'note': fields.text('Note'), - 'company_currency_id': fields.function(_get_company_currency, method=True, type='many2one', relation='res.currency', string='Company Currency'), + 'company_currency_id': fields.function(_get_company_currency, type='many2one', relation='res.currency', string='Company Currency'), 'company_id': fields.many2one('res.company', 'Company', required=True), 'active': fields.boolean('Active', select=2, help="If the active field is set to False, it will allow you to hide the account without removing it."), @@ -390,7 +390,7 @@ class account_account(osv.osv): 'manage this. So if you import from another software system you may have to use the rate at date. ' \ 'Incoming transactions always use the rate at date.', \ required=True), - 'level': fields.function(_get_level, string='Level', method=True, store=True, type='integer'), + 'level': fields.function(_get_level, string='Level', store=True, type='integer'), } _defaults = { @@ -587,7 +587,7 @@ class account_journal_column(osv.osv): _description = "Journal Column" _columns = { 'name': fields.char('Column Name', size=64, required=True), - 'field': fields.selection(_col_get, 'Field Name', method=True, required=True, size=32), + 'field': fields.selection(_col_get, 'Field Name', required=True, size=32), 'view_id': fields.many2one('account.journal.view', 'Journal View', select=True), 'sequence': fields.integer('Sequence', help="Gives the sequence order to journal column.", readonly=True), 'required': fields.boolean('Required'), @@ -985,7 +985,7 @@ class account_journal_period(osv.osv): 'name': fields.char('Journal-Period Name', size=64, required=True), 'journal_id': fields.many2one('account.journal', 'Journal', required=True, ondelete="cascade"), 'period_id': fields.many2one('account.period', 'Period', required=True, ondelete="cascade"), - 'icon': fields.function(_icon_get, method=True, string='Icon', type='char', size=32), + 'icon': fields.function(_icon_get, string='Icon', type='char', size=32), 'active': fields.boolean('Active', required=True, help="If the active field is set to False, it will allow you to hide the journal period without removing it."), 'state': fields.selection([('draft','Draft'), ('printed','Printed'), ('done','Done')], 'State', required=True, readonly=True, help='When journal period is created. The state is \'Draft\'. If a report is printed it comes to \'Printed\' state. When all transactions are done, it comes in \'Done\' state.'), @@ -1139,7 +1139,7 @@ class account_move(osv.osv): 'line_id': fields.one2many('account.move.line', 'move_id', 'Entries', states={'posted':[('readonly',True)]}), 'to_check': fields.boolean('To Review', help='Check this box if you are unsure of that journal entry and if you want to note it as \'to be reviewed\' by an accounting expert.'), 'partner_id': fields.related('line_id', 'partner_id', type="many2one", relation="res.partner", string="Partner", store=True), - 'amount': fields.function(_amount_compute, method=True, string='Amount', digits_compute=dp.get_precision('Account'), type='float', fnct_search=_search_amount), + 'amount': fields.function(_amount_compute, string='Amount', digits_compute=dp.get_precision('Account'), type='float', fnct_search=_search_amount), 'date': fields.date('Date', required=True, states={'posted':[('readonly',True)]}, select=True), 'narration':fields.text('Narration'), 'company_id': fields.related('journal_id','company_id',type='many2one',relation='res.company',string='Company', store=True, readonly=True), @@ -1646,8 +1646,8 @@ class account_tax_code(osv.osv): 'name': fields.char('Tax Case Name', size=64, required=True, translate=True), 'code': fields.char('Case Code', size=64), 'info': fields.text('Description'), - 'sum': fields.function(_sum_year, method=True, string="Year Sum"), - 'sum_period': fields.function(_sum_period, method=True, string="Period Sum"), + 'sum': fields.function(_sum_year, string="Year Sum"), + 'sum_period': fields.function(_sum_period, string="Period Sum"), 'parent_id': fields.many2one('account.tax.code', 'Parent Code', select=True), 'child_ids': fields.one2many('account.tax.code', 'parent_id', 'Child Codes'), 'line_ids': fields.one2many('account.move.line', 'tax_code_id', 'Lines'), diff --git a/addons/account/account_bank_statement.py b/addons/account/account_bank_statement.py index 54776e5c7e6..f712cc9ab0c 100644 --- a/addons/account/account_bank_statement.py +++ b/addons/account/account_bank_statement.py @@ -137,7 +137,7 @@ class account_bank_statement(osv.osv): states={'confirm':[('readonly',True)]}), 'balance_end_real': fields.float('Ending Balance', digits_compute=dp.get_precision('Account'), states={'confirm':[('readonly', True)]}), - 'balance_end': fields.function(_end_balance, method=True, string='Balance'), + 'balance_end': fields.function(_end_balance, string='Balance'), 'company_id': fields.related('journal_id', 'company_id', type='many2one', relation='res.company', string='Company', store=True, readonly=True), 'line_ids': fields.one2many('account.bank.statement.line', 'statement_id', 'Statement lines', @@ -149,7 +149,7 @@ class account_bank_statement(osv.osv): states={'confirm': [('readonly', True)]}, readonly="1", help='When new statement is created the state will be \'Draft\'. \ \n* And after getting confirmation from the bank it will be in \'Confirmed\' state.'), - 'currency': fields.function(_currency, method=True, string='Currency', + 'currency': fields.function(_currency, string='Currency', type='many2one', relation='res.currency'), 'account_id': fields.related('journal_id', 'default_debit_account_id', type='many2one', relation='account.account', string='Account used in this journal', readonly=True, help='used in statement reconciliation domain, but shouldn\'t be used elswhere.'), } diff --git a/addons/account/account_cash_statement.py b/addons/account/account_cash_statement.py index 04e780ade30..982383ea2a7 100644 --- a/addons/account/account_cash_statement.py +++ b/addons/account/account_cash_statement.py @@ -58,7 +58,7 @@ class account_cashbox_line(osv.osv): _columns = { 'pieces': fields.float('Values', digits_compute=dp.get_precision('Account')), 'number': fields.integer('Number'), - 'subtotal': fields.function(_sub_total, method=True, string='Sub Total', type='float', digits_compute=dp.get_precision('Account')), + 'subtotal': fields.function(_sub_total, string='Sub Total', type='float', digits_compute=dp.get_precision('Account')), 'starting_id': fields.many2one('account.bank.statement', ondelete='cascade'), 'ending_id': fields.many2one('account.bank.statement', ondelete='cascade'), } @@ -223,10 +223,10 @@ class account_cash_statement(osv.osv): [('draft', 'Draft'), ('confirm', 'Closed'), ('open','Open')], 'State', required=True, states={'confirm': [('readonly', True)]}, readonly="1"), - 'total_entry_encoding': fields.function(_get_sum_entry_encoding, method=True, store=True, string="Cash Transaction", help="Total cash transactions"), + 'total_entry_encoding': fields.function(_get_sum_entry_encoding, store=True, string="Cash Transaction", help="Total cash transactions"), 'closing_date': fields.datetime("Closed On"), - 'balance_end': fields.function(_end_balance, method=True, store=True, string='Balance', help="Closing balance based on Starting Balance and Cash Transactions"), - 'balance_end_cash': fields.function(_balance_end_cash, method=True, store=True, string='Balance', help="Closing balance based on cashBox"), + 'balance_end': fields.function(_end_balance, store=True, string='Balance', help="Closing balance based on Starting Balance and Cash Transactions"), + 'balance_end_cash': fields.function(_balance_end_cash, store=True, string='Balance', help="Closing balance based on cashBox"), 'starting_details_ids': fields.one2many('account.cashbox.line', 'starting_id', string='Opening Cashbox'), 'ending_details_ids': fields.one2many('account.cashbox.line', 'ending_id', string='Closing Cashbox'), 'name': fields.char('Name', size=64, required=True, states={'draft': [('readonly', False)]}, readonly=True, help='if you give the Name other then /, its created Accounting Entries Move will be with same name as statement name. This allows the statement entries to have the same references than the statement itself'), diff --git a/addons/account/account_move_line.py b/addons/account/account_move_line.py index 2117d7fc40e..2733ecbd189 100644 --- a/addons/account/account_move_line.py +++ b/addons/account/account_move_line.py @@ -489,8 +489,8 @@ class account_move_line(osv.osv): 'reconcile_id': fields.many2one('account.move.reconcile', 'Reconcile', readonly=True, ondelete='set null', select=2), 'reconcile_partial_id': fields.many2one('account.move.reconcile', 'Partial Reconcile', readonly=True, ondelete='set null', select=2), 'amount_currency': fields.float('Amount Currency', help="The amount expressed in an optional other currency if it is a multi-currency entry.", digits_compute=dp.get_precision('Account')), - 'amount_residual_currency': fields.function(_amount_residual, method=True, string='Residual Amount', multi="residual", help="The residual amount on a receivable or payable of a journal entry expressed in its currency (maybe different of the company currency)."), - 'amount_residual': fields.function(_amount_residual, method=True, string='Residual Amount', multi="residual", help="The residual amount on a receivable or payable of a journal entry expressed in the company currency."), + 'amount_residual_currency': fields.function(_amount_residual, string='Residual Amount', multi="residual", help="The residual amount on a receivable or payable of a journal entry expressed in its currency (maybe different of the company currency)."), + 'amount_residual': fields.function(_amount_residual, string='Residual Amount', multi="residual", help="The residual amount on a receivable or payable of a journal entry expressed in the company currency."), 'currency_id': fields.many2one('res.currency', 'Currency', help="The optional other currency if it is a multi-currency entry."), 'period_id': fields.many2one('account.period', 'Period', required=True, select=2), 'journal_id': fields.many2one('account.journal', 'Journal', required=True, select=1), @@ -504,13 +504,13 @@ class account_move_line(osv.osv): 'date_created': fields.date('Creation date', select=True), 'analytic_lines': fields.one2many('account.analytic.line', 'move_id', 'Analytic lines'), 'centralisation': fields.selection([('normal','Normal'),('credit','Credit Centralisation'),('debit','Debit Centralisation'),('currency','Currency Adjustment')], 'Centralisation', size=8), - 'balance': fields.function(_balance, fnct_search=_balance_search, method=True, string='Balance'), + 'balance': fields.function(_balance, fnct_search=_balance_search, string='Balance'), 'state': fields.selection([('draft','Unbalanced'), ('valid','Valid')], 'State', readonly=True, help='When new move line is created the state will be \'Draft\'.\n* When all the payments are done it will be in \'Valid\' state.'), 'tax_code_id': fields.many2one('account.tax.code', 'Tax Account', help="The Account can either be a base tax code or a tax code account."), 'tax_amount': fields.float('Tax/Base Amount', digits_compute=dp.get_precision('Account'), select=True, help="If the Tax account is a tax code account, this field will contain the taxed amount.If the tax account is base tax code, "\ "this field will contain the basic amount(without tax)."), - 'invoice': fields.function(_invoice, method=True, string='Invoice', + 'invoice': fields.function(_invoice, string='Invoice', type='many2one', relation='account.invoice', fnct_search=_invoice_search), 'account_tax_id':fields.many2one('account.tax', 'Tax'), 'analytic_account_id': fields.many2one('account.analytic.account', 'Analytic Account'), diff --git a/addons/account/invoice.py b/addons/account/invoice.py index 9d95a5af4ba..8b1b2a0edda 100644 --- a/addons/account/invoice.py +++ b/addons/account/invoice.py @@ -227,21 +227,21 @@ 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, method=True, digits_compute=dp.get_precision('Account'), string='Untaxed', + 'amount_untaxed': fields.function(_amount_all, digits_compute=dp.get_precision('Account'), string='Untaxed', store={ 'account.invoice': (lambda self, cr, uid, ids, c={}: ids, ['invoice_line'], 20), 'account.invoice.tax': (_get_invoice_tax, None, 20), 'account.invoice.line': (_get_invoice_line, ['price_unit','invoice_line_tax_id','quantity','discount','invoice_id'], 20), }, multi='all'), - 'amount_tax': fields.function(_amount_all, method=True, digits_compute=dp.get_precision('Account'), string='Tax', + 'amount_tax': fields.function(_amount_all, digits_compute=dp.get_precision('Account'), string='Tax', store={ 'account.invoice': (lambda self, cr, uid, ids, c={}: ids, ['invoice_line'], 20), 'account.invoice.tax': (_get_invoice_tax, None, 20), 'account.invoice.line': (_get_invoice_line, ['price_unit','invoice_line_tax_id','quantity','discount','invoice_id'], 20), }, multi='all'), - 'amount_total': fields.function(_amount_all, method=True, digits_compute=dp.get_precision('Account'), string='Total', + 'amount_total': fields.function(_amount_all, digits_compute=dp.get_precision('Account'), string='Total', store={ 'account.invoice': (lambda self, cr, uid, ids, c={}: ids, ['invoice_line'], 20), 'account.invoice.tax': (_get_invoice_tax, None, 20), @@ -252,7 +252,7 @@ class account_invoice(osv.osv): '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('Total', digits_compute=dp.get_precision('Account'), states={'open':[('readonly',True)],'close':[('readonly',True)]}), - 'reconciled': fields.function(_reconciled, method=True, string='Paid/Reconciled', type='boolean', + 'reconciled': fields.function(_reconciled, string='Paid/Reconciled', type='boolean', store={ 'account.invoice': (lambda self, cr, uid, ids, c={}: ids, None, 50), # Check if we can remove ? 'account.move.line': (_get_invoice_from_line, None, 50), @@ -260,8 +260,8 @@ class account_invoice(osv.osv): }, help="The Journal Entry of the invoice have been totally reconciled with one or several Journal Entries of payment."), 'partner_bank_id': fields.many2one('res.partner.bank', 'Bank Account', help='Bank Account Number, Company bank account if Invoice is customer or supplier refund, otherwise Partner bank account number.', readonly=True, states={'draft':[('readonly',False)]}), - 'move_lines':fields.function(_get_lines, method=True, type='many2many', relation='account.move.line', string='Entry Lines'), - 'residual': fields.function(_amount_residual, method=True, digits_compute=dp.get_precision('Account'), string='Residual', + 'move_lines':fields.function(_get_lines, type='many2many', relation='account.move.line', string='Entry Lines'), + 'residual': fields.function(_amount_residual, digits_compute=dp.get_precision('Account'), string='Residual', store={ 'account.invoice': (lambda self, cr, uid, ids, c={}: ids, ['invoice_line','move_id'], 50), 'account.invoice.tax': (_get_invoice_tax, None, 50), @@ -270,7 +270,7 @@ class account_invoice(osv.osv): 'account.move.reconcile': (_get_invoice_from_reconcile, None, 50), }, help="Remaining amount due."), - 'payment_ids': fields.function(_compute_lines, method=True, relation='account.move.line', type="many2many", string='Payments'), + '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', 'Salesman', readonly=True, states={'draft':[('readonly',False)]}), 'fiscal_position': fields.many2one('account.fiscal.position', 'Fiscal Position', readonly=True, states={'draft':[('readonly',False)]}) @@ -1282,7 +1282,7 @@ class account_invoice_line(osv.osv): 'product_id': fields.many2one('product.product', 'Product', ondelete='set null'), 'account_id': fields.many2one('account.account', 'Account', required=True, domain=[('type','<>','view'), ('type', '<>', 'closed')], help="The income or expense account related to the selected product."), 'price_unit': fields.float('Unit Price', required=True, digits_compute= dp.get_precision('Account')), - 'price_subtotal': fields.function(_amount_line, method=True, string='Subtotal', type="float", + 'price_subtotal': fields.function(_amount_line, string='Subtotal', type="float", digits_compute= dp.get_precision('Account'), store=True), 'quantity': fields.float('Quantity', required=True), 'discount': fields.float('Discount (%)', digits_compute= dp.get_precision('Account')), @@ -1505,8 +1505,8 @@ class account_invoice_tax(osv.osv): 'tax_code_id': fields.many2one('account.tax.code', 'Tax Code', help="The tax basis of the tax declaration."), 'tax_amount': fields.float('Tax Code Amount', digits_compute=dp.get_precision('Account')), 'company_id': fields.related('account_id', 'company_id', type='many2one', relation='res.company', string='Company', store=True, readonly=True), - 'factor_base': fields.function(_count_factor, method=True, string='Multipication factor for Base code', type='float', multi="all"), - 'factor_tax': fields.function(_count_factor, method=True, string='Multipication factor Tax code', type='float', multi="all") + 'factor_base': fields.function(_count_factor, string='Multipication factor for Base code', type='float', multi="all"), + 'factor_tax': fields.function(_count_factor, string='Multipication factor Tax code', type='float', multi="all") } def base_change(self, cr, uid, ids, base, currency_id=False, company_id=False, date_invoice=False): diff --git a/addons/account/partner.py b/addons/account/partner.py index 9e2aafe849a..984c7e037e0 100644 --- a/addons/account/partner.py +++ b/addons/account/partner.py @@ -142,8 +142,8 @@ class res_partner(osv.osv): _columns = { 'credit': fields.function(_credit_debit_get, - fnct_search=_credit_search, method=True, string='Total Receivable', multi='dc', help="Total amount this customer owes you."), - 'debit': fields.function(_credit_debit_get, fnct_search=_debit_search, method=True, string='Total Payable', multi='dc', help="Total amount you have to pay to this supplier."), + fnct_search=_credit_search, string='Total Receivable', multi='dc', help="Total amount this customer owes you."), + 'debit': fields.function(_credit_debit_get, fnct_search=_debit_search, string='Total Payable', multi='dc', help="Total amount you have to pay to this supplier."), 'debit_limit': fields.float('Payable Limit'), 'property_account_payable': fields.property( 'account.account', diff --git a/addons/account/report/account_report.py b/addons/account/report/account_report.py index 6b22dc21fdf..6666b1ccd83 100644 --- a/addons/account/report/account_report.py +++ b/addons/account/report/account_report.py @@ -114,7 +114,7 @@ class report_aged_receivable(osv.osv): _columns = { 'name': fields.char('Month Range', size=7, readonly=True), - 'balance': fields.function(_calc_bal, method=True, string='Balance', readonly=True), + 'balance': fields.function(_calc_bal, string='Balance', readonly=True), } def init(self, cr, uid=1): diff --git a/addons/account/report/account_treasury_report.py b/addons/account/report/account_treasury_report.py index 4d3ec449204..fce3661b4c4 100644 --- a/addons/account/report/account_treasury_report.py +++ b/addons/account/report/account_treasury_report.py @@ -47,8 +47,8 @@ class account_treasury_report(osv.osv): 'credit': fields.float('Credit', readonly=True), 'balance': fields.float('Balance', readonly=True), 'date': fields.date('Beginning of Period Date', readonly=True), - 'starting_balance': fields.function(_compute_balances, digits_compute=dp.get_precision('Account'), method=True, string='Starting Balance', multi='balance'), - 'ending_balance': fields.function(_compute_balances, digits_compute=dp.get_precision('Account'), method=True, string='Ending Balance', multi='balance'), + 'starting_balance': fields.function(_compute_balances, digits_compute=dp.get_precision('Account'), string='Starting Balance', multi='balance'), + 'ending_balance': fields.function(_compute_balances, digits_compute=dp.get_precision('Account'), string='Ending Balance', multi='balance'), 'company_id': fields.many2one('res.company', 'Company', readonly=True), } diff --git a/addons/account_analytic_analysis/account_analytic_analysis.py b/addons/account_analytic_analysis/account_analytic_analysis.py index 11f92614b73..22eb9401ad7 100644 --- a/addons/account_analytic_analysis/account_analytic_analysis.py +++ b/addons/account_analytic_analysis/account_analytic_analysis.py @@ -375,49 +375,49 @@ class account_analytic_account(osv.osv): return res _columns ={ - 'ca_invoiced': fields.function(_ca_invoiced_calc, method=True, type='float', string='Invoiced Amount', + 'ca_invoiced': fields.function(_ca_invoiced_calc, type='float', string='Invoiced Amount', help="Total customer invoiced amount for this account.", digits_compute=dp.get_precision('Account')), - 'total_cost': fields.function(_total_cost_calc, method=True, type='float', string='Total Costs', + 'total_cost': fields.function(_total_cost_calc, type='float', string='Total Costs', help="Total of costs for this account. It includes real costs (from invoices) and indirect costs, like time spent on timesheets.", digits_compute=dp.get_precision('Account')), - 'ca_to_invoice': fields.function(_analysis_all, method=True, multi='analytic_analysis', type='float', string='Uninvoiced Amount', + 'ca_to_invoice': fields.function(_analysis_all, multi='analytic_analysis', type='float', string='Uninvoiced Amount', help="If invoice from analytic account, the remaining amount you can invoice to the customer based on the total costs.", digits_compute=dp.get_precision('Account')), - 'ca_theorical': fields.function(_analysis_all, method=True, multi='analytic_analysis', type='float', string='Theoretical Revenue', + 'ca_theorical': fields.function(_analysis_all, multi='analytic_analysis', type='float', string='Theoretical Revenue', help="Based on the costs you had on the project, what would have been the revenue if all these costs have been invoiced at the normal sale price provided by the pricelist.", digits_compute=dp.get_precision('Account')), - 'hours_quantity': fields.function(_analysis_all, method=True, multi='analytic_analysis', type='float', string='Hours Tot', + 'hours_quantity': fields.function(_analysis_all, multi='analytic_analysis', type='float', string='Hours Tot', help="Number of hours you spent on the analytic account (from timesheet). It computes on all journal of type 'general'."), - 'last_invoice_date': fields.function(_analysis_all, method=True, multi='analytic_analysis', type='date', string='Last Invoice Date', + 'last_invoice_date': fields.function(_analysis_all, multi='analytic_analysis', type='date', string='Last Invoice Date', help="If invoice from the costs, this is the date of the latest invoiced."), - 'last_worked_invoiced_date': fields.function(_analysis_all, method=True, multi='analytic_analysis', type='date', string='Date of Last Invoiced Cost', + 'last_worked_invoiced_date': fields.function(_analysis_all, multi='analytic_analysis', type='date', string='Date of Last Invoiced Cost', help="If invoice from the costs, this is the date of the latest work or cost that have been invoiced."), - 'last_worked_date': fields.function(_analysis_all, method=True, multi='analytic_analysis', type='date', string='Date of Last Cost/Work', + 'last_worked_date': fields.function(_analysis_all, multi='analytic_analysis', type='date', string='Date of Last Cost/Work', help="Date of the latest work done on this account."), - 'hours_qtt_non_invoiced': fields.function(_analysis_all, method=True, multi='analytic_analysis', type='float', string='Uninvoiced Hours', + 'hours_qtt_non_invoiced': fields.function(_analysis_all, multi='analytic_analysis', type='float', string='Uninvoiced Hours', help="Number of hours (from journal of type 'general') that can be invoiced if you invoice based on analytic account."), - 'hours_qtt_invoiced': fields.function(_hours_qtt_invoiced_calc, method=True, type='float', string='Invoiced Hours', + 'hours_qtt_invoiced': fields.function(_hours_qtt_invoiced_calc, type='float', string='Invoiced Hours', help="Number of hours that can be invoiced plus those that already have been invoiced."), - 'remaining_hours': fields.function(_remaining_hours_calc, method=True, type='float', string='Remaining Hours', + 'remaining_hours': fields.function(_remaining_hours_calc, type='float', string='Remaining Hours', help="Computed using the formula: Maximum Quantity - Hours Tot."), - 'remaining_ca': fields.function(_remaining_ca_calc, method=True, type='float', string='Remaining Revenue', + 'remaining_ca': fields.function(_remaining_ca_calc, type='float', string='Remaining Revenue', help="Computed using the formula: Max Invoice Price - Invoiced Amount.", digits_compute=dp.get_precision('Account')), - 'revenue_per_hour': fields.function(_revenue_per_hour_calc, method=True, type='float', string='Revenue per Hours (real)', + 'revenue_per_hour': fields.function(_revenue_per_hour_calc, type='float', string='Revenue per Hours (real)', help="Computed using the formula: Invoiced Amount / Hours Tot.", digits_compute=dp.get_precision('Account')), - 'real_margin': fields.function(_real_margin_calc, method=True, type='float', string='Real Margin', + 'real_margin': fields.function(_real_margin_calc, type='float', string='Real Margin', help="Computed using the formula: Invoiced Amount - Total Costs.", digits_compute=dp.get_precision('Account')), - 'theorical_margin': fields.function(_theorical_margin_calc, method=True, type='float', string='Theoretical Margin', + 'theorical_margin': fields.function(_theorical_margin_calc, type='float', string='Theoretical Margin', help="Computed using the formula: Theorial Revenue - Total Costs", digits_compute=dp.get_precision('Account')), - 'real_margin_rate': fields.function(_real_margin_rate_calc, method=True, type='float', string='Real Margin Rate (%)', + 'real_margin_rate': fields.function(_real_margin_rate_calc, type='float', string='Real Margin Rate (%)', help="Computes using the formula: (Real Margin / Total Costs) * 100.", digits_compute=dp.get_precision('Account')), - 'month_ids': fields.function(_analysis_all, method=True, multi='analytic_analysis', type='many2many', relation='account_analytic_analysis.summary.month', string='Month'), - 'user_ids': fields.function(_analysis_all, method=True, multi='analytic_analysis', type="many2many", relation='account_analytic_analysis.summary.user', string='User'), + 'month_ids': fields.function(_analysis_all, multi='analytic_analysis', type='many2many', relation='account_analytic_analysis.summary.month', string='Month'), + 'user_ids': fields.function(_analysis_all, multi='analytic_analysis', type="many2many", relation='account_analytic_analysis.summary.user', string='User'), } account_analytic_account() @@ -456,7 +456,7 @@ class account_analytic_account_summary_user(osv.osv): _columns = { 'account_id': fields.many2one('account.analytic.account', 'Analytic Account', readonly=True), - 'unit_amount': fields.function(_unit_amount, method=True, type='float', + 'unit_amount': fields.function(_unit_amount, type='float', string='Total Time'), 'user': fields.many2one('res.users', 'User'), } @@ -620,7 +620,7 @@ class account_analytic_account_summary_month(osv.osv): _columns = { 'account_id': fields.many2one('account.analytic.account', 'Analytic Account', readonly=True), - 'unit_amount': fields.function(_unit_amount, method=True, type='float', string='Total Time'), + 'unit_amount': fields.function(_unit_amount, type='float', string='Total Time'), 'month': fields.char('Month', size=32, readonly=True), } diff --git a/addons/account_analytic_plans/account_analytic_plans.py b/addons/account_analytic_plans/account_analytic_plans.py index 990f53e91ef..c8ab5334d8a 100644 --- a/addons/account_analytic_plans/account_analytic_plans.py +++ b/addons/account_analytic_plans/account_analytic_plans.py @@ -61,7 +61,7 @@ class account_analytic_line(osv.osv): return res _columns = { - 'amount_currency': fields.function(_get_amount, string="Amount Currency", type="float", method=True, store=True, help="The amount expressed in the related account currency if not equal to the company one.", readonly=True), + 'amount_currency': fields.function(_get_amount, string="Amount Currency", type="float", store=True, help="The amount expressed in the related account currency if not equal to the company one.", readonly=True), 'percentage': fields.float('Percentage') } diff --git a/addons/account_budget/account_budget.py b/addons/account_budget/account_budget.py index 12caba17374..7d9666ae5ac 100644 --- a/addons/account_budget/account_budget.py +++ b/addons/account_budget/account_budget.py @@ -196,9 +196,9 @@ class crossovered_budget_lines(osv.osv): 'date_to': fields.date('End Date', required=True), 'paid_date': fields.date('Paid Date'), 'planned_amount':fields.float('Planned Amount', required=True, digits_compute=dp.get_precision('Account')), - 'practical_amount':fields.function(_prac, method=True, string='Practical Amount', type='float', digits_compute=dp.get_precision('Account')), - 'theoritical_amount':fields.function(_theo, method=True, string='Theoretical Amount', type='float', digits_compute=dp.get_precision('Account')), - 'percentage':fields.function(_perc, method=True, string='Percentage', type='float'), + 'practical_amount':fields.function(_prac, string='Practical Amount', type='float', digits_compute=dp.get_precision('Account')), + 'theoritical_amount':fields.function(_theo, string='Theoretical Amount', type='float', digits_compute=dp.get_precision('Account')), + 'percentage':fields.function(_perc, string='Percentage', type='float'), 'company_id': fields.related('crossovered_budget_id', 'company_id', type='many2one', relation='res.company', string='Company', store=True, readonly=True) } diff --git a/addons/account_invoice_layout/account_invoice_layout.py b/addons/account_invoice_layout/account_invoice_layout.py index 3337710420f..b0fb92c9abb 100644 --- a/addons/account_invoice_layout/account_invoice_layout.py +++ b/addons/account_invoice_layout/account_invoice_layout.py @@ -161,7 +161,7 @@ class account_invoice_line(osv.osv): ('break','Page Break'),] ,'Type', select=True, required=True), 'sequence': fields.integer('Sequence Number', help="Gives the sequence order when displaying a list of invoice lines."), - 'functional_field': fields.function(_fnct, arg=None, fnct_inv=None, fnct_inv_arg=None, type='char', fnct_search=None, obj=None, method=True, store=False, string="Source Account"), + 'functional_field': fields.function(_fnct, arg=None, fnct_inv=None, fnct_inv_arg=None, type='char', fnct_search=None, obj=None, store=False, string="Source Account"), } def _default_account(self, cr, uid, context=None): diff --git a/addons/account_payment/account_invoice.py b/addons/account_payment/account_invoice.py index 1f882b48421..fd787863c7d 100644 --- a/addons/account_payment/account_invoice.py +++ b/addons/account_payment/account_invoice.py @@ -42,7 +42,7 @@ class Invoice(osv.osv): return res _columns = { - 'amount_to_pay': fields.function(_amount_to_pay, method=True, + 'amount_to_pay': fields.function(_amount_to_pay, type='float', string='Amount to be paid', help='The amount which should be paid at the current date\n' \ 'minus the amount which is already in payment order'), diff --git a/addons/account_payment/account_move_line.py b/addons/account_payment/account_move_line.py index 68bb33ca4e5..24f9486be95 100644 --- a/addons/account_payment/account_move_line.py +++ b/addons/account_payment/account_move_line.py @@ -111,7 +111,7 @@ class account_move_line(osv.osv): return line2bank _columns = { - 'amount_to_pay': fields.function(amount_to_pay, method=True, + 'amount_to_pay': fields.function(amount_to_pay, type='float', string='Amount to pay', fnct_search=_to_pay_search), } diff --git a/addons/account_payment/account_payment.py b/addons/account_payment/account_payment.py index 19de746b7c9..a7b803b2d3b 100644 --- a/addons/account_payment/account_payment.py +++ b/addons/account_payment/account_payment.py @@ -96,7 +96,7 @@ class payment_order(osv.osv): ('done', 'Done')], 'State', select=True, help='When an order is placed the state is \'Draft\'.\n Once the bank is confirmed the state is set to \'Confirmed\'.\n Then the order is paid the state is \'Done\'.'), 'line_ids': fields.one2many('payment.line', 'order_id', 'Payment lines', states={'done': [('readonly', True)]}), - 'total': fields.function(_total, string="Total", method=True, type='float'), + 'total': fields.function(_total, string="Total", type='float'), 'user_id': fields.many2one('res.users', 'User', required=True, states={'done': [('readonly', True)]}), 'date_prefered': fields.selection([ ('now', 'Directly'), @@ -348,10 +348,10 @@ class payment_line(osv.osv): help='Payment amount in the company currency'), 'ml_date_created': fields.function(_get_ml_created_date, string="Effective Date", method=True, type='date', help="Invoice Effective Date"), - 'ml_maturity_date': fields.function(_get_ml_maturity_date, method=True, type='date', string='Due Date'), - 'ml_inv_ref': fields.function(_get_ml_inv_ref, method=True, type='many2one', relation='account.invoice', string='Invoice Ref.'), - 'info_owner': fields.function(info_owner, string="Owner Account", method=True, type="text", help='Address of the Main Partner'), - 'info_partner': fields.function(info_partner, string="Destination Account", method=True, type="text", help='Address of the Ordering Customer.'), + 'ml_maturity_date': fields.function(_get_ml_maturity_date, type='date', string='Due Date'), + 'ml_inv_ref': fields.function(_get_ml_inv_ref, type='many2one', relation='account.invoice', string='Invoice Ref.'), + 'info_owner': fields.function(info_owner, string="Owner Account", type="text", help='Address of the Main Partner'), + 'info_partner': fields.function(info_partner, string="Destination Account", type="text", help='Address of the Ordering Customer.'), 'date': fields.date('Payment Date', help="If no payment date is specified, the bank will treat this payment line directly"), 'create_date': fields.datetime('Created', readonly=True), 'state': fields.selection([('normal','Free'), ('structured','Structured')], 'Communication Type', required=True), diff --git a/addons/account_voucher/account_voucher.py b/addons/account_voucher/account_voucher.py index b4422cd8051..dee3d81832b 100644 --- a/addons/account_voucher/account_voucher.py +++ b/addons/account_voucher/account_voucher.py @@ -226,7 +226,7 @@ class account_voucher(osv.osv): 'writeoff_acc_id': fields.many2one('account.account', 'Write-Off account', readonly=True, states={'draft': [('readonly', False)]}), 'comment': fields.char('Write-Off Comment', size=64, required=True, readonly=True, states={'draft': [('readonly', False)]}), 'analytic_id': fields.many2one('account.analytic.account','Write-Off Analytic Account', readonly=True, states={'draft': [('readonly', False)]}), - 'writeoff_amount': fields.function(_get_writeoff_amount, method=True, string='Write-Off Amount', type='float', readonly=True), + 'writeoff_amount': fields.function(_get_writeoff_amount, string='Write-Off Amount', type='float', readonly=True), } _defaults = { 'period_id': _get_period, @@ -845,8 +845,8 @@ class account_voucher_line(osv.osv): 'move_line_id': fields.many2one('account.move.line', 'Journal Item'), 'date_original': fields.related('move_line_id','date', type='date', relation='account.move.line', string='Date', readonly=1), 'date_due': fields.related('move_line_id','date_maturity', type='date', relation='account.move.line', string='Due Date', readonly=1), - 'amount_original': fields.function(_compute_balance, method=True, multi='dc', type='float', string='Original Amount', store=True), - 'amount_unreconciled': fields.function(_compute_balance, method=True, multi='dc', type='float', string='Open Balance', store=True), + 'amount_original': fields.function(_compute_balance, multi='dc', type='float', string='Original Amount', store=True), + 'amount_unreconciled': fields.function(_compute_balance, multi='dc', type='float', string='Open Balance', store=True), 'company_id': fields.related('voucher_id','company_id', relation='res.company', type='many2one', string='Company', store=True, readonly=True), } _defaults = { @@ -991,7 +991,7 @@ class account_bank_statement_line(osv.osv): _columns = { 'amount_reconciled': fields.function(_amount_reconciled, - string='Amount reconciled', method=True, type='float'), + string='Amount reconciled', type='float'), 'voucher_id': fields.many2one('account.voucher', 'Payment'), } diff --git a/addons/analytic/analytic.py b/addons/analytic/analytic.py index d822c382c91..a155352adf8 100644 --- a/addons/analytic/analytic.py +++ b/addons/analytic/analytic.py @@ -149,18 +149,18 @@ class account_analytic_account(osv.osv): _columns = { 'name': fields.char('Account Name', size=128, required=True), - 'complete_name': fields.function(_complete_name_calc, method=True, type='char', string='Full Account Name'), + 'complete_name': fields.function(_complete_name_calc, type='char', string='Full Account Name'), 'code': fields.char('Account Code', size=24, select=True), 'type': fields.selection([('view','View'), ('normal','Normal')], 'Account Type', help='If you select the View Type, it means you won\'t allow to create journal entries using that account.'), 'description': fields.text('Description'), 'parent_id': fields.many2one('account.analytic.account', 'Parent Analytic Account', select=2), 'child_ids': fields.one2many('account.analytic.account', 'parent_id', 'Child Accounts'), - 'child_complete_ids': fields.function(_child_compute, relation='account.analytic.account', method=True, string="Account Hierarchy", type='many2many'), + 'child_complete_ids': fields.function(_child_compute, relation='account.analytic.account', string="Account Hierarchy", type='many2many'), 'line_ids': fields.one2many('account.analytic.line', 'account_id', 'Analytic Entries'), - 'balance': fields.function(_debit_credit_bal_qtty, method=True, type='float', string='Balance', multi='debit_credit_bal_qtty', digits_compute=dp.get_precision('Account')), - 'debit': fields.function(_debit_credit_bal_qtty, method=True, type='float', string='Debit', multi='debit_credit_bal_qtty', digits_compute=dp.get_precision('Account')), - 'credit': fields.function(_debit_credit_bal_qtty, method=True, type='float', string='Credit', multi='debit_credit_bal_qtty', digits_compute=dp.get_precision('Account')), - 'quantity': fields.function(_debit_credit_bal_qtty, method=True, type='float', string='Quantity', multi='debit_credit_bal_qtty'), + 'balance': fields.function(_debit_credit_bal_qtty, type='float', string='Balance', multi='debit_credit_bal_qtty', digits_compute=dp.get_precision('Account')), + 'debit': fields.function(_debit_credit_bal_qtty, type='float', string='Debit', multi='debit_credit_bal_qtty', digits_compute=dp.get_precision('Account')), + 'credit': fields.function(_debit_credit_bal_qtty, type='float', string='Credit', multi='debit_credit_bal_qtty', digits_compute=dp.get_precision('Account')), + 'quantity': fields.function(_debit_credit_bal_qtty, type='float', string='Quantity', multi='debit_credit_bal_qtty'), 'quantity_max': fields.float('Maximum Quantity', help='Sets the higher limit of quantity of hours.'), 'partner_id': fields.many2one('res.partner', 'Partner'), 'contact_id': fields.many2one('res.partner.address', 'Contact'), @@ -175,7 +175,7 @@ class account_analytic_account(osv.osv): \n* And finally when all the transactions are over, it can be in \'Close\' state. \ \n* The project can be in either if the states \'Template\' and \'Running\'.\n If it is template then we can make projects based on the template projects. If its in \'Running\' state it is a normal project.\ \n If it is to be reviewed then the state is \'Pending\'.\n When the project is completed the state is set to \'Done\'.'), - 'currency_id': fields.function(_currency, fnct_inv=_set_company_currency, method=True, + 'currency_id': fields.function(_currency, fnct_inv=_set_company_currency, store = { 'res.company': (_get_analytic_account, ['currency_id'], 10), }, string='Currency', type='many2one', relation='res.currency'), diff --git a/addons/anonymization/anonymization.py b/addons/anonymization/anonymization.py index 2814227015a..c4a2d9f0488 100644 --- a/addons/anonymization/anonymization.py +++ b/addons/anonymization/anonymization.py @@ -240,10 +240,10 @@ class ir_model_fields_anonymize_wizard(osv.osv_memory): _columns = { 'name': fields.char(size='64', string='File Name'), - 'summary': fields.function(_get_summary, method=True, type='text', string='Summary'), + 'summary': fields.function(_get_summary, type='text', string='Summary'), 'file_export': fields.binary(string='Export'), 'file_import': fields.binary(string='Import'), - 'state': fields.function(_get_state, method=True, string='State', type='selection', selection=ANONYMIZATION_STATES, readonly=False), + 'state': fields.function(_get_state, string='State', type='selection', selection=ANONYMIZATION_STATES, readonly=False), 'msg': fields.text(string='Message'), } diff --git a/addons/auction/auction.py b/addons/auction/auction.py index 0b2fc467f88..685b6ee3368 100644 --- a/addons/auction/auction.py +++ b/addons/auction/auction.py @@ -95,12 +95,12 @@ class auction_dates(osv.osv): 'seller_costs': fields.many2many('account.tax', 'auction_seller_taxes_rel', 'auction_id', 'tax_id', 'Seller Costs', help="Account tax for seller"), 'acc_income': fields.many2one('account.account', 'Income Account', required=True), 'acc_expense': fields.many2one('account.account', 'Expense Account', required=True), - 'adj_total': fields.function(_adjudication_get, method=True, string='Total Adjudication', store=True), + 'adj_total': fields.function(_adjudication_get, string='Total Adjudication', store=True), 'state': fields.selection((('draft', 'Draft'), ('closed', 'Closed')), 'State', select=1, readonly=True, help='When auction starts the state is \'Draft\'.\n At the end of auction, the state becomes \'Closed\'.'), 'account_analytic_id': fields.many2one('account.analytic.account', 'Analytic Account', required=False), - 'buyer_invoice_history': fields.function(_get_invoice, relation='account.invoice', method=True, string="Buyer Invoice", type='many2many', multi=True), - 'seller_invoice_history': fields.function(_get_invoice, relation='account.invoice', method=True, string="Seller Invoice", type='many2many', multi=True), + 'buyer_invoice_history': fields.function(_get_invoice, relation='account.invoice', string="Buyer Invoice", type='many2many', multi=True), + 'seller_invoice_history': fields.function(_get_invoice, relation='account.invoice', string="Seller Invoice", type='many2many', multi=True), } _defaults = { @@ -382,8 +382,8 @@ class auction_lots(osv.osv): 'vnd_lim': fields.float('Seller limit'), 'vnd_lim_net': fields.boolean('Net limit ?', readonly=True), 'image': fields.binary('Image', help="Object Image"), - 'paid_vnd':fields.function(_getprice, string='Seller Paid', method=True, type='boolean', store=True, multi="paid_vnd", help="When state of Seller Invoice is 'Paid', this field is selected as True."), - 'paid_ach':fields.function(_getprice, string='Buyer Invoice Reconciled', method=True, type='boolean', store=True, multi="paid_ach", help="When state of Buyer Invoice is 'Paid', this field is selected as True."), + 'paid_vnd':fields.function(_getprice, string='Seller Paid', type='boolean', store=True, multi="paid_vnd", help="When state of Seller Invoice is 'Paid', this field is selected as True."), + 'paid_ach':fields.function(_getprice, string='Buyer Invoice Reconciled', type='boolean', store=True, multi="paid_ach", help="When state of Buyer Invoice is 'Paid', this field is selected as True."), 'state': fields.selection(( ('draft', 'Draft'), ('unsold', 'Unsold'), @@ -394,14 +394,14 @@ class auction_lots(osv.osv): \n* The \'Unsold\' state is used when object does not sold for long time, user can also set it as draft state after unsold. \ \n* The \'Paid\' state is used when user pay for the object \ \n* The \'Sold\' state is used when user buy the object.'), - 'buyer_price': fields.function(_getprice, method=True, string='Buyer price', store=True, multi="buyer_price", help="Buyer Price"), - 'seller_price': fields.function(_getprice, method=True, string='Seller price', store=True, multi="seller_price", help="Seller Price"), - 'gross_revenue':fields.function(_getprice, method=True, string='Gross revenue', store=True, multi="gross_revenue", help="Buyer Price - Seller Price"), - 'gross_margin':fields.function(_getprice, method=True, string='Gross Margin (%)', store=True, multi="gross_margin", help="(Gross Revenue*100.0)/ Object Price"), - 'costs':fields.function(_getprice, method=True, string='Indirect costs', store=True, multi="costs", help="Deposit cost"), + 'buyer_price': fields.function(_getprice, string='Buyer price', store=True, multi="buyer_price", help="Buyer Price"), + 'seller_price': fields.function(_getprice, string='Seller price', store=True, multi="seller_price", help="Seller Price"), + 'gross_revenue':fields.function(_getprice, string='Gross revenue', store=True, multi="gross_revenue", help="Buyer Price - Seller Price"), + 'gross_margin':fields.function(_getprice, string='Gross Margin (%)', store=True, multi="gross_margin", help="(Gross Revenue*100.0)/ Object Price"), + 'costs':fields.function(_getprice, string='Indirect costs', store=True, multi="costs", help="Deposit cost"), 'statement_id': fields.many2many('account.bank.statement.line', 'auction_statement_line_rel', 'auction_id', 'statement', 'Payment', help="Bank statement line for given buyer"), - 'net_revenue':fields.function(_getprice, method=True, string='Net revenue', store=True, multi="net_revenue", help="Buyer Price - Seller Price - Indirect Cost"), - 'net_margin':fields.function(_getprice, method=True, string='Net Margin (%)', store=True, multi="net_margin", help="(Net Revenue * 100)/ Object Price"), + 'net_revenue':fields.function(_getprice, string='Net revenue', store=True, multi="net_revenue", help="Buyer Price - Seller Price - Indirect Cost"), + 'net_margin':fields.function(_getprice, string='Net Margin (%)', store=True, multi="net_margin", help="(Net Revenue * 100)/ Object Price"), } _defaults = { 'state':lambda *a: 'draft', diff --git a/addons/base_calendar/base_calendar.py b/addons/base_calendar/base_calendar.py index 4df126e191e..5f24b08884a 100644 --- a/addons/base_calendar/base_calendar.py +++ b/addons/base_calendar/base_calendar.py @@ -341,26 +341,26 @@ class calendar_attendee(osv.osv): help="Status of the attendee's participation"), 'rsvp': fields.boolean('Required Reply?', help="Indicats whether the favor of a reply is requested"), - 'delegated_to': fields.function(_compute_data, method=True, \ + 'delegated_to': fields.function(_compute_data, \ string='Delegated To', type="char", size=124, store=True, \ multi='delegated_to', help="The users that the original \ request was delegated to"), - 'delegated_from': fields.function(_compute_data, method=True, string=\ + 'delegated_from': fields.function(_compute_data, string=\ 'Delegated From', type="char", store=True, size=124, multi='delegated_from'), 'parent_ids': fields.many2many('calendar.attendee', 'calendar_attendee_parent_rel', \ 'attendee_id', 'parent_id', 'Delegrated From'), 'child_ids': fields.many2many('calendar.attendee', 'calendar_attendee_child_rel', \ 'attendee_id', 'child_id', 'Delegrated To'), - 'sent_by': fields.function(_compute_data, method=True, string='Sent By', \ + 'sent_by': fields.function(_compute_data, string='Sent By', \ type="char", multi='sent_by', store=True, size=124, \ help="Specify the user that is acting on behalf of the calendar user"), - 'sent_by_uid': fields.function(_compute_data, method=True, string='Sent By User', \ + 'sent_by_uid': fields.function(_compute_data, string='Sent By User', \ type="many2one", relation="res.users", multi='sent_by_uid'), - 'cn': fields.function(_compute_data, method=True, string='Common name', \ + 'cn': fields.function(_compute_data, string='Common name', \ type="char", size=124, multi='cn', store=True), 'dir': fields.char('URI Reference', size=124, help="Reference to the URI\ that points to the directory information corresponding to the attendee."), - 'language': fields.function(_compute_data, method=True, string='Language', \ + 'language': fields.function(_compute_data, string='Language', \ type="selection", selection=_lang_get, multi='language', \ store=True, help="To specify the language for text values in a\ property or property parameter."), @@ -369,9 +369,9 @@ property or property parameter."), 'partner_id': fields.related('partner_address_id', 'partner_id', type='many2one', \ relation='res.partner', string='Partner', help="Partner related to contact"), 'email': fields.char('Email', size=124, help="Email of Invited Person"), - 'event_date': fields.function(_compute_data, method=True, string='Event Date', \ + 'event_date': fields.function(_compute_data, string='Event Date', \ type="datetime", multi='event_date'), - 'event_end_date': fields.function(_compute_data, method=True, \ + 'event_end_date': fields.function(_compute_data, \ string='Event End Date', type="datetime", \ multi='event_end_date'), 'ref': fields.reference('Event Ref', selection=_links_get, size=128), @@ -1022,7 +1022,7 @@ class calendar_event(osv.osv): defines the list of date/time exceptions for a recurring calendar component."), 'exrule': fields.char('Exception Rule', size=352, help="Defines a \ rule or repeating pattern of time to exclude from the recurring rule."), - 'rrule': fields.function(_get_rulestring, type='char', size=124, method=True, \ + 'rrule': fields.function(_get_rulestring, type='char', size=124, \ store=True, string='Recurrent Rule'), 'rrule_type': fields.selection([('none', ''), ('daily', 'Daily'), \ ('weekly', 'Weekly'), ('monthly', 'Monthly'), \ @@ -1552,7 +1552,7 @@ class calendar_todo(osv.osv): return self.write(cr, uid, id, { 'date_start': value }, context=context) _columns = { - 'date': fields.function(_get_date, method=True, fnct_inv=_set_date, \ + 'date': fields.function(_get_date, fnct_inv=_set_date, \ string='Duration', store=True, type='datetime'), 'duration': fields.integer('Duration'), } @@ -1750,7 +1750,7 @@ class res_users(osv.osv): _columns = { 'availability': fields.function(_get_user_avail_fun, type='selection', \ selection=[('free', 'Free'), ('busy', 'Busy')], \ - string='Free/Busy', method=True), + string='Free/Busy'), } res_users() diff --git a/addons/base_contact/base_contact.py b/addons/base_contact/base_contact.py index 8a003ec7cf1..cf0bc610be8 100644 --- a/addons/base_contact/base_contact.py +++ b/addons/base_contact/base_contact.py @@ -64,7 +64,7 @@ class res_partner_contact(osv.osv): relation='res.partner', string='Main Employer'), 'function': fields.related('job_ids', 'function', type='char', \ string='Main Function'), - 'job_id': fields.function(_main_job, method=True, type='many2one',\ + 'job_id': fields.function(_main_job, type='many2one',\ relation='res.partner.job', string='Main Job'), 'email': fields.char('E-Mail', size=240), 'comment': fields.text('Notes', translate=True), diff --git a/addons/base_report_creator/base_report_creator.py b/addons/base_report_creator/base_report_creator.py index a026a077c85..29699b9000d 100644 --- a/addons/base_report_creator/base_report_creator.py +++ b/addons/base_report_creator/base_report_creator.py @@ -415,7 +415,7 @@ class report_creator(osv.osv): 'model_ids': fields.many2many('ir.model', 'base_report_creator_report_model_rel', 'report_id', 'model_id', 'Reported Objects'), 'field_ids': fields.one2many('base_report_creator.report.fields', 'report_id', 'Fields to Display'), 'filter_ids': fields.one2many('base_report_creator.report.filter', 'report_id', 'Filters'), - 'sql_query': fields.function(_sql_query_get, method=True, type="text", string='SQL Query', store=True), + 'sql_query': fields.function(_sql_query_get, type="text", string='SQL Query', store=True), 'group_ids': fields.many2many('res.groups', 'base_report_creator_group_rel', 'report_id', 'group_id', 'Authorized Groups'), 'menu_id': fields.many2one('ir.ui.menu', "Menu", readonly=True), } diff --git a/addons/crm/crm.py b/addons/crm/crm.py index 7003bba2a8e..0b1e8db7bbb 100644 --- a/addons/crm/crm.py +++ b/addons/crm/crm.py @@ -682,7 +682,7 @@ class crm_case_section(osv.osv): _columns = { 'name': fields.char('Sales Team', size=64, required=True, translate=True), - 'complete_name': fields.function(get_full_name, method=True, type='char', size=256, readonly=True, store=True), + 'complete_name': fields.function(get_full_name, type='char', size=256, readonly=True, store=True), 'code': fields.char('Code', size=8), 'active': fields.boolean('Active', help="If the active field is set to "\ "true, it will allow you to hide the sales team without removing it."), diff --git a/addons/crm/crm_lead.py b/addons/crm/crm_lead.py index 11f465d8e39..a07974f4fd0 100644 --- a/addons/crm/crm_lead.py +++ b/addons/crm/crm_lead.py @@ -170,7 +170,7 @@ class crm_lead(crm_case, osv.osv): \nWhen the case is over, the state is set to \'Done\'.\ \nIf the case needs to be reviewed then the state is set to \'Pending\'.'), 'message_ids': fields.one2many('mailgate.message', 'res_id', 'Messages', domain=[('model','=',_name)]), - 'subjects': fields.function(_get_email_subject, fnct_search=_history_search, string='Subject of Email', method=True, type='char', size=64), + 'subjects': fields.function(_get_email_subject, fnct_search=_history_search, string='Subject of Email', type='char', size=64), } diff --git a/addons/crm/crm_meeting.py b/addons/crm/crm_meeting.py index 6d3d68ef881..440bbdfc3bf 100644 --- a/addons/crm/crm_meeting.py +++ b/addons/crm/crm_meeting.py @@ -125,7 +125,7 @@ class calendar_attendee(osv.osv): return result _columns = { - 'categ_id': fields.function(_compute_data, method=True, \ + 'categ_id': fields.function(_compute_data, \ string='Event Type', type="many2one", \ relation="crm.case.categ", multi='categ_id'), } diff --git a/addons/delivery/delivery.py b/addons/delivery/delivery.py index aceee36e0a2..7ad3f7fff5f 100644 --- a/addons/delivery/delivery.py +++ b/addons/delivery/delivery.py @@ -63,7 +63,7 @@ class delivery_carrier(osv.osv): 'partner_id': fields.many2one('res.partner', 'Carrier Partner', required=True), 'product_id': fields.many2one('product.product', 'Delivery Product', required=True), 'grids_id': fields.one2many('delivery.grid', 'carrier_id', 'Delivery Grids'), - 'price' : fields.function(get_price, method=True,string='Price'), + 'price' : fields.function(get_price,string='Price'), 'active': fields.boolean('Active', help="If the active field is set to False, it will allow you to hide the delivery carrier without removing it.") } _defaults = { diff --git a/addons/delivery/stock.py b/addons/delivery/stock.py index d1ffb7ba968..05074268220 100644 --- a/addons/delivery/stock.py +++ b/addons/delivery/stock.py @@ -54,12 +54,12 @@ class stock_picking(osv.osv): _columns = { 'carrier_id':fields.many2one("delivery.carrier","Carrier"), 'volume': fields.float('Volume'), - 'weight': fields.function(_cal_weight, method=True, type='float', string='Weight', digits_compute= dp.get_precision('Stock Weight'), multi='_cal_weight', + 'weight': fields.function(_cal_weight, type='float', string='Weight', digits_compute= dp.get_precision('Stock Weight'), multi='_cal_weight', store={ 'stock.picking': (lambda self, cr, uid, ids, c={}: ids, ['move_lines'], 20), 'stock.move': (_get_picking_line, ['product_id','product_qty','product_uom','product_uos_qty'], 20), }), - 'weight_net': fields.function(_cal_weight, method=True, type='float', string='Net Weight', digits_compute= dp.get_precision('Stock Weight'), multi='_cal_weight', + 'weight_net': fields.function(_cal_weight, type='float', string='Net Weight', digits_compute= dp.get_precision('Stock Weight'), multi='_cal_weight', store={ 'stock.picking': (lambda self, cr, uid, ids, c={}: ids, ['move_lines'], 20), 'stock.move': (_get_picking_line, ['product_id','product_qty','product_uom','product_uos_qty'], 20), @@ -158,11 +158,11 @@ class stock_move(osv.osv): return res _columns = { - 'weight': fields.function(_cal_move_weight, method=True, type='float', string='Weight', digits_compute= dp.get_precision('Stock Weight'), multi='_cal_move_weight', + 'weight': fields.function(_cal_move_weight, type='float', string='Weight', digits_compute= dp.get_precision('Stock Weight'), multi='_cal_move_weight', store={ 'stock.move': (lambda self, cr, uid, ids, c=None: ids, ['product_id', 'product_qty', 'product_uom'], 20), }), - 'weight_net': fields.function(_cal_move_weight, method=True, type='float', string='Net weight', digits_compute= dp.get_precision('Stock Weight'), multi='_cal_move_weight', + 'weight_net': fields.function(_cal_move_weight, type='float', string='Net weight', digits_compute= dp.get_precision('Stock Weight'), multi='_cal_move_weight', store={ 'stock.move': (lambda self, cr, uid, ids, c=None: ids, ['product_id', 'product_qty', 'product_uom'], 20), }), diff --git a/addons/document/directory_report.py b/addons/document/directory_report.py index 1665a7abf68..2726fcd5462 100644 --- a/addons/document/directory_report.py +++ b/addons/document/directory_report.py @@ -56,7 +56,7 @@ class ir_action_report_xml(osv.osv): return [('id','in',report_id)] _columns={ - 'model_id' : fields.function(_model_get, fnct_search=_model_search, method=True, string='Model Id'), + 'model_id' : fields.function(_model_get, fnct_search=_model_search, string='Model Id'), } ir_action_report_xml() diff --git a/addons/document/document.py b/addons/document/document.py index 90f57438ce8..69e123b87eb 100644 --- a/addons/document/document.py +++ b/addons/document/document.py @@ -117,7 +117,7 @@ class document_file(osv.osv): # If ir.attachment contained any data before document is installed, preserve # the data, don't drop the column! 'db_datas': fields.binary('Data', oldname='datas'), - 'datas': fields.function(_data_get, method=True, fnct_inv=_data_set, string='File Content', type="binary", nodrop=True), + 'datas': fields.function(_data_get, fnct_inv=_data_set, string='File Content', type="binary", nodrop=True), # Fields of document: 'user_id': fields.many2one('res.users', 'Owner', select=1), diff --git a/addons/event/event.py b/addons/event/event.py index 4d392689bba..0fc28c7c193 100644 --- a/addons/event/event.py +++ b/addons/event/event.py @@ -207,9 +207,9 @@ class event_event(osv.osv): 'type': fields.many2one('event.type', 'Type', help="Type of Event like Seminar, Exhibition, Conference, Training.", readonly=False, states={'done': [('readonly', True)]}), 'register_max': fields.integer('Maximum Registrations', help="Provide Maximum Number of Registrations", readonly=True, states={'draft': [('readonly', False)]}), 'register_min': fields.integer('Minimum Registrations', help="Provide Minimum Number of Registrations", readonly=True, states={'draft': [('readonly', False)]}), - 'register_current': fields.function(_get_register, method=True, string='Confirmed Registrations', multi='register_current', + 'register_current': fields.function(_get_register, string='Confirmed Registrations', multi='register_current', help="Total of Open and Done Registrations"), - 'register_prospect': fields.function(_get_register, method=True, string='Unconfirmed Registrations', multi='register_prospect', + 'register_prospect': fields.function(_get_register, string='Unconfirmed Registrations', multi='register_prospect', help="Total of Prospect Registrations"), 'registration_ids': fields.one2many('event.registration', 'event_id', 'Registrations', readonly=False, states={'done': [('readonly', True)]}), 'date_begin': fields.datetime('Beginning date', required=True, help="Beginning Date of Event", readonly=True, states={'draft': [('readonly', False)]}), @@ -301,7 +301,7 @@ class event_registration(osv.osv): "partner_invoice_id": fields.many2one('res.partner', 'Partner Invoiced', readonly=True, states={'draft': [('readonly', False)]}), "contact_id": fields.many2one('res.partner.contact', 'Partner Contact', readonly=False, states={'done': [('readonly', True)]}), #TODO: filter only the contacts that have a function into the selected partner_id "unit_price": fields.float('Unit Price', required=True, digits_compute=dp.get_precision('Sale Price'), readonly=True, states={'draft': [('readonly', False)]}), - 'price_subtotal': fields.function(_amount_line, method=True, string='Subtotal', digits_compute=dp.get_precision('Sale Price'), store=True), + 'price_subtotal': fields.function(_amount_line, string='Subtotal', digits_compute=dp.get_precision('Sale Price'), store=True), "badge_ids": fields.one2many('event.registration.badge', 'registration_id', 'Badges', readonly=False, states={'done': [('readonly', True)]}), "event_product": fields.char("Invoice Name", size=128, readonly=True, states={'draft': [('readonly', False)]}), "tobe_invoiced": fields.boolean("To be Invoiced", readonly=True, states={'draft': [('readonly', False)]}), diff --git a/addons/hr/hr.py b/addons/hr/hr.py index 8a49fd876ba..70f7784f55b 100644 --- a/addons/hr/hr.py +++ b/addons/hr/hr.py @@ -45,7 +45,7 @@ class hr_employee_category(osv.osv): _description = "Employee Category" _columns = { 'name': fields.char("Category", size=64, required=True), - 'complete_name': fields.function(_name_get_fnc, method=True, type="char", string='Name'), + 'complete_name': fields.function(_name_get_fnc, type="char", string='Name'), 'parent_id': fields.many2one('hr.employee.category', 'Parent Category', select=True), 'child_ids': fields.one2many('hr.employee.category', 'parent_id', 'Child Categories') } @@ -92,8 +92,8 @@ class hr_job(osv.osv): _description = "Job Description" _columns = { 'name': fields.char('Job Name', size=128, required=True, select=True), - 'expected_employees': fields.function(_no_of_employee, method=True, string='Expected Employees', help='Required number of Employees in total for that job.', multi="no_of_employee", store=True), - 'no_of_employee': fields.function(_no_of_employee, method=True, string="No of Employee", help='Number of employee with that job.', multi="no_of_employee", store=True), + 'expected_employees': fields.function(_no_of_employee, string='Expected Employees', help='Required number of Employees in total for that job.', multi="no_of_employee", store=True), + 'no_of_employee': fields.function(_no_of_employee, string="No of Employee", help='Number of employee with that job.', multi="no_of_employee", store=True), 'no_of_recruitment': fields.float('Expected in Recruitment'), 'employee_ids': fields.one2many('hr.employee', 'job_id', 'Employees'), 'description': fields.text('Job Description'), diff --git a/addons/hr/hr_department.py b/addons/hr/hr_department.py index c885fdf30bd..3332207cb17 100644 --- a/addons/hr/hr_department.py +++ b/addons/hr/hr_department.py @@ -44,7 +44,7 @@ class hr_department(osv.osv): _name = "hr.department" _columns = { 'name': fields.char('Department Name', size=64, required=True), - 'complete_name': fields.function(_dept_name_get_fnc, method=True, type="char", string='Name'), + 'complete_name': fields.function(_dept_name_get_fnc, type="char", string='Name'), 'company_id': fields.many2one('res.company', 'Company', select=True, required=False), 'parent_id': fields.many2one('hr.department', 'Parent Department', select=True), 'child_ids': fields.one2many('hr.department', 'parent_id', 'Child Departments'), diff --git a/addons/hr_attendance/hr_attendance.py b/addons/hr_attendance/hr_attendance.py index 8c5648a1040..a138d66a285 100644 --- a/addons/hr_attendance/hr_attendance.py +++ b/addons/hr_attendance/hr_attendance.py @@ -56,7 +56,7 @@ class hr_attendance(osv.osv): 'action': fields.selection([('sign_in', 'Sign In'), ('sign_out', 'Sign Out'), ('action','Action')], 'Action', required=True), 'action_desc': fields.many2one("hr.action.reason", "Action Reason", domain="[('action_type', '=', action)]", help='Specifies the reason for Signing In/Signing Out in case of extra hours.'), 'employee_id': fields.many2one('hr.employee', "Employee's Name", required=True, select=True), - 'day': fields.function(_day_compute, method=True, type='char', string='Day', store=True, select=1, size=32), + 'day': fields.function(_day_compute, type='char', string='Day', store=True, select=1, size=32), } _defaults = { 'name': lambda *a: time.strftime('%Y-%m-%d %H:%M:%S'), #please don't remove the lambda, if you remove it then the current time will not change @@ -110,7 +110,7 @@ class hr_employee(osv.osv): return result _columns = { - 'state': fields.function(_state, method=True, type='selection', selection=[('absent', 'Absent'), ('present', 'Present')], string='Attendance'), + 'state': fields.function(_state, type='selection', selection=[('absent', 'Absent'), ('present', 'Present')], string='Attendance'), } def _action_check(self, cr, uid, emp_id, dt=False, context=None): diff --git a/addons/hr_contract/hr_contract.py b/addons/hr_contract/hr_contract.py index 7ed2d16d6b7..21d15a4194b 100644 --- a/addons/hr_contract/hr_contract.py +++ b/addons/hr_contract/hr_contract.py @@ -46,7 +46,7 @@ class hr_employee(osv.osv): 'vehicle': fields.char('Company Vehicle', size=64), 'vehicle_distance': fields.integer('Home-Work Distance', help="In kilometers"), 'contract_ids': fields.one2many('hr.contract', 'employee_id', 'Contracts'), - 'contract_id':fields.function(_get_latest_contract, method=True, string='Contract', type='many2one', relation="hr.contract", help='Latest contract of the employee'), + 'contract_id':fields.function(_get_latest_contract, string='Contract', type='many2one', relation="hr.contract", help='Latest contract of the employee'), } hr_employee() diff --git a/addons/hr_expense/hr_expense.py b/addons/hr_expense/hr_expense.py index 2e7020306b5..0f996c79e79 100644 --- a/addons/hr_expense/hr_expense.py +++ b/addons/hr_expense/hr_expense.py @@ -70,7 +70,7 @@ class hr_expense_expense(osv.osv): 'account_move_id': fields.many2one('account.move', 'Ledger Posting'), 'line_ids': fields.one2many('hr.expense.line', 'expense_id', 'Expense Lines', readonly=True, states={'draft':[('readonly',False)]} ), 'note': fields.text('Note'), - 'amount': fields.function(_amount, method=True, string='Total Amount'), + 'amount': fields.function(_amount, string='Total Amount'), 'invoice_id': fields.many2one('account.invoice', "Employee's Invoice"), 'currency_id': fields.many2one('res.currency', 'Currency', required=True), 'department_id':fields.many2one('hr.department','Department'), @@ -244,7 +244,7 @@ class hr_expense_line(osv.osv): 'name': fields.char('Expense Note', size=128, required=True), 'date_value': fields.date('Date', required=True), 'expense_id': fields.many2one('hr.expense.expense', 'Expense', ondelete='cascade', select=True), - 'total_amount': fields.function(_amount, method=True, string='Total', digits_compute=dp.get_precision('Account')), + 'total_amount': fields.function(_amount, string='Total', digits_compute=dp.get_precision('Account')), 'unit_amount': fields.float('Unit Price', digits_compute=dp.get_precision('Account')), 'unit_quantity': fields.float('Quantities' ), 'product_id': fields.many2one('product.product', 'Product', domain=[('hr_expense_ok','=',True)]), diff --git a/addons/hr_holidays/hr_holidays.py b/addons/hr_holidays/hr_holidays.py index 7074fd5cecc..18b1bacc836 100644 --- a/addons/hr_holidays/hr_holidays.py +++ b/addons/hr_holidays/hr_holidays.py @@ -78,9 +78,9 @@ class hr_holidays_status(osv.osv): 'color_name': fields.selection([('red', 'Red'),('blue','Blue'), ('lightgreen', 'Light Green'), ('lightblue','Light Blue'), ('lightyellow', 'Light Yellow'), ('magenta', 'Magenta'),('lightcyan', 'Light Cyan'),('black', 'Black'),('lightpink', 'Light Pink'),('brown', 'Brown'),('violet', 'Violet'),('lightcoral', 'Light Coral'),('lightsalmon', 'Light Salmon'),('lavender', 'Lavender'),('wheat', 'Wheat'),('ivory', 'Ivory')],'Color in Report', required=True, help='This color will be used in the leaves summary located in Reporting\Leaves by Departement'), 'limit': fields.boolean('Allow to Override Limit', help='If you tick this checkbox, the system will allow, for this section, the employees to take more leaves than the available ones.'), 'active': fields.boolean('Active', help="If the active field is set to false, it will allow you to hide the leave type without removing it."), - 'max_leaves': fields.function(_user_left_days, method=True, string='Maximum Allowed', help='This value is given by the sum of all holidays requests with a positive value.', multi='user_left_days'), - 'leaves_taken': fields.function(_user_left_days, method=True, string='Leaves Already Taken', help='This value is given by the sum of all holidays requests with a negative value.', multi='user_left_days'), - 'remaining_leaves': fields.function(_user_left_days, method=True, string='Remaining Leaves', help='Maximum Leaves Allowed - Leaves Already Taken', multi='user_left_days'), + 'max_leaves': fields.function(_user_left_days, string='Maximum Allowed', help='This value is given by the sum of all holidays requests with a positive value.', multi='user_left_days'), + 'leaves_taken': fields.function(_user_left_days, string='Leaves Already Taken', help='This value is given by the sum of all holidays requests with a negative value.', multi='user_left_days'), + 'remaining_leaves': fields.function(_user_left_days, string='Remaining Leaves', help='Maximum Leaves Allowed - Leaves Already Taken', multi='user_left_days'), 'double_validation': fields.boolean('Apply Double Validation', help="If its True then its Allocation/Request have to be validated by second validator") } _defaults = { @@ -127,7 +127,7 @@ class hr_holidays(osv.osv): 'manager_id': fields.many2one('hr.employee', 'First Approval', invisible=False, readonly=True, help='This area is automatically filled by the user who validate the leave'), 'notes': fields.text('Reasons',readonly=True, states={'draft':[('readonly',False)]}), 'number_of_days_temp': fields.float('Number of Days', readonly=True, states={'draft':[('readonly',False)]}), - 'number_of_days': fields.function(_compute_number_of_days, method=True, string='Number of Days', store=True), + 'number_of_days': fields.function(_compute_number_of_days, string='Number of Days', store=True), 'case_id': fields.many2one('crm.meeting', 'Meeting'), 'type': fields.selection([('remove','Leave Request'),('add','Allocation Request')], 'Request Type', required=True, readonly=True, states={'draft':[('readonly',False)]}, help="Choose 'Leave Request' if someone wants to take an off-day. \nChoose 'Allocation Request' if you want to increase the number of leaves available for someone"), 'parent_id': fields.many2one('hr.holidays', 'Parent'), diff --git a/addons/hr_payroll/hr_payroll.py b/addons/hr_payroll/hr_payroll.py index b29bd1312ac..43e35424da0 100644 --- a/addons/hr_payroll/hr_payroll.py +++ b/addons/hr_payroll/hr_payroll.py @@ -318,11 +318,11 @@ class hr_contract(osv.osv): 'visa_expire': fields.date('Visa Expire Date'), 'struct_id': fields.many2one('hr.payroll.structure', 'Salary Structure'), 'working_days_per_week': fields.integer('Working Days', help="No of Working days / week for an employee"), - 'basic': fields.function(_calculate_salary, method=True, store=True, multi='dc', type='float', string='Basic Salary', digits=(14,2)), - 'gross': fields.function(_calculate_salary, method=True, store=True, multi='dc', type='float', string='Gross Salary', digits=(14,2)), - 'net': fields.function(_calculate_salary, method=True, store=True, multi='dc', type='float', string='Net Salary', digits=(14,2)), - 'advantages_net': fields.function(_calculate_salary, method=True, store=True, multi='dc', type='float', string='Deductions', digits=(14,2)), - 'advantages_gross': fields.function(_calculate_salary, method=True, store=True, multi='dc', type='float', string='Allowances', digits=(14,2)), + 'basic': fields.function(_calculate_salary, store=True, multi='dc', type='float', string='Basic Salary', digits=(14,2)), + 'gross': fields.function(_calculate_salary, store=True, multi='dc', type='float', string='Gross Salary', digits=(14,2)), + 'net': fields.function(_calculate_salary, store=True, multi='dc', type='float', string='Net Salary', digits=(14,2)), + 'advantages_net': fields.function(_calculate_salary, store=True, multi='dc', type='float', string='Deductions', digits=(14,2)), + 'advantages_gross': fields.function(_calculate_salary, store=True, multi='dc', type='float', string='Allowances', digits=(14,2)), } _defaults = { 'working_days_per_week': lambda *a: 5, @@ -374,10 +374,10 @@ class payroll_register(osv.osv): ],'State', select=True, readonly=True), 'active':fields.boolean('Active', required=False), 'company_id':fields.many2one('res.company', 'Company', required=False), - 'grows': fields.function(_calculate, method=True, store=True, multi='dc', string='Gross Salary', type='float', digits=(16, 4)), - 'net': fields.function(_calculate, method=True, store=True, multi='dc', string='Net Salary', digits=(16, 4)), - 'allounce': fields.function(_calculate, method=True, store=True, multi='dc', string='Allowance', digits=(16, 4)), - 'deduction': fields.function(_calculate, method=True, store=True, multi='dc', string='Deduction', digits=(16, 4)), + 'grows': fields.function(_calculate, store=True, multi='dc', string='Gross Salary', type='float', digits=(16, 4)), + 'net': fields.function(_calculate, store=True, multi='dc', string='Net Salary', digits=(16, 4)), + 'allounce': fields.function(_calculate, store=True, multi='dc', string='Allowance', digits=(16, 4)), + 'deduction': fields.function(_calculate, store=True, multi='dc', string='Deduction', digits=(16, 4)), 'note': fields.text('Description'), 'bank_id':fields.many2one('res.bank', 'Bank', required=False, help="Select the Bank Address from whcih the salary is going to be paid"), } @@ -611,8 +611,8 @@ class contrib_register(osv.osv): 'company_id':fields.many2one('res.company', 'Company', required=False), 'name':fields.char('Name', size=256, required=True, readonly=False), 'register_line_ids':fields.one2many('hr.contibution.register.line', 'register_id', 'Register Line', readonly=True), - 'monthly_total_by_emp': fields.function(_total_contrib, method=True, multi='dc', string='Total By Employee', digits=(16, 4)), - 'monthly_total_by_comp': fields.function(_total_contrib, method=True, multi='dc', string='Total By Company', digits=(16, 4)), + 'monthly_total_by_emp': fields.function(_total_contrib, multi='dc', string='Total By Employee', digits=(16, 4)), + 'monthly_total_by_comp': fields.function(_total_contrib, multi='dc', string='Total By Company', digits=(16, 4)), 'note': fields.text('Description'), } _defaults = { @@ -644,7 +644,7 @@ class contrib_register_line(osv.osv): 'date': fields.date('Date'), 'emp_deduction': fields.float('Employee Deduction', digits=(16, 4)), 'comp_deduction': fields.float('Company Deduction', digits=(16, 4)), - 'total': fields.function(_total, method=True, store=True, string='Total', digits=(16, 4)), + 'total': fields.function(_total, store=True, string='Total', digits=(16, 4)), } _defaults = { 'date': lambda *a: time.strftime('%Y-%m-%d'), @@ -884,12 +884,12 @@ class hr_payslip(osv.osv): 'basic_before_leaves': fields.float('Basic Salary', readonly=True, digits_compute=dp.get_precision('Account')), 'leaves': fields.float('Leave Deductions', readonly=True, digits_compute=dp.get_precision('Account')), 'basic': fields.float('Net Basic', readonly=True, digits_compute=dp.get_precision('Account')), - 'grows': fields.function(_calculate, method=True, store=True, multi='dc', string='Gross Salary', digits_compute=dp.get_precision('Account')), - 'net': fields.function(_calculate, method=True, store=True, multi='dc', string='Net Salary', digits_compute=dp.get_precision('Account')), - 'allounce': fields.function(_calculate, method=True, store=True, multi='dc', string='Allowance', digits_compute=dp.get_precision('Account')), - 'deduction': fields.function(_calculate, method=True, store=True, multi='dc', string='Deduction', digits_compute=dp.get_precision('Account')), - 'other_pay': fields.function(_calculate, method=True, store=True, multi='dc', string='Others', digits_compute=dp.get_precision('Account')), - 'total_pay': fields.function(_calculate, method=True, store=True, multi='dc', string='Total Payment', digits_compute=dp.get_precision('Account')), + 'grows': fields.function(_calculate, store=True, multi='dc', string='Gross Salary', digits_compute=dp.get_precision('Account')), + 'net': fields.function(_calculate, store=True, multi='dc', string='Net Salary', digits_compute=dp.get_precision('Account')), + 'allounce': fields.function(_calculate, store=True, multi='dc', string='Allowance', digits_compute=dp.get_precision('Account')), + 'deduction': fields.function(_calculate, store=True, multi='dc', string='Deduction', digits_compute=dp.get_precision('Account')), + 'other_pay': fields.function(_calculate, store=True, multi='dc', string='Others', digits_compute=dp.get_precision('Account')), + 'total_pay': fields.function(_calculate, store=True, multi='dc', string='Total Payment', digits_compute=dp.get_precision('Account')), 'line_ids':fields.one2many('hr.payslip.line', 'slip_id', 'Payslip Line', required=False, readonly=True, states={'draft': [('readonly', False)]}), 'company_id':fields.many2one('res.company', 'Company', required=False, readonly=True, states={'draft': [('readonly', False)]}), 'holiday_days': fields.float('No of Leaves', readonly=True), @@ -1436,11 +1436,11 @@ class hr_employee(osv.osv): 'slip_ids':fields.one2many('hr.payslip', 'employee_id', 'Payslips', required=False, readonly=True), 'otherid': fields.char('Other Id', size=64), - 'basic': fields.function(_calculate_salary, method=True, multi='dc', type='float', string='Basic Salary', digits=(14,2)), - 'gross': fields.function(_calculate_salary, method=True, multi='dc', type='float', string='Gross Salary', digits=(14,2)), - 'net': fields.function(_calculate_salary, method=True, multi='dc', type='float', string='Net Salary', digits=(14,2)), - 'advantages_net': fields.function(_calculate_salary, method=True, multi='dc', type='float', string='Deductions', digits=(14,2)), - 'advantages_gross': fields.function(_calculate_salary, method=True, multi='dc', type='float', string='Allowances', digits=(14,2)), + 'basic': fields.function(_calculate_salary, multi='dc', type='float', string='Basic Salary', digits=(14,2)), + 'gross': fields.function(_calculate_salary, multi='dc', type='float', string='Gross Salary', digits=(14,2)), + 'net': fields.function(_calculate_salary, multi='dc', type='float', string='Net Salary', digits=(14,2)), + 'advantages_net': fields.function(_calculate_salary, multi='dc', type='float', string='Deductions', digits=(14,2)), + 'advantages_gross': fields.function(_calculate_salary, multi='dc', type='float', string='Allowances', digits=(14,2)), } hr_employee() diff --git a/addons/hr_payroll_account/hr_payroll_account.py b/addons/hr_payroll_account/hr_payroll_account.py index 416aeb485ef..deb06b121d0 100644 --- a/addons/hr_payroll_account/hr_payroll_account.py +++ b/addons/hr_payroll_account/hr_payroll_account.py @@ -180,8 +180,8 @@ class contrib_register(osv.osv): _columns = { 'account_id': fields.many2one('account.account', 'Account'), 'analytic_account_id':fields.many2one('account.analytic.account', 'Analytic Account'), - 'yearly_total_by_emp': fields.function(_total_contrib, method=True, multi='dc', store=True, string='Total By Employee', digits=(16, 4)), - 'yearly_total_by_comp': fields.function(_total_contrib, method=True, multi='dc', store=True, string='Total By Company', digits=(16, 4)), + 'yearly_total_by_emp': fields.function(_total_contrib, multi='dc', store=True, string='Total By Employee', digits=(16, 4)), + 'yearly_total_by_comp': fields.function(_total_contrib, multi='dc', store=True, string='Total By Company', digits=(16, 4)), } contrib_register() diff --git a/addons/hr_timesheet_invoice/hr_timesheet_invoice.py b/addons/hr_timesheet_invoice/hr_timesheet_invoice.py index 5c042c5c7e3..d9314690ce7 100644 --- a/addons/hr_timesheet_invoice/hr_timesheet_invoice.py +++ b/addons/hr_timesheet_invoice/hr_timesheet_invoice.py @@ -66,7 +66,7 @@ class account_analytic_account(osv.osv): 'pricelist_id': fields.many2one('product.pricelist', 'Sale Pricelist', help="The product to invoice is defined on the employee form, the price will be deduced by this pricelist on the product."), 'amount_max': fields.float('Max. Invoice Price'), - 'amount_invoiced': fields.function(_invoiced_calc, method=True, string='Invoiced Amount', + 'amount_invoiced': fields.function(_invoiced_calc, string='Invoiced Amount', help="Total invoiced"), 'to_invoice': fields.many2one('hr_timesheet_invoice.factor', 'Reinvoice Costs', help="Fill this field if you plan to automatically generate invoices based " \ diff --git a/addons/hr_timesheet_sheet/hr_timesheet_sheet.py b/addons/hr_timesheet_sheet/hr_timesheet_sheet.py index 4384a9e536f..cf4351112a4 100644 --- a/addons/hr_timesheet_sheet/hr_timesheet_sheet.py +++ b/addons/hr_timesheet_sheet/hr_timesheet_sheet.py @@ -286,13 +286,13 @@ class hr_timesheet_sheet(osv.osv): help=' * The \'Draft\' state is used when a user is encoding a new and unconfirmed timesheet. \ \n* The \'Confirmed\' state is used for to confirm the timesheet by user. \ \n* The \'Done\' state is used when users timesheet is accepted by his/her senior.'), - 'state_attendance' : fields.function(_state_attendance, method=True, type='selection', selection=[('absent', 'Absent'), ('present', 'Present'),('none','No employee defined')], string='Current Status'), - 'total_attendance_day': fields.function(_total_day, method=True, string='Total Attendance', multi="_total_day"), - 'total_timesheet_day': fields.function(_total_day, method=True, string='Total Timesheet', multi="_total_day"), - 'total_difference_day': fields.function(_total_day, method=True, string='Difference', multi="_total_day"), - 'total_attendance': fields.function(_total, method=True, string='Total Attendance', multi="_total_sheet"), - 'total_timesheet': fields.function(_total, method=True, string='Total Timesheet', multi="_total_sheet"), - 'total_difference': fields.function(_total, method=True, string='Difference', multi="_total_sheet"), + 'state_attendance' : fields.function(_state_attendance, type='selection', selection=[('absent', 'Absent'), ('present', 'Present'),('none','No employee defined')], string='Current Status'), + 'total_attendance_day': fields.function(_total_day, string='Total Attendance', multi="_total_day"), + 'total_timesheet_day': fields.function(_total_day, string='Total Timesheet', multi="_total_day"), + 'total_difference_day': fields.function(_total_day, string='Difference', multi="_total_day"), + 'total_attendance': fields.function(_total, string='Total Attendance', multi="_total_sheet"), + 'total_timesheet': fields.function(_total, string='Total Timesheet', multi="_total_sheet"), + 'total_difference': fields.function(_total, string='Difference', multi="_total_sheet"), 'period_ids': fields.one2many('hr_timesheet_sheet.sheet.day', 'sheet_id', 'Period', readonly=True), 'account_ids': fields.one2many('hr_timesheet_sheet.sheet.account', 'sheet_id', 'Analytic accounts', readonly=True), 'company_id': fields.many2one('res.company', 'Company'), @@ -473,7 +473,7 @@ class hr_timesheet_line(osv.osv): return [('id', 'in', [x[0] for x in res])] _columns = { - 'sheet_id': fields.function(_sheet, method=True, string='Sheet', + 'sheet_id': fields.function(_sheet, string='Sheet', type='many2one', relation='hr_timesheet_sheet.sheet', fnct_search=_sheet_search), } @@ -598,7 +598,7 @@ class hr_attendance(osv.osv): return [('id', 'in', [x[0] for x in res])] _columns = { - 'sheet_id': fields.function(_sheet, method=True, string='Sheet', + 'sheet_id': fields.function(_sheet, string='Sheet', type='many2one', relation='hr_timesheet_sheet.sheet', fnct_search=_sheet_search), } diff --git a/addons/idea/idea.py b/addons/idea/idea.py index 04ae4dff5df..0e6e89f15b5 100644 --- a/addons/idea/idea.py +++ b/addons/idea/idea.py @@ -52,7 +52,7 @@ class idea_category(osv.osv): _columns = { 'name': fields.char('Category', size=64, required=True), - 'complete_name': fields.function(_categ_name_get_fnc, method=True, type="char", string='Name'), + 'complete_name': fields.function(_categ_name_get_fnc, type="char", string='Name'), 'summary': fields.text('Summary'), 'parent_id': fields.many2one('idea.category', 'Parent Categories', ondelete='set null'), 'child_ids': fields.one2many('idea.category', 'parent_id', 'Child Categories'), @@ -180,10 +180,10 @@ class idea_idea(osv.osv): 'created_date': fields.datetime('Creation date', readonly=True), 'open_date': fields.datetime('Open date', readonly=True, help="Date when an idea opened"), 'vote_ids': fields.one2many('idea.vote', 'idea_id', 'Vote'), - 'my_vote': fields.function(_vote_read, fnct_inv = _vote_save, string="My Vote", method=True, type="selection", selection=VoteValues), - 'vote_avg': fields.function(_vote_avg_compute, method=True, string="Average Score", type="float"), - 'count_votes': fields.function(_vote_count, method=True, string="Count of votes", type="integer"), - 'count_comments': fields.function(_comment_count, method=True, string="Count of comments", type="integer"), + 'my_vote': fields.function(_vote_read, fnct_inv = _vote_save, string="My Vote", type="selection", selection=VoteValues), + 'vote_avg': fields.function(_vote_avg_compute, string="Average Score", type="float"), + 'count_votes': fields.function(_vote_count, string="Count of votes", type="integer"), + 'count_comments': fields.function(_comment_count, string="Count of comments", type="integer"), 'category_id': fields.many2one('idea.category', 'Category', required=True, readonly=True, states={'draft':[('readonly',False)]}), 'state': fields.selection([('draft', 'Draft'), ('open', 'Opened'), diff --git a/addons/l10n_ch/invoice.py b/addons/l10n_ch/invoice.py index af9beac55e0..4896931b77b 100644 --- a/addons/l10n_ch/invoice.py +++ b/addons/l10n_ch/invoice.py @@ -73,7 +73,7 @@ class account_invoice(osv.osv): help='The partner bank account to pay\nKeep empty to use the default' ), ### Amount to pay - 'amount_to_pay': fields.function(_amount_to_pay, method=True, + 'amount_to_pay': fields.function(_amount_to_pay, type='float', string='Amount to be paid', help='The amount which should be paid at the current date\n' \ 'minus the amount which is already in payment order'), diff --git a/addons/lunch/lunch.py b/addons/lunch/lunch.py index 1499dd4414e..c940d23fa40 100644 --- a/addons/lunch/lunch.py +++ b/addons/lunch/lunch.py @@ -81,7 +81,7 @@ class lunch_cashbox(osv.osv): _columns = { 'manager': fields.many2one('res.users', 'Manager'), 'name': fields.char('Name', size=30, required=True, unique = True), - 'sum_remain': fields.function(amount_available, method=True, string='Total Remaining'), + 'sum_remain': fields.function(amount_available, string='Total Remaining'), } lunch_cashbox() @@ -140,7 +140,7 @@ class lunch_order(osv.osv): states = {'draft':[('readonly', False)]}), 'state': fields.selection([('draft', 'Draft'), ('confirmed', 'Confirmed'), ], \ 'State', readonly=True, select=True), - 'price': fields.function(_price_get, method=True, string="Price"), + 'price': fields.function(_price_get, string="Price"), 'category': fields.many2one('lunch.category','Category'), } diff --git a/addons/mail_gateway/mail_gateway.py b/addons/mail_gateway/mail_gateway.py index ab40a9572e1..4fa70484666 100644 --- a/addons/mail_gateway/mail_gateway.py +++ b/addons/mail_gateway/mail_gateway.py @@ -281,7 +281,7 @@ class mailgate_message(osv.osv): 'description': fields.text('Description', readonly=True), 'partner_id': fields.many2one('res.partner', 'Partner', required=False), 'attachment_ids': fields.many2many('ir.attachment', 'message_attachment_rel', 'message_id', 'attachment_id', 'Attachments', readonly=True), - 'display_text': fields.function(_get_display_text, method=True, type='text', size="512", string='Display Text'), + 'display_text': fields.function(_get_display_text, type='text', size="512", string='Display Text'), } def init(self, cr): diff --git a/addons/marketing_campaign/marketing_campaign.py b/addons/marketing_campaign/marketing_campaign.py index 15c86f5298e..ae1ab2309e2 100644 --- a/addons/marketing_campaign/marketing_campaign.py +++ b/addons/marketing_campaign/marketing_campaign.py @@ -281,7 +281,7 @@ class marketing_campaign_segment(osv.osv): 'State',), 'date_run': fields.datetime('Launch Date', help="Initial start date of this segment."), 'date_done': fields.datetime('End Date', help="Date this segment was last closed or cancelled."), - 'date_next_sync': fields.function(_get_next_sync, method=True, string='Next Synchronization', type='datetime', help="Next time the synchronization job is scheduled to run automatically"), + 'date_next_sync': fields.function(_get_next_sync, string='Next Synchronization', type='datetime', help="Next time the synchronization job is scheduled to run automatically"), } _defaults = { @@ -548,7 +548,7 @@ class marketing_campaign_transition(osv.osv): _columns = { - 'name': fields.function(_get_name, method=True, string='Name', + 'name': fields.function(_get_name, string='Name', type='char', size=128), 'activity_from_id': fields.many2one('marketing.campaign.activity', 'Previous Activity', select=1, @@ -649,7 +649,7 @@ class marketing_campaign_workitem(osv.osv): 'object_id': fields.related('activity_id', 'campaign_id', 'object_id', type='many2one', relation='ir.model', string='Resource', select=1, readonly=True, store=True), 'res_id': fields.integer('Resource ID', select=1, readonly=True), - 'res_name': fields.function(_res_name_get, method=True, string='Resource Name', fnct_search=_resource_search, type="char", size=64), + 'res_name': fields.function(_res_name_get, string='Resource Name', fnct_search=_resource_search, type="char", size=64), 'date': fields.datetime('Execution Date', help='If date is not set, this workitem has to be run manually', readonly=True), 'partner_id': fields.many2one('res.partner', 'Partner', select=1, readonly=True), 'state': fields.selection([('todo', 'To Do'), diff --git a/addons/marketing_campaign/report/campaign_analysis.py b/addons/marketing_campaign/report/campaign_analysis.py index 0b245aee785..af04a7e6dff 100644 --- a/addons/marketing_campaign/report/campaign_analysis.py +++ b/addons/marketing_campaign/report/campaign_analysis.py @@ -62,7 +62,7 @@ class campaign_analysis(osv.osv): 'partner_id': fields.many2one('res.partner', 'Partner', readonly=True), 'country_id': fields.related('partner_id','address', 'country_id', type='many2one', relation='res.country',string='Country'), - 'total_cost' : fields.function(_total_cost, string='Cost', method=True, + 'total_cost' : fields.function(_total_cost, string='Cost', type="float", digits_compute=dp.get_precision('Purchase Price')), 'revenue': fields.float('Revenue', readonly=True, digits_compute=dp.get_precision('Sale Price')), 'count' : fields.integer('# of Actions', readonly=True), diff --git a/addons/membership/membership.py b/addons/membership/membership.py index 48fd8dc2d41..6384a255ac3 100644 --- a/addons/membership/membership.py +++ b/addons/membership/membership.py @@ -149,7 +149,7 @@ class membership_line(osv.osv): 'member_price': fields.float('Member Price', digits_compute= dp.get_precision('Sale Price'), required=True, help='Amount for the membership'), 'account_invoice_line': fields.many2one('account.invoice.line', 'Account Invoice line', readonly=True), 'account_invoice_id': fields.related('account_invoice_line', 'invoice_id', type='many2one', relation='account.invoice', string='Invoice', readonly=True), - 'state': fields.function(_state, method=True, + 'state': fields.function(_state, string='Membership State', type='selection', selection=STATE, store = { 'account.invoice': (_get_membership_lines, ['state'], 10), @@ -322,7 +322,7 @@ class Partner(osv.osv): 'Membership amount', digits=(16, 2), help = 'The price negotiated by the partner'), 'membership_state': fields.function( - __get_membership_state, method=True, + __get_membership_state, string = 'Current Membership State', type = 'selection', selection = STATE, store = { @@ -337,7 +337,7 @@ class Partner(osv.osv): -Invoiced Member: A member whose invoice has been created. -Paid Member: A member who has paid the membership amount."""), 'membership_start': fields.function( - _membership_date, method=True, multi = 'membeship_start', + _membership_date, multi = 'membeship_start', string = 'Start membership date', type = 'date', store = { 'account.invoice': (_get_invoice_partner, ['state'], 10), @@ -345,7 +345,7 @@ class Partner(osv.osv): 'res.partner': (lambda self, cr, uid, ids, c={}: ids, ['free_member'], 10) }, help="Date from which membership becomes active."), 'membership_stop': fields.function( - _membership_date, method=True, + _membership_date, string = 'Stop membership date', type='date', multi='membership_stop', store = { 'account.invoice': (_get_invoice_partner, ['state'], 10), @@ -353,7 +353,7 @@ class Partner(osv.osv): 'res.partner': (lambda self, cr, uid, ids, c={}: ids, ['free_member'], 10) }, help="Date until which membership remains active."), 'membership_cancel': fields.function( - _membership_date, method=True, + _membership_date, string = 'Cancel membership date', type='date', multi='membership_cancel', store = { 'account.invoice': (_get_invoice_partner, ['state'], 11), diff --git a/addons/mrp/mrp.py b/addons/mrp/mrp.py index 5603327290d..ec429488914 100644 --- a/addons/mrp/mrp.py +++ b/addons/mrp/mrp.py @@ -197,7 +197,7 @@ class mrp_bom(osv.osv): help= "If a sub-product is used in several products, it can be useful to create its own BoM. "\ "Though if you don't want separated production orders for this sub-product, select Set/Phantom as BoM type. "\ "If a Phantom BoM is used for a root product, it will be sold and shipped as a set of components, instead of being produced."), - 'method': fields.function(_compute_type, string='Method', method=True, type='selection', selection=[('',''),('stock','On Stock'),('order','On Order'),('set','Set / Pack')]), + 'method': fields.function(_compute_type, string='Method', type='selection', selection=[('',''),('stock','On Stock'),('order','On Order'),('set','Set / Pack')]), 'date_start': fields.date('Valid From', help="Validity of this BoM or component. Keep empty if it's always valid."), 'date_stop': fields.date('Valid Until', help="Validity of this BoM or component. Keep empty if it's always valid."), 'sequence': fields.integer('Sequence', help="Gives the sequence order when displaying a list of bills of material."), @@ -214,7 +214,7 @@ class mrp_bom(osv.osv): 'routing_id': fields.many2one('mrp.routing', 'Routing', help="The list of operations (list of work centers) to produce the finished product. The routing is mainly used to compute work center costs during operations and to plan future loads on work centers based on production planning."), 'property_ids': fields.many2many('mrp.property', 'mrp_bom_property_rel', 'bom_id','property_id', 'Properties'), 'revision_ids': fields.one2many('mrp.bom.revision', 'bom_id', 'BoM Revisions'), - 'child_complete_ids': fields.function(_child_compute, relation='mrp.bom', method=True, string="BoM Hierarchy", type='many2many'), + 'child_complete_ids': fields.function(_child_compute, relation='mrp.bom', string="BoM Hierarchy", type='many2many'), 'company_id': fields.many2one('res.company','Company',required=True), } _defaults = { @@ -457,8 +457,8 @@ class mrp_production(osv.osv): 'location_dest_id': fields.many2one('stock.location', 'Finished Products Location', required=True, readonly=True, states={'draft':[('readonly',False)]}, help="Location where the system will stock the finished products."), - 'date_planned_end': fields.function(_production_date_end, method=True, type='date', string='Scheduled End Date'), - 'date_planned_date': fields.function(_production_date, method=True, type='date', string='Scheduled Date'), + 'date_planned_end': fields.function(_production_date_end, type='date', string='Scheduled End Date'), + 'date_planned_date': fields.function(_production_date, type='date', string='Scheduled Date'), 'date_planned': fields.datetime('Scheduled date', required=True, select=1), 'date_start': fields.datetime('Start Date', select=True), 'date_finished': fields.datetime('End Date', select=True), @@ -478,8 +478,8 @@ class mrp_production(osv.osv): 'state': fields.selection([('draft','Draft'),('picking_except', 'Picking Exception'),('confirmed','Waiting Goods'),('ready','Ready to Produce'),('in_production','In Production'),('cancel','Cancelled'),('done','Done')],'State', readonly=True, help='When the production order is created the state is set to \'Draft\'.\n If the order is confirmed the state is set to \'Waiting Goods\'.\n If any exceptions are there, the state is set to \'Picking Exception\'.\ \nIf the stock is available then the state is set to \'Ready to Produce\'.\n When the production gets started then the state is set to \'In Production\'.\n When the production is over, the state is set to \'Done\'.'), - 'hour_total': fields.function(_production_calc, method=True, type='float', string='Total Hours', multi='workorder', store=True), - 'cycle_total': fields.function(_production_calc, method=True, type='float', string='Total Cycles', multi='workorder', store=True), + 'hour_total': fields.function(_production_calc, type='float', string='Total Hours', multi='workorder', store=True), + 'cycle_total': fields.function(_production_calc, type='float', string='Total Cycles', multi='workorder', store=True), 'company_id': fields.many2one('res.company','Company',required=True), } _defaults = { diff --git a/addons/mrp_operations/mrp_operations.py b/addons/mrp_operations/mrp_operations.py index 589d3c27031..fe926d30ac1 100644 --- a/addons/mrp_operations/mrp_operations.py +++ b/addons/mrp_operations/mrp_operations.py @@ -92,9 +92,9 @@ class mrp_production_workcenter_line(osv.osv): "* When work order is in running mode, during that time if user wants to stop or to make changes in order then can set in 'Pause' state.\n" \ "* When the user cancels the work order it will be set in 'Canceled' state.\n" \ "* When order is completely processed that time it is set in 'Finished' state."), - 'date_start_date': fields.function(_get_date_date, method=True, string='Start Date', type='date'), + 'date_start_date': fields.function(_get_date_date, string='Start Date', type='date'), 'date_planned': fields.datetime('Scheduled Date'), - 'date_planned_end': fields.function(_get_date_end, method=True, string='End Date', type='datetime'), + 'date_planned_end': fields.function(_get_date_end, string='End Date', type='datetime'), 'date_start': fields.datetime('Start Date'), 'date_finished': fields.datetime('End Date'), 'delay': fields.float('Working Hours',help="This is lead time between operation start and stop in this Work Center",readonly=True), @@ -554,7 +554,7 @@ class mrp_operations_operation(osv.osv): 'code_id':fields.many2one('mrp_operations.operation.code','Code',required=True), 'date_start': fields.datetime('Start Date'), 'date_finished': fields.datetime('End Date'), - 'order_date': fields.function(_get_order_date,method=True,string='Order Date',type='date',store={'mrp.production':(_order_date_search_production,['date_planned'], 10)}), + 'order_date': fields.function(_get_order_date,string='Order Date',type='date',store={'mrp.production':(_order_date_search_production,['date_planned'], 10)}), } _defaults={ 'date_start': lambda *a:datetime.now().strftime('%Y-%m-%d %H:%M:%S') diff --git a/addons/mrp_repair/mrp_repair.py b/addons/mrp_repair/mrp_repair.py index e95e3fb6058..caacb2e3247 100644 --- a/addons/mrp_repair/mrp_repair.py +++ b/addons/mrp_repair/mrp_repair.py @@ -117,7 +117,7 @@ class mrp_repair(osv.osv): 'product_id': fields.many2one('product.product', string='Product to Repair', required=True, readonly=True, states={'draft':[('readonly',False)]}), 'partner_id' : fields.many2one('res.partner', 'Partner', select=True, help='This field allow you to choose the parner that will be invoiced and delivered'), 'address_id': fields.many2one('res.partner.address', 'Delivery Address', domain="[('partner_id','=',partner_id)]"), - 'default_address_id': fields.function(_get_default_address, method=True, type="many2one", relation="res.partner.address"), + 'default_address_id': fields.function(_get_default_address, type="many2one", relation="res.partner.address"), 'prodlot_id': fields.many2one('stock.production.lot', 'Lot Number', select=True, domain="[('product_id','=',product_id)]"), 'state': fields.selection([ ('draft','Quotation'), @@ -156,17 +156,17 @@ class mrp_repair(osv.osv): 'deliver_bool': fields.boolean('Deliver', help="Check this box if you want to manage the delivery once the product is repaired. If cheked, it will create a picking with selected product. Note that you can select the locations in the Info tab, if you have the extended view."), 'invoiced': fields.boolean('Invoiced', readonly=True), 'repaired': fields.boolean('Repaired', readonly=True), - 'amount_untaxed': fields.function(_amount_untaxed, method=True, string='Untaxed Amount', + 'amount_untaxed': fields.function(_amount_untaxed, string='Untaxed Amount', store={ 'mrp.repair': (lambda self, cr, uid, ids, c={}: ids, ['operations'], 10), 'mrp.repair.line': (_get_lines, ['price_unit', 'price_subtotal', 'product_id', 'tax_id', 'product_uom_qty', 'product_uom'], 10), }), - 'amount_tax': fields.function(_amount_tax, method=True, string='Taxes', + 'amount_tax': fields.function(_amount_tax, string='Taxes', store={ 'mrp.repair': (lambda self, cr, uid, ids, c={}: ids, ['operations'], 10), 'mrp.repair.line': (_get_lines, ['price_unit', 'price_subtotal', 'product_id', 'tax_id', 'product_uom_qty', 'product_uom'], 10), }), - 'amount_total': fields.function(_amount_total, method=True, string='Total', + 'amount_total': fields.function(_amount_total, string='Total', store={ 'mrp.repair': (lambda self, cr, uid, ids, c={}: ids, ['operations'], 10), 'mrp.repair.line': (_get_lines, ['price_unit', 'price_subtotal', 'product_id', 'tax_id', 'product_uom_qty', 'product_uom'], 10), @@ -661,7 +661,7 @@ class mrp_repair_line(osv.osv, ProductChangeMixin): 'product_id': fields.many2one('product.product', 'Product', domain=[('sale_ok','=',True)], required=True), 'invoiced': fields.boolean('Invoiced',readonly=True), 'price_unit': fields.float('Unit Price', required=True, digits_compute= dp.get_precision('Sale Price')), - 'price_subtotal': fields.function(_amount_line, method=True, string='Subtotal',digits_compute= dp.get_precision('Sale Price')), + 'price_subtotal': fields.function(_amount_line, string='Subtotal',digits_compute= dp.get_precision('Sale Price')), 'tax_id': fields.many2many('account.tax', 'repair_operation_line_tax', 'repair_operation_line_id', 'tax_id', 'Taxes'), 'product_uom_qty': fields.float('Quantity (UoM)', digits=(16,2), required=True), 'product_uom': fields.many2one('product.uom', 'Product UoM', required=True), @@ -750,7 +750,7 @@ class mrp_repair_fee(osv.osv, ProductChangeMixin): 'product_uom_qty': fields.float('Quantity', digits=(16,2), required=True), 'price_unit': fields.float('Unit Price', required=True), 'product_uom': fields.many2one('product.uom', 'Product UoM', required=True), - 'price_subtotal': fields.function(_amount_line, method=True, string='Subtotal',digits_compute= dp.get_precision('Sale Price')), + 'price_subtotal': fields.function(_amount_line, string='Subtotal',digits_compute= dp.get_precision('Sale Price')), 'tax_id': fields.many2many('account.tax', 'repair_fee_line_tax', 'repair_fee_line_id', 'tax_id', 'Taxes'), 'invoice_line_id': fields.many2one('account.invoice.line', 'Invoice Line', readonly=True), 'to_invoice': fields.boolean('To Invoice'), diff --git a/addons/point_of_sale/point_of_sale.py b/addons/point_of_sale/point_of_sale.py index 4eeb7b2dd9f..917e6273ddc 100644 --- a/addons/point_of_sale/point_of_sale.py +++ b/addons/point_of_sale/point_of_sale.py @@ -253,17 +253,17 @@ class pos_order(osv.osv): method=True, string='Validation Date', type='date', select=True, store=True), - 'date_payment': fields.function(_get_date_payment2, method=True, + 'date_payment': fields.function(_get_date_payment2, string='Payment Date', type='date', select=True, store=True), 'date_validity': fields.date('Validity Date', required=True), 'user_id': fields.many2one('res.users', 'Connected Salesman', help="Person who uses the the cash register. It could be a reliever, a student or an interim employee."), 'user_salesman_id': fields.many2one('res.users', 'Cashier', required=True, help="User who is logged into the system."), 'sale_manager': fields.many2one('res.users', 'Salesman Manager'), - 'amount_tax': fields.function(_amount_all, method=True, string='Taxes', digits_compute=dp.get_precision('Point Of Sale'), multi='all'), - 'amount_total': fields.function(_amount_all, method=True, string='Total', multi='all'), - 'amount_paid': fields.function(_amount_all, string='Paid', states={'draft': [('readonly', False)]}, readonly=True, method=True, digits_compute=dp.get_precision('Point Of Sale'), multi='all'), - 'amount_return': fields.function(_amount_all, 'Returned', method=True, digits_compute=dp.get_precision('Point Of Sale'), multi='all'), + 'amount_tax': fields.function(_amount_all, string='Taxes', digits_compute=dp.get_precision('Point Of Sale'), multi='all'), + 'amount_total': fields.function(_amount_all, string='Total', multi='all'), + 'amount_paid': fields.function(_amount_all, string='Paid', states={'draft': [('readonly', False)]}, readonly=True, digits_compute=dp.get_precision('Point Of Sale'), multi='all'), + 'amount_return': fields.function(_amount_all, 'Returned', digits_compute=dp.get_precision('Point Of Sale'), multi='all'), 'lines': fields.one2many('pos.order.line', 'order_id', 'Order Lines', states={'draft': [('readonly', False)]}, readonly=True), 'price_type': fields.selection([ ('tax_excluded','Tax excluded')], @@ -955,7 +955,7 @@ class account_bank_statement_line(osv.osv): res[line.id] = line.statement_id and line.statement_id.journal_id and line.statement_id.journal_id.name or None return res _columns= { - 'journal_id': fields.function(_get_statement_journal, method=True,store=True, string='Journal', type='char', size=64), + 'journal_id': fields.function(_get_statement_journal,store=True, string='Journal', type='char', size=64), 'am_out': fields.boolean("To count"), 'is_acc': fields.boolean("Is accompte"), 'pos_statement_id': fields.many2one('pos.order', ondelete='cascade'), @@ -1141,12 +1141,12 @@ class pos_order_line(osv.osv): 'notice': fields.char('Discount Notice', size=128, required=True), 'serial_number': fields.char('Serial Number', size=128), 'product_id': fields.many2one('product.product', 'Product', domain=[('sale_ok', '=', True)], required=True, change_default=True), - 'price_unit': fields.function(_get_amount, method=True, string='Unit Price', store=True), + 'price_unit': fields.function(_get_amount, string='Unit Price', store=True), 'price_ded': fields.float('Discount(Amount)', digits_compute=dp.get_precision('Point Of Sale')), 'qty': fields.float('Quantity'), 'qty_rfd': fields.float('Refunded Quantity'), - 'price_subtotal': fields.function(_amount_line_all, method=True, multi='pos_order_line_amount', string='Subtotal w/o Tax'), - 'price_subtotal_incl': fields.function(_amount_line_all, method=True, multi='pos_order_line_amount', string='Subtotal'), + 'price_subtotal': fields.function(_amount_line_all, multi='pos_order_line_amount', string='Subtotal w/o Tax'), + 'price_subtotal_incl': fields.function(_amount_line_all, multi='pos_order_line_amount', string='Subtotal'), 'discount': fields.float('Discount (%)', digits=(16, 2)), 'order_id': fields.many2one('pos.order', 'Order Ref', ondelete='cascade'), 'create_date': fields.datetime('Creation Date', readonly=True), diff --git a/addons/procurement/procurement.py b/addons/procurement/procurement.py index 743ef85a9ea..f05ca64144d 100644 --- a/addons/procurement/procurement.py +++ b/addons/procurement/procurement.py @@ -527,7 +527,7 @@ class stock_warehouse_orderpoint(osv.osv): help="The procurement quantity will be rounded up to this multiple."), 'procurement_id': fields.many2one('procurement.order', 'Latest procurement', ondelete="set null"), 'company_id': fields.many2one('res.company','Company',required=True), - 'procurement_draft_ids': fields.function(_get_draft_procurements, method=True, type='many2many', relation="procurement.order", \ + 'procurement_draft_ids': fields.function(_get_draft_procurements, type='many2many', relation="procurement.order", \ string="Related Procurement Orders",help="Draft procurement of the product and location of that orderpoint"), } _defaults = { diff --git a/addons/product/product.py b/addons/product/product.py index fa6796b3953..320b4552c18 100644 --- a/addons/product/product.py +++ b/addons/product/product.py @@ -206,7 +206,7 @@ class product_category(osv.osv): _description = "Product Category" _columns = { 'name': fields.char('Name', size=64, required=True, translate=True), - 'complete_name': fields.function(_name_get_fnc, method=True, type="char", string='Name'), + 'complete_name': fields.function(_name_get_fnc, type="char", string='Name'), 'parent_id': fields.many2one('product.category','Parent Category', select=True), 'child_id': fields.one2many('product.category', 'parent_id', string='Child Categories'), 'sequence': fields.integer('Sequence', help="Gives the sequence order when displaying a list of product categories."), @@ -296,9 +296,9 @@ class product_template(osv.osv): help='Coefficient to convert UOM to UOS\n' ' uos = uom * coeff'), 'mes_type': fields.selection((('fixed', 'Fixed'), ('variable', 'Variable')), 'Measure Type', required=True), - 'seller_delay': fields.function(_calc_seller, method=True, type='integer', string='Supplier Lead Time', multi="seller_delay", help="This is the average delay in days between the purchase order confirmation and the reception of goods for this product and for the default supplier. It is used by the scheduler to order requests based on reordering delays."), - 'seller_qty': fields.function(_calc_seller, method=True, type='float', string='Supplier Quantity', multi="seller_qty", help="This is minimum quantity to purchase from Main Supplier."), - 'seller_id': fields.function(_calc_seller, method=True, type='many2one', relation="res.partner", string='Main Supplier', help="Main Supplier who has highest priority in Supplier List.", multi="seller_id"), + 'seller_delay': fields.function(_calc_seller, type='integer', string='Supplier Lead Time', multi="seller_delay", help="This is the average delay in days between the purchase order confirmation and the reception of goods for this product and for the default supplier. It is used by the scheduler to order requests based on reordering delays."), + 'seller_qty': fields.function(_calc_seller, type='float', string='Supplier Quantity', multi="seller_qty", help="This is minimum quantity to purchase from Main Supplier."), + 'seller_id': fields.function(_calc_seller, type='many2one', relation="res.partner", string='Main Supplier', help="Main Supplier who has highest priority in Supplier List.", multi="seller_id"), 'seller_ids': fields.one2many('product.supplierinfo', 'product_id', 'Partners'), 'loc_rack': fields.char('Rack', size=16), 'loc_row': fields.char('Row', size=16), @@ -469,14 +469,14 @@ class product_product(osv.osv): _inherits = {'product.template': 'product_tmpl_id'} _order = 'default_code,name_template' _columns = { - 'qty_available': fields.function(_product_qty_available, method=True, type='float', string='Real Stock'), - 'virtual_available': fields.function(_product_virtual_available, method=True, type='float', string='Virtual Stock'), - 'incoming_qty': fields.function(_product_incoming_qty, method=True, type='float', string='Incoming'), - 'outgoing_qty': fields.function(_product_outgoing_qty, method=True, type='float', string='Outgoing'), - 'price': fields.function(_product_price, method=True, type='float', string='Pricelist', digits_compute=dp.get_precision('Sale Price')), - 'lst_price' : fields.function(_product_lst_price, method=True, type='float', string='Public Price', digits_compute=dp.get_precision('Sale Price')), - 'code': fields.function(_product_code, method=True, type='char', string='Reference'), - 'partner_ref' : fields.function(_product_partner_ref, method=True, type='char', string='Customer ref'), + 'qty_available': fields.function(_product_qty_available, type='float', string='Real Stock'), + 'virtual_available': fields.function(_product_virtual_available, type='float', string='Virtual Stock'), + 'incoming_qty': fields.function(_product_incoming_qty, type='float', string='Incoming'), + 'outgoing_qty': fields.function(_product_outgoing_qty, type='float', string='Outgoing'), + 'price': fields.function(_product_price, type='float', string='Pricelist', digits_compute=dp.get_precision('Sale Price')), + 'lst_price' : fields.function(_product_lst_price, type='float', string='Public Price', digits_compute=dp.get_precision('Sale Price')), + 'code': fields.function(_product_code, type='char', string='Reference'), + 'partner_ref' : fields.function(_product_partner_ref, type='char', string='Customer ref'), 'default_code' : fields.char('Reference', size=64), 'active': fields.boolean('Active', help="If the active field is set to False, it will allow you to hide the product without removing it."), 'variants': fields.char('Variants', size=64), @@ -733,7 +733,7 @@ class product_supplierinfo(osv.osv): 'sequence' : fields.integer('Sequence', help="Assigns the priority to the list of product supplier."), 'product_uom': fields.many2one('product.uom', string="Supplier UoM", help="Choose here the Unit of Measure in which the prices and quantities are expressed below."), 'min_qty': fields.float('Minimal Quantity', required=True, help="The minimal quantity to purchase to this supplier, expressed in the supplier Product UoM if not empty, in the default unit of measure of the product otherwise."), - 'qty': fields.function(_calc_qty, method=True, store=True, type='float', string='Quantity', multi="qty", help="This is a quantity which is converted into Default Uom."), + 'qty': fields.function(_calc_qty, store=True, type='float', string='Quantity', multi="qty", help="This is a quantity which is converted into Default Uom."), 'product_id' : fields.many2one('product.template', 'Product', required=True, ondelete='cascade', select=True), 'delay' : fields.integer('Delivery Lead Time', required=True, help="Lead time in days between the confirmation of the purchase order and the reception of the products in your warehouse. Used by the scheduler for automatic computation of the purchase order planning."), 'pricelist_ids': fields.one2many('pricelist.partnerinfo', 'suppinfo_id', 'Supplier Pricelist'), diff --git a/addons/product_margin/product_margin.py b/addons/product_margin/product_margin.py index 37639c3b223..5895feedf3f 100644 --- a/addons/product_margin/product_margin.py +++ b/addons/product_margin/product_margin.py @@ -92,38 +92,38 @@ class product_product(osv.osv): return res _columns = { - 'date_from': fields.function(_product_margin, method=True, type='date', string='From Date', multi='product_margin'), - 'date_to': fields.function(_product_margin, method=True, type='date', string='To Date', multi='product_margin'), - 'invoice_state': fields.function(_product_margin, method=True, type='selection', selection=[ + 'date_from': fields.function(_product_margin, type='date', string='From Date', multi='product_margin'), + 'date_to': fields.function(_product_margin, type='date', string='To Date', multi='product_margin'), + 'invoice_state': fields.function(_product_margin, type='selection', selection=[ ('paid','Paid'),('open_paid','Open and Paid'),('draft_open_paid','Draft, Open and Paid') ], string='Invoice State',multi='product_margin', readonly=True), - 'sale_avg_price' : fields.function(_product_margin, method=True, type='float', string='Avg. Unit Price', multi='product_margin', + 'sale_avg_price' : fields.function(_product_margin, type='float', string='Avg. Unit Price', multi='product_margin', help="Avg. Price in Customer Invoices)"), - 'purchase_avg_price' : fields.function(_product_margin, method=True, type='float', string='Avg. Unit Price', multi='product_margin', + 'purchase_avg_price' : fields.function(_product_margin, type='float', string='Avg. Unit Price', multi='product_margin', help="Avg. Price in Supplier Invoices "), - 'sale_num_invoiced' : fields.function(_product_margin, method=True, type='float', string='# Invoiced', multi='product_margin', + 'sale_num_invoiced' : fields.function(_product_margin, type='float', string='# Invoiced', multi='product_margin', help="Sum of Quantity in Customer Invoices"), - 'purchase_num_invoiced' : fields.function(_product_margin, method=True, type='float', string='# Invoiced', multi='product_margin', + 'purchase_num_invoiced' : fields.function(_product_margin, type='float', string='# Invoiced', multi='product_margin', help="Sum of Quantity in Supplier Invoices"), - 'sales_gap' : fields.function(_product_margin, method=True, type='float', string='Sales Gap', multi='product_margin', + 'sales_gap' : fields.function(_product_margin, type='float', string='Sales Gap', multi='product_margin', help="Expected Sale - Turn Over"), - 'purchase_gap' : fields.function(_product_margin, method=True, type='float', string='Purchase Gap', multi='product_margin', + 'purchase_gap' : fields.function(_product_margin, type='float', string='Purchase Gap', multi='product_margin', help="Normal Cost - Total Cost"), - 'turnover' : fields.function(_product_margin, method=True, type='float', string='Turnover' ,multi='product_margin', + 'turnover' : fields.function(_product_margin, type='float', string='Turnover' ,multi='product_margin', help="Sum of Multification of Invoice price and quantity of Customer Invoices"), - 'total_cost' : fields.function(_product_margin, method=True, type='float', string='Total Cost', multi='product_margin', + 'total_cost' : fields.function(_product_margin, type='float', string='Total Cost', multi='product_margin', help="Sum of Multification of Invoice price and quantity of Supplier Invoices "), - 'sale_expected' : fields.function(_product_margin, method=True, type='float', string='Expected Sale', multi='product_margin', + 'sale_expected' : fields.function(_product_margin, type='float', string='Expected Sale', multi='product_margin', help="Sum of Multification of Sale Catalog price and quantity of Customer Invoices"), - 'normal_cost' : fields.function(_product_margin, method=True, type='float', string='Normal Cost', multi='product_margin', + 'normal_cost' : fields.function(_product_margin, type='float', string='Normal Cost', multi='product_margin', help="Sum of Multification of Cost price and quantity of Supplier Invoices"), - 'total_margin' : fields.function(_product_margin, method=True, type='float', string='Total Margin', multi='product_margin', + 'total_margin' : fields.function(_product_margin, type='float', string='Total Margin', multi='product_margin', help="Turnorder - Standard price"), - 'expected_margin' : fields.function(_product_margin, method=True, type='float', string='Expected Margin', multi='product_margin', + 'expected_margin' : fields.function(_product_margin, type='float', string='Expected Margin', multi='product_margin', help="Expected Sale - Normal Cost"), - 'total_margin_rate' : fields.function(_product_margin, method=True, type='float', string='Total Margin (%)', multi='product_margin', + 'total_margin_rate' : fields.function(_product_margin, type='float', string='Total Margin (%)', multi='product_margin', help="Total margin * 100 / Turnover"), - 'expected_margin_rate' : fields.function(_product_margin, method=True, type='float', string='Expected Margin (%)', multi='product_margin', + 'expected_margin_rate' : fields.function(_product_margin, type='float', string='Expected Margin (%)', multi='product_margin', help="Expected margin * 100 / Expected Sale"), } diff --git a/addons/project/project.py b/addons/project/project.py index 3d20bc2f5f8..b1461da424c 100644 --- a/addons/project/project.py +++ b/addons/project/project.py @@ -123,7 +123,7 @@ class project(osv.osv): return super(project, self).unlink(cr, uid, ids, *args, **kwargs) _columns = { - 'complete_name': fields.function(_complete_name, method=True, string="Project Name", type='char', size=250), + 'complete_name': fields.function(_complete_name, string="Project Name", type='char', size=250), 'active': fields.boolean('Active', help="If the active field is set to False, it will allow you to hide the project without removing it."), 'sequence': fields.integer('Sequence', help="Gives the sequence order when displaying a list of Projects."), 'analytic_account_id': fields.many2one('account.analytic.account', 'Analytic Account', help="Link this project to an analytic account if you need financial management on projects. It enables you to connect projects with budgets, planning, cost and revenue analysis, timesheets on projects, etc.", ondelete="cascade", required=True), @@ -133,18 +133,18 @@ class project(osv.osv): 'members': fields.many2many('res.users', 'project_user_rel', 'project_id', 'uid', 'Project Members', help="Project's members are users who can have an access to the tasks related to this project.", states={'close':[('readonly',True)], 'cancelled':[('readonly',True)]}), 'tasks': fields.one2many('project.task', 'project_id', "Project tasks"), - 'planned_hours': fields.function(_progress_rate, multi="progress", method=True, string='Planned Time', help="Sum of planned hours of all tasks related to this project and its child projects.", + 'planned_hours': fields.function(_progress_rate, multi="progress", string='Planned Time', help="Sum of planned hours of all tasks related to this project and its child projects.", store = { 'project.project': (lambda self, cr, uid, ids, c={}: ids, ['tasks'], 10), 'project.task': (_get_project_task, ['planned_hours', 'effective_hours', 'remaining_hours', 'total_hours', 'progress', 'delay_hours','state'], 10), }), - 'effective_hours': fields.function(_progress_rate, multi="progress", method=True, string='Time Spent', help="Sum of spent hours of all tasks related to this project and its child projects."), - 'total_hours': fields.function(_progress_rate, multi="progress", method=True, string='Total Time', help="Sum of total hours of all tasks related to this project and its child projects.", + 'effective_hours': fields.function(_progress_rate, multi="progress", string='Time Spent', help="Sum of spent hours of all tasks related to this project and its child projects."), + 'total_hours': fields.function(_progress_rate, multi="progress", string='Total Time', help="Sum of total hours of all tasks related to this project and its child projects.", store = { 'project.project': (lambda self, cr, uid, ids, c={}: ids, ['tasks'], 10), 'project.task': (_get_project_task, ['planned_hours', 'effective_hours', 'remaining_hours', 'total_hours', 'progress', 'delay_hours','state'], 10), }), - 'progress_rate': fields.function(_progress_rate, multi="progress", method=True, string='Progress', type='float', group_operator="avg", help="Percent of tasks closed according to the total of tasks todo."), + 'progress_rate': fields.function(_progress_rate, multi="progress", string='Progress', type='float', group_operator="avg", help="Percent of tasks closed according to the total of tasks todo."), 'warn_customer': fields.boolean('Warn Partner', help="If you check this, the user will have a popup when closing a task that propose a message to send by email to the customer.", states={'close':[('readonly',True)], 'cancelled':[('readonly',True)]}), 'warn_header': fields.text('Mail Header', help="Header added at the beginning of the email for the warning message sent to the customer when a task is closed.", states={'close':[('readonly',True)], 'cancelled':[('readonly',True)]}), 'warn_footer': fields.text('Mail Footer', help="Footer added at the beginning of the email for the warning message sent to the customer when a task is closed.", states={'close':[('readonly',True)], 'cancelled':[('readonly',True)]}), @@ -420,7 +420,7 @@ class task(osv.osv): return result.keys() _columns = { - 'active': fields.function(_is_template, method=True, store=True, string='Not a Template Task', type='boolean', help="This field is computed automatically and have the same behavior than the boolean 'active' field: if the task is linked to a template or unactivated project, it will be hidden unless specifically asked."), + 'active': fields.function(_is_template, store=True, string='Not a Template Task', type='boolean', help="This field is computed automatically and have the same behavior than the boolean 'active' field: if the task is linked to a template or unactivated project, it will be hidden unless specifically asked."), 'name': fields.char('Task Summary', size=128, required=True), 'description': fields.text('Description'), 'priority': fields.selection([('4','Very Low'), ('3','Low'), ('2','Medium'), ('1','Important'), ('0','Very important')], 'Priority'), @@ -438,23 +438,23 @@ class task(osv.osv): 'child_ids': fields.many2many('project.task', 'project_task_parent_rel', 'parent_id', 'task_id', 'Delegated Tasks'), 'notes': fields.text('Notes'), 'planned_hours': fields.float('Planned Hours', help='Estimated time to do the task, usually set by the project manager when the task is in draft state.'), - 'effective_hours': fields.function(_hours_get, method=True, string='Hours Spent', multi='hours', help="Computed using the sum of the task work done.", + 'effective_hours': fields.function(_hours_get, string='Hours Spent', multi='hours', help="Computed using the sum of the task work done.", store = { 'project.task': (lambda self, cr, uid, ids, c={}: ids, ['work_ids', 'remaining_hours', 'planned_hours'], 10), 'project.task.work': (_get_task, ['hours'], 10), }), 'remaining_hours': fields.float('Remaining Hours', digits=(16,2), help="Total remaining time, can be re-estimated periodically by the assignee of the task."), - 'total_hours': fields.function(_hours_get, method=True, string='Total Hours', multi='hours', help="Computed as: Time Spent + Remaining Time.", + 'total_hours': fields.function(_hours_get, string='Total Hours', multi='hours', help="Computed as: Time Spent + Remaining Time.", store = { 'project.task': (lambda self, cr, uid, ids, c={}: ids, ['work_ids', 'remaining_hours', 'planned_hours'], 10), 'project.task.work': (_get_task, ['hours'], 10), }), - 'progress': fields.function(_hours_get, method=True, string='Progress (%)', multi='hours', group_operator="avg", help="If the task has a progress of 99.99% you should close the task if it's finished or reevaluate the time", + 'progress': fields.function(_hours_get, string='Progress (%)', multi='hours', group_operator="avg", help="If the task has a progress of 99.99% you should close the task if it's finished or reevaluate the time", store = { 'project.task': (lambda self, cr, uid, ids, c={}: ids, ['work_ids', 'remaining_hours', 'planned_hours','state'], 10), 'project.task.work': (_get_task, ['hours'], 10), }), - 'delay_hours': fields.function(_hours_get, method=True, string='Delay Hours', multi='hours', help="Computed as difference of the time estimated by the project manager and the real time to close the task.", + 'delay_hours': fields.function(_hours_get, string='Delay Hours', multi='hours', help="Computed as difference of the time estimated by the project manager and the real time to close the task.", store = { 'project.task': (lambda self, cr, uid, ids, c={}: ids, ['work_ids', 'remaining_hours', 'planned_hours'], 10), 'project.task.work': (_get_task, ['hours'], 10), diff --git a/addons/project_issue/project_issue.py b/addons/project_issue/project_issue.py index a8a32847243..abb9b7e92ff 100644 --- a/addons/project_issue/project_issue.py +++ b/addons/project_issue/project_issue.py @@ -216,7 +216,7 @@ class project_issue(crm.crm_case, osv.osv): 'message_ids': fields.one2many('mailgate.message', 'res_id', 'Messages', domain=[('model','=',_name)]), 'date_action_last': fields.datetime('Last Action', readonly=1), 'date_action_next': fields.datetime('Next Action', readonly=1), - 'progress': fields.function(_hours_get, method=True, string='Progress (%)', multi='hours', group_operator="avg", help="Computed as: Time Spent / Total Time.", + 'progress': fields.function(_hours_get, string='Progress (%)', multi='hours', group_operator="avg", help="Computed as: Time Spent / Total Time.", store = { 'project.issue': (lambda self, cr, uid, ids, c={}: ids, ['task_id'], 10), 'project.task': (_get_issue_task, ['progress'], 10), diff --git a/addons/project_long_term/project_long_term.py b/addons/project_long_term/project_long_term.py index a6437819248..6c5ef7890bf 100644 --- a/addons/project_long_term/project_long_term.py +++ b/addons/project_long_term/project_long_term.py @@ -120,7 +120,7 @@ class project_phase(osv.osv): 'state': fields.selection([('draft', 'Draft'), ('open', 'In Progress'), ('pending', 'Pending'), ('cancelled', 'Cancelled'), ('done', 'Done')], 'State', readonly=True, required=True, help='If the phase is created the state \'Draft\'.\n If the phase is started, the state becomes \'In Progress\'.\n If review is needed the phase is in \'Pending\' state.\ \n If the phase is over, the states is set to \'Done\'.'), - 'total_hours': fields.function(_compute, method=True, string='Total Hours'), + 'total_hours': fields.function(_compute, string='Total Hours'), } _defaults = { 'responsible_id': lambda obj,cr,uid,context: uid, @@ -399,7 +399,7 @@ class project_resource_allocation(osv.osv): res[allocation.id] = name return res _columns = { - 'name': fields.function(get_name, method=True, type='char', size=256), + 'name': fields.function(get_name, type='char', size=256), 'resource_id': fields.many2one('resource.resource', 'Resource', required=True), 'phase_id': fields.many2one('project.phase', 'Project Phase', ondelete='cascade', required=True), 'project_id': fields.related('phase_id', 'project_id', type='many2one', relation="project.project", string='Project', store=True), diff --git a/addons/project_planning/project_planning.py b/addons/project_planning/project_planning.py index 46cc225153e..701a9a12cd6 100644 --- a/addons/project_planning/project_planning.py +++ b/addons/project_planning/project_planning.py @@ -128,8 +128,8 @@ class report_account_analytic_planning(osv.osv): 'business_days': fields.integer('Business Days', required=True, states={'done':[('readonly', True)]}, help='Set here the number of working days within this planning for one person full time'), 'planning_user_ids': one2many_mod3('report_account_analytic.planning.user', 'planning_id', 'Planning By User'), 'planning_account': fields.one2many('report_account_analytic.planning.account', 'planning_id', 'Planning By Account'), - 'total_planned': fields.function(_get_total_planned, method=True, string='Total Planned'), - 'total_free': fields.function(_get_total_free, method=True, string='Total Free'), + 'total_planned': fields.function(_get_total_planned, string='Total Planned'), + 'total_free': fields.function(_get_total_free, string='Total Free'), } _defaults = { 'date_from': lambda *a: time.strftime('%Y-%m-01'), @@ -202,7 +202,7 @@ class report_account_analytic_planning_line(osv.osv): 'amount': fields.float('Quantity', required=True), 'amount_unit': fields.many2one('product.uom', 'Qty UoM', required=True), 'note': fields.text('Note', size=64), - 'amount_in_base_uom': fields.function(_amount_base_uom, method=True, string='Quantity in base uom', store=True), + 'amount_in_base_uom': fields.function(_amount_base_uom, string='Quantity in base uom', store=True), 'task_ids': fields.one2many('project.task', 'planning_line_id', 'Planning Tasks'), } _order = 'user_id, account_id' @@ -301,13 +301,13 @@ class report_account_analytic_planning_user(osv.osv): _columns = { 'planning_id': fields.many2one('report_account_analytic.planning', 'Planning'), 'user_id': fields.many2one('res.users', 'User', readonly=True), - 'tasks': fields.function(_get_tasks, method=True, string='Remaining Tasks', help='This value is given by the sum of work remaining to do on the task for this planning, expressed in days.'), + 'tasks': fields.function(_get_tasks, string='Remaining Tasks', help='This value is given by the sum of work remaining to do on the task for this planning, expressed in days.'), 'plan_tasks': fields.float('Time Planned on Tasks', readonly=True, help='This value is given by the sum of time allocation with task(s) linked, expressed in days.'), - 'free': fields.function(_get_free, method=True, string='Unallocated Time', readonly=True, help='Computed as \ + 'free': fields.function(_get_free, string='Unallocated Time', readonly=True, help='Computed as \ Business Days - (Time Allocation of Tasks + Time Allocation without Tasks + Holiday Leaves)'), 'plan_open': fields.float('Time Allocation without Tasks', readonly=True,help='This value is given by the sum of time allocation without task(s) linked, expressed in days.'), 'holiday': fields.float('Leaves',help='This value is given by the total of validated leaves into the \'Date From\' and \'Date To\' of the planning.'), - 'timesheet': fields.function(_get_timesheets, method=True, string='Timesheet', help='This value is given by the sum of all work encoded in the timesheet(s) between the \'Date From\' and \'Date To\' of the planning.'), + 'timesheet': fields.function(_get_timesheets, string='Timesheet', help='This value is given by the sum of all work encoded in the timesheet(s) between the \'Date From\' and \'Date To\' of the planning.'), } def init(self, cr): @@ -435,10 +435,10 @@ class report_account_analytic_planning_account(osv.osv): _columns = { 'planning_id': fields.many2one('report_account_analytic.planning', 'Planning'), 'account_id': fields.many2one('account.analytic.account', 'Analytic account', readonly=True), - 'tasks': fields.function(_get_tasks, method=True, string='Remaining Tasks', help='This value is given by the sum of work remaining to do on the task for this planning, expressed in days.'), + 'tasks': fields.function(_get_tasks, string='Remaining Tasks', help='This value is given by the sum of work remaining to do on the task for this planning, expressed in days.'), 'plan_tasks': fields.float('Time Allocation of Tasks', readonly=True, help='This value is given by the sum of time allocation with the checkbox \'Assigned in Taks\' set to TRUE expressed in days.'), 'plan_open': fields.float('Time Allocation without Tasks', readonly=True, help='This value is given by the sum of time allocation with the checkbox \'Assigned in Taks\' set to FALSE, expressed in days.'), - 'timesheet': fields.function(_get_timesheets, method=True, string='Timesheet', help='This value is given by the sum of all work encoded in the timesheet(s) between the \'Date From\' and \'Date To\' of the planning.'), + 'timesheet': fields.function(_get_timesheets, string='Timesheet', help='This value is given by the sum of all work encoded in the timesheet(s) between the \'Date From\' and \'Date To\' of the planning.'), } def init(self, cr): @@ -546,8 +546,8 @@ WHERE user_id=%s and account_id=%s and date>=%s and date<=%s''', (line.user_id.i 'manager_id': fields.many2one('res.users', 'Manager'), 'account_id': fields.many2one('account.analytic.account', 'Account'), 'sum_amount': fields.float('Planned Days', required=True), - 'sum_amount_real': fields.function(_sum_amount_real, method=True, string='Timesheet'), - 'sum_amount_tasks': fields.function(_sum_amount_tasks, method=True, string='Tasks'), + 'sum_amount_real': fields.function(_sum_amount_real, string='Timesheet'), + 'sum_amount_tasks': fields.function(_sum_amount_tasks, string='Tasks'), } def init(self, cr): diff --git a/addons/project_scrum/project_scrum.py b/addons/project_scrum/project_scrum.py index 6c274aa3f6a..334a415982d 100644 --- a/addons/project_scrum/project_scrum.py +++ b/addons/project_scrum/project_scrum.py @@ -106,9 +106,9 @@ class project_scrum_sprint(osv.osv): 'review': fields.text('Sprint Review'), 'retrospective': fields.text('Sprint Retrospective'), 'backlog_ids': fields.one2many('project.scrum.product.backlog', 'sprint_id', 'Sprint Backlog'), - 'progress': fields.function(_compute, group_operator="avg", type='float', multi="progress", method=True, string='Progress (0-100)', help="Computed as: Time Spent / Total Time."), - 'effective_hours': fields.function(_compute, multi="effective_hours", method=True, string='Effective hours', help="Computed using the sum of the task work done."), - 'expected_hours': fields.function(_compute, multi="expected_hours", method=True, string='Planned Hours', help='Estimated time to do the task.'), + 'progress': fields.function(_compute, group_operator="avg", type='float', multi="progress", string='Progress (0-100)', help="Computed as: Time Spent / Total Time."), + 'effective_hours': fields.function(_compute, multi="effective_hours", string='Effective hours', help="Computed using the sum of the task work done."), + 'expected_hours': fields.function(_compute, multi="expected_hours", string='Planned Hours', help='Estimated time to do the task.'), 'state': fields.selection([('draft','Draft'),('open','Open'),('pending','Pending'),('cancel','Cancelled'),('done','Done')], 'State', required=True), } _defaults = { @@ -230,11 +230,11 @@ class project_scrum_product_backlog(osv.osv): 'sequence' : fields.integer('Sequence', help="Gives the sequence order when displaying a list of product backlog."), 'tasks_id': fields.one2many('project.task', 'product_backlog_id', 'Tasks Details'), 'state': fields.selection([('draft','Draft'),('open','Open'),('pending','Pending'),('done','Done'),('cancel','Cancelled')], 'State', required=True), - 'progress': fields.function(_compute, multi="progress", group_operator="avg", type='float', method=True, string='Progress', help="Computed as: Time Spent / Total Time."), - 'effective_hours': fields.function(_compute, multi="effective_hours", method=True, string='Spent Hours', help="Computed using the sum of the time spent on every related tasks", store=True), + 'progress': fields.function(_compute, multi="progress", group_operator="avg", type='float', string='Progress', help="Computed as: Time Spent / Total Time."), + 'effective_hours': fields.function(_compute, multi="effective_hours", string='Spent Hours', help="Computed using the sum of the time spent on every related tasks", store=True), 'expected_hours': fields.float('Planned Hours', help='Estimated total time to do the Backlog'), 'create_date': fields.datetime("Creation Date", readonly=True), - 'task_hours': fields.function(_compute, multi="task_hours", method=True, string='Task Hours', help='Estimated time of the total hours of the tasks') + 'task_hours': fields.function(_compute, multi="task_hours", string='Task Hours', help='Estimated time of the total hours of the tasks') } _defaults = { 'state': 'draft', diff --git a/addons/project_timesheet/report/task_report.py b/addons/project_timesheet/report/task_report.py index 623d4e4a5cd..3c223ab6b07 100644 --- a/addons/project_timesheet/report/task_report.py +++ b/addons/project_timesheet/report/task_report.py @@ -62,8 +62,8 @@ class report_timesheet_task_user(osv.osv): 'month':fields.selection([('01','January'), ('02','February'), ('03','March'), ('04','April'), ('05','May'), ('06','June'), ('07','July'), ('08','August'), ('09','September'), ('10','October'), ('11','November'), ('12','December')],'Month',readonly=True), 'user_id': fields.many2one('res.users', 'User',readonly=True), - 'timesheet_hrs': fields.function(get_hrs_timesheet, method=True, string="Timesheet Hours"), - 'task_hrs': fields.function(_get_task_hours, method=True, string="Task Hours"), + 'timesheet_hrs': fields.function(get_hrs_timesheet, string="Timesheet Hours"), + 'task_hrs': fields.function(_get_task_hours, string="Task Hours"), } def init(self, cr): diff --git a/addons/purchase/purchase.py b/addons/purchase/purchase.py index 6f6ab0c1b44..6ec558acc97 100644 --- a/addons/purchase/purchase.py +++ b/addons/purchase/purchase.py @@ -185,29 +185,29 @@ class purchase_order(osv.osv): 'invoice_ids': fields.many2many('account.invoice', 'purchase_invoice_rel', 'purchase_id', 'invoice_id', 'Invoices', help="Invoices generated for a purchase order"), 'picking_ids': fields.one2many('stock.picking', 'purchase_id', 'Picking List', readonly=True, help="This is the list of picking list that have been generated for this purchase"), 'shipped':fields.boolean('Received', readonly=True, select=True, help="It indicates that a picking has been done"), - 'shipped_rate': fields.function(_shipped_rate, method=True, string='Received', type='float'), - 'invoiced': fields.function(_invoiced, method=True, string='Invoiced & Paid', type='boolean', help="It indicates that an invoice has been paid"), - 'invoiced_rate': fields.function(_invoiced_rate, method=True, string='Invoiced', type='float'), + 'shipped_rate': fields.function(_shipped_rate, string='Received', type='float'), + 'invoiced': fields.function(_invoiced, string='Invoiced & Paid', type='boolean', help="It indicates that an invoice has been paid"), + 'invoiced_rate': fields.function(_invoiced_rate, string='Invoiced', type='float'), 'invoice_method': fields.selection([('manual','Manual'),('order','From Order'),('picking','From Picking')], 'Invoicing Control', required=True, help="From Order: a draft invoice will be pre-generated based on the purchase order. The accountant " \ "will just have to validate this invoice for control.\n" \ "From Picking: a draft invoice will be pre-generated based on validated receptions.\n" \ "Manual: allows you to generate suppliers invoices by chosing in the uninvoiced lines of all manual purchase orders." ), - 'minimum_planned_date':fields.function(_minimum_planned_date, fnct_inv=_set_minimum_planned_date, method=True, string='Expected Date', type='date', select=True, help="This is computed as the minimum scheduled date of all purchase order lines' products.", + 'minimum_planned_date':fields.function(_minimum_planned_date, fnct_inv=_set_minimum_planned_date, string='Expected Date', type='date', select=True, help="This is computed as the minimum scheduled date of all purchase order lines' products.", store = { 'purchase.order.line': (_get_order, ['date_planned'], 10), } ), - 'amount_untaxed': fields.function(_amount_all, method=True, digits_compute= dp.get_precision('Purchase Price'), string='Untaxed Amount', + 'amount_untaxed': fields.function(_amount_all, digits_compute= dp.get_precision('Purchase Price'), string='Untaxed Amount', store={ 'purchase.order.line': (_get_order, None, 10), }, multi="sums", help="The amount without tax"), - 'amount_tax': fields.function(_amount_all, method=True, digits_compute= dp.get_precision('Purchase Price'), string='Taxes', + 'amount_tax': fields.function(_amount_all, digits_compute= dp.get_precision('Purchase Price'), string='Taxes', store={ 'purchase.order.line': (_get_order, None, 10), }, multi="sums", help="The tax amount"), - 'amount_total': fields.function(_amount_all, method=True, digits_compute= dp.get_precision('Purchase Price'), string='Total', + 'amount_total': fields.function(_amount_all, digits_compute= dp.get_precision('Purchase Price'), string='Total', store={ 'purchase.order.line': (_get_order, None, 10), }, multi="sums",help="The total amount"), @@ -622,7 +622,7 @@ class purchase_order_line(osv.osv): 'move_ids': fields.one2many('stock.move', 'purchase_line_id', 'Reservation', readonly=True, ondelete='set null'), 'move_dest_id': fields.many2one('stock.move', 'Reservation Destination', ondelete='set null'), 'price_unit': fields.float('Unit Price', required=True, digits_compute= dp.get_precision('Purchase Price')), - 'price_subtotal': fields.function(_amount_line, method=True, string='Subtotal', digits_compute= dp.get_precision('Purchase Price')), + 'price_subtotal': fields.function(_amount_line, string='Subtotal', digits_compute= dp.get_precision('Purchase Price')), 'notes': fields.text('Notes'), 'order_id': fields.many2one('purchase.order', 'Order Reference', select=True, required=True, ondelete='cascade'), 'account_analytic_id':fields.many2one('account.analytic.account', 'Analytic Account',), diff --git a/addons/sale/sale.py b/addons/sale/sale.py index 0b436f0dc91..e9a670cdaaf 100644 --- a/addons/sale/sale.py +++ b/addons/sale/sale.py @@ -236,25 +236,25 @@ class sale_order(osv.osv): 'invoice_ids': fields.many2many('account.invoice', 'sale_order_invoice_rel', 'order_id', 'invoice_id', 'Invoices', readonly=True, help="This is the list of invoices that have been generated for this sales order. The same sales order may have been invoiced in several times (by line for example)."), 'picking_ids': fields.one2many('stock.picking', 'sale_id', 'Related Picking', readonly=True, help="This is a list of picking that has been generated for this sales order."), 'shipped': fields.boolean('Delivered', readonly=True, help="It indicates that the sales order has been delivered. This field is updated only after the scheduler(s) have been launched."), - 'picked_rate': fields.function(_picked_rate, method=True, string='Picked', type='float'), - 'invoiced_rate': fields.function(_invoiced_rate, method=True, string='Invoiced', type='float'), - 'invoiced': fields.function(_invoiced, method=True, string='Paid', + 'picked_rate': fields.function(_picked_rate, string='Picked', type='float'), + 'invoiced_rate': fields.function(_invoiced_rate, string='Invoiced', type='float'), + 'invoiced': fields.function(_invoiced, string='Paid', fnct_search=_invoiced_search, type='boolean', help="It indicates that an invoice has been paid."), 'note': fields.text('Notes'), - 'amount_untaxed': fields.function(_amount_all, method=True, digits_compute= dp.get_precision('Sale Price'), string='Untaxed Amount', + 'amount_untaxed': fields.function(_amount_all, digits_compute= dp.get_precision('Sale Price'), string='Untaxed Amount', store = { '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."), - 'amount_tax': fields.function(_amount_all, method=True, digits_compute= dp.get_precision('Sale Price'), string='Taxes', + 'amount_tax': fields.function(_amount_all, digits_compute= dp.get_precision('Sale Price'), string='Taxes', store = { '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 tax amount."), - 'amount_total': fields.function(_amount_all, method=True, digits_compute= dp.get_precision('Sale Price'), string='Total', + 'amount_total': fields.function(_amount_all, digits_compute= dp.get_precision('Sale Price'), string='Total', store = { '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), @@ -851,7 +851,7 @@ class sale_order_line(osv.osv): 'invoiced': fields.boolean('Invoiced', readonly=True), 'procurement_id': fields.many2one('procurement.order', 'Procurement'), 'price_unit': fields.float('Unit Price', required=True, digits_compute= dp.get_precision('Sale Price'), readonly=True, states={'draft': [('readonly', False)]}), - 'price_subtotal': fields.function(_amount_line, method=True, string='Subtotal', digits_compute= dp.get_precision('Sale Price')), + 'price_subtotal': fields.function(_amount_line, string='Subtotal', digits_compute= dp.get_precision('Sale Price')), 'tax_id': fields.many2many('account.tax', 'sale_order_tax', 'order_line_id', 'tax_id', 'Taxes', readonly=True, states={'draft': [('readonly', False)]}), 'type': fields.selection([('make_to_stock', 'from stock'), ('make_to_order', 'on order')], 'Procurement Method', required=True, readonly=True, states={'draft': [('readonly', False)]}), 'property_ids': fields.many2many('mrp.property', 'sale_order_line_property_rel', 'order_id', 'property_id', 'Properties', readonly=True, states={'draft': [('readonly', False)]}), @@ -863,7 +863,7 @@ class sale_order_line(osv.osv): 'product_packaging': fields.many2one('product.packaging', 'Packaging'), 'move_ids': fields.one2many('stock.move', 'sale_line_id', 'Inventory Moves', readonly=True), 'discount': fields.float('Discount (%)', digits=(16, 2), readonly=True, states={'draft': [('readonly', False)]}), - 'number_packages': fields.function(_number_packages, method=True, type='integer', string='Number Packages'), + 'number_packages': fields.function(_number_packages, type='integer', string='Number Packages'), 'notes': fields.text('Notes'), 'th_weight': fields.float('Weight', readonly=True, states={'draft': [('readonly', False)]}), 'state': fields.selection([('draft', 'Draft'),('confirmed', 'Confirmed'),('done', 'Done'),('cancel', 'Cancelled'),('exception', 'Exception')], 'State', required=True, readonly=True, diff --git a/addons/sale_journal/sale_journal.py b/addons/sale_journal/sale_journal.py index 8d5d219537f..136e7d68198 100644 --- a/addons/sale_journal/sale_journal.py +++ b/addons/sale_journal/sale_journal.py @@ -48,7 +48,6 @@ class res_partner(osv.osv): type = 'many2one', relation = 'sale_journal.invoice.type', string = "Invoicing Method", - method = True, view_load = True, group_name = "Accounting Properties", help = "The type of journal used for sales and picking."), diff --git a/addons/sale_margin/sale_margin.py b/addons/sale_margin/sale_margin.py index 8f1cb8027ae..24f36b9f94b 100644 --- a/addons/sale_margin/sale_margin.py +++ b/addons/sale_margin/sale_margin.py @@ -49,7 +49,7 @@ class sale_order_line(osv.osv): return res _columns = { - 'margin': fields.function(_product_margin, method=True, string='Margin', store=True), + 'margin': fields.function(_product_margin, string='Margin', store=True), 'purchase_price': fields.float('Cost Price', digits=(16,2)) } @@ -67,7 +67,7 @@ class sale_order(osv.osv): return result _columns = { - 'margin': fields.function(_product_margin, method=True, string='Margin', store=True, help="It gives profitability by calculating the difference between the Unit Price and Cost Price."), + 'margin': fields.function(_product_margin, string='Margin', store=True, help="It gives profitability by calculating the difference between the Unit Price and Cost Price."), } sale_order() diff --git a/addons/sale_mrp/sale_mrp.py b/addons/sale_mrp/sale_mrp.py index ae1df1eb946..840c33770a7 100644 --- a/addons/sale_mrp/sale_mrp.py +++ b/addons/sale_mrp/sale_mrp.py @@ -70,8 +70,8 @@ class mrp_production(osv.osv): return res _columns = { - 'sale_name': fields.function(_ref_calc, method=True, multi='sale_name', type='char', string='Sales Name', help='Indicate the name of sales order.'), - 'sale_ref': fields.function(_ref_calc, method=True, multi='sale_name', type='char', string='Sales Reference', help='Indicate the Customer Reference from sales order.'), + 'sale_name': fields.function(_ref_calc, multi='sale_name', type='char', string='Sales Name', help='Indicate the name of sales order.'), + 'sale_ref': fields.function(_ref_calc, multi='sale_name', type='char', string='Sales Reference', help='Indicate the Customer Reference from sales order.'), } mrp_production() diff --git a/addons/sale_order_dates/sale_order_dates.py b/addons/sale_order_dates/sale_order_dates.py index 60595903ab8..ceb6d48755c 100644 --- a/addons/sale_order_dates/sale_order_dates.py +++ b/addons/sale_order_dates/sale_order_dates.py @@ -54,9 +54,9 @@ class sale_order_dates(osv.osv): return res _columns = { - 'commitment_date': fields.function(_get_commitment_date, method=True, store=True, type='date', string='Commitment Date', help="Date on which delivery of products is to be made."), + 'commitment_date': fields.function(_get_commitment_date, store=True, type='date', string='Commitment Date', help="Date on which delivery of products is to be made."), 'requested_date': fields.date('Requested Date', help="Date on which customer has requested for sales."), - 'effective_date': fields.function(_get_effective_date, method=True, type='date', store=True, string='Effective Date',help="Date on which picking is created."), + 'effective_date': fields.function(_get_effective_date, type='date', store=True, string='Effective Date',help="Date on which picking is created."), } sale_order_dates() diff --git a/addons/stock/product.py b/addons/stock/product.py index 2a819ea89b2..49068deba96 100644 --- a/addons/stock/product.py +++ b/addons/stock/product.py @@ -326,10 +326,10 @@ class product_product(osv.osv): return res _columns = { - 'qty_available': fields.function(_product_available, method=True, type='float', string='Real Stock', help="Current quantities of products in selected locations or all internal if none have been selected.", multi='qty_available', digits_compute=dp.get_precision('Product UoM')), - 'virtual_available': fields.function(_product_available, method=True, type='float', string='Virtual Stock', help="Future stock for this product according to the selected locations or all internal if none have been selected. Computed as: Real Stock - Outgoing + Incoming.", multi='qty_available', digits_compute=dp.get_precision('Product UoM')), - 'incoming_qty': fields.function(_product_available, method=True, type='float', string='Incoming', help="Quantities of products that are planned to arrive in selected locations or all internal if none have been selected.", multi='qty_available', digits_compute=dp.get_precision('Product UoM')), - 'outgoing_qty': fields.function(_product_available, method=True, type='float', string='Outgoing', help="Quantities of products that are planned to leave in selected locations or all internal if none have been selected.", multi='qty_available', digits_compute=dp.get_precision('Product UoM')), + 'qty_available': fields.function(_product_available, type='float', string='Real Stock', help="Current quantities of products in selected locations or all internal if none have been selected.", multi='qty_available', digits_compute=dp.get_precision('Product UoM')), + 'virtual_available': fields.function(_product_available, type='float', string='Virtual Stock', help="Future stock for this product according to the selected locations or all internal if none have been selected. Computed as: Real Stock - Outgoing + Incoming.", multi='qty_available', digits_compute=dp.get_precision('Product UoM')), + 'incoming_qty': fields.function(_product_available, type='float', string='Incoming', help="Quantities of products that are planned to arrive in selected locations or all internal if none have been selected.", multi='qty_available', digits_compute=dp.get_precision('Product UoM')), + 'outgoing_qty': fields.function(_product_available, type='float', string='Outgoing', help="Quantities of products that are planned to leave in selected locations or all internal if none have been selected.", multi='qty_available', digits_compute=dp.get_precision('Product UoM')), 'track_production': fields.boolean('Track Manufacturing Lots' , help="Forces to specify a Production Lot for all moves containing this product and generated by a Manufacturing Order"), 'track_incoming': fields.boolean('Track Incoming Lots', help="Forces to specify a Production Lot for all moves containing this product and coming from a Supplier Location"), 'track_outgoing': fields.boolean('Track Outgoing Lots', help="Forces to specify a Production Lot for all moves containing this product and going to a Customer Location"), @@ -423,11 +423,11 @@ class product_template(osv.osv): help="For the current product, this stock location will be used, instead of the default one, as the source location for stock moves generated when you do an inventory"), 'property_stock_account_input': fields.property('account.account', type='many2one', relation='account.account', - string='Stock Input Account', method=True, view_load=True, + string='Stock Input Account', view_load=True, help='When doing real-time inventory valuation, counterpart Journal Items for all incoming stock moves will be posted in this account. If not set on the product, the one from the product category is used.'), 'property_stock_account_output': fields.property('account.account', type='many2one', relation='account.account', - string='Stock Output Account', method=True, view_load=True, + string='Stock Output Account', view_load=True, help='When doing real-time inventory valuation, counterpart Journal Items for all outgoing stock moves will be posted in this account. If not set on the product, the one from the product category is used.'), } @@ -439,15 +439,15 @@ class product_category(osv.osv): _columns = { 'property_stock_journal': fields.property('account.journal', relation='account.journal', type='many2one', - string='Stock journal', method=True, view_load=True, + string='Stock journal', view_load=True, help="When doing real-time inventory valuation, this is the Accounting Journal in which entries will be automatically posted when stock moves are processed."), 'property_stock_account_input_categ': fields.property('account.account', type='many2one', relation='account.account', - string='Stock Input Account', method=True, view_load=True, + string='Stock Input Account', view_load=True, help='When doing real-time inventory valuation, counterpart Journal Items for all incoming stock moves will be posted in this account. This is the default value for all products in this category, it can also directly be set on each product.'), 'property_stock_account_output_categ': fields.property('account.account', type='many2one', relation='account.account', - string='Stock Output Account', method=True, view_load=True, + string='Stock Output Account', view_load=True, help='When doing real-time inventory valuation, counterpart Journal Items for all outgoing stock moves will be posted in this account. This is the default value for all products in this category, it can also directly be set on each product.'), 'property_stock_variation': fields.property('account.account', type='many2one', diff --git a/addons/stock/stock.py b/addons/stock/stock.py index d478ab39c9c..e93a60289aa 100644 --- a/addons/stock/stock.py +++ b/addons/stock/stock.py @@ -167,10 +167,10 @@ class stock_location(osv.osv): \n* Production: Virtual counterpart location for production operations: this location consumes the raw material and produces finished products """, select = True), # temporarily removed, as it's unused: 'allocation_method': fields.selection([('fifo', 'FIFO'), ('lifo', 'LIFO'), ('nearest', 'Nearest')], 'Allocation Method', required=True), - 'complete_name': fields.function(_complete_name, method=True, type='char', size=100, string="Location Name"), + 'complete_name': fields.function(_complete_name, type='char', size=100, string="Location Name"), - 'stock_real': fields.function(_product_value, method=True, type='float', string='Real Stock', multi="stock"), - 'stock_virtual': fields.function(_product_value, method=True, type='float', string='Virtual Stock', multi="stock"), + 'stock_real': fields.function(_product_value, type='float', string='Real Stock', multi="stock"), + 'stock_virtual': fields.function(_product_value, type='float', string='Virtual Stock', multi="stock"), 'location_id': fields.many2one('stock.location', 'Parent Location', select=True, ondelete='cascade'), 'child_ids': fields.one2many('stock.location', 'location_id', 'Contains'), @@ -207,8 +207,8 @@ class stock_location(osv.osv): 'parent_left': fields.integer('Left Parent', select=1), 'parent_right': fields.integer('Right Parent', select=1), - 'stock_real_value': fields.function(_product_value, method=True, type='float', string='Real Stock Value', multi="stock", digits_compute=dp.get_precision('Account')), - 'stock_virtual_value': fields.function(_product_value, method=True, type='float', string='Virtual Stock Value', multi="stock", digits_compute=dp.get_precision('Account')), + 'stock_real_value': fields.function(_product_value, type='float', string='Real Stock Value', multi="stock", digits_compute=dp.get_precision('Account')), + 'stock_virtual_value': fields.function(_product_value, type='float', string='Virtual Stock Value', multi="stock", digits_compute=dp.get_precision('Account')), 'company_id': fields.many2one('res.company', 'Company', select=1, help='Let this field empty if this location is shared between all companies'), 'scrap_location': fields.boolean('Scrap Location', help='Check this box to allow using this location to put scrapped/damaged goods.'), 'valuation_in_account_id': fields.many2one('account.account', 'Stock Input Account',domain = [('type','=','other')], help='This account will be used to value stock moves that have this location as destination, instead of the stock output account from the product.'), @@ -1399,7 +1399,7 @@ class stock_production_lot(osv.osv): 'prefix': fields.char('Prefix', size=64, help="Optional prefix to prepend when displaying this serial number: PREFIX/SERIAL [INT_REF]"), 'product_id': fields.many2one('product.product', 'Product', required=True, domain=[('type', '<>', 'service')]), 'date': fields.datetime('Creation Date', required=True), - 'stock_available': fields.function(_get_stock, fnct_search=_stock_search, method=True, type="float", string="Available", select=True, + 'stock_available': fields.function(_get_stock, fnct_search=_stock_search, type="float", string="Available", select=True, help="Current quantity of products with this Production Lot Number available in company warehouses", digits_compute=dp.get_precision('Product UoM')), 'revisions': fields.one2many('stock.production.lot.revision', 'lot_id', 'Revisions'), diff --git a/addons/stock_planning/stock_planning.py b/addons/stock_planning/stock_planning.py index 160ce6a3c20..7e9342292b9 100644 --- a/addons/stock_planning/stock_planning.py +++ b/addons/stock_planning/stock_planning.py @@ -459,9 +459,9 @@ class stock_planning(osv.osv): 'planned_outgoing': fields.float('Planned Out', required=True, \ help = 'Enter planned outgoing quantity from selected Warehouse during the selected Period of selected Product. '\ 'To plan this value look at Confirmed Out or Sales Forecasts. This value should be equal or greater than Confirmed Out.'), - 'company_forecast': fields.function(_get_forecast, method=True, string ='Company Forecast', multi = 'company', \ + 'company_forecast': fields.function(_get_forecast, string ='Company Forecast', multi = 'company', \ help = 'All sales forecasts for whole company (for all Warehouses) of selected Product during selected Period.'), - 'warehouse_forecast': fields.function(_get_forecast, method=True, string ='Warehouse Forecast', multi = 'warehouse',\ + 'warehouse_forecast': fields.function(_get_forecast, string ='Warehouse Forecast', multi = 'warehouse',\ help = 'All sales forecasts for selected Warehouse of selected Product during selected Period.'), 'stock_simulation': fields.float('Stock Simulation', readonly =True, \ help = 'Stock simulation at the end of selected Period.\n For current period it is: \n' \ @@ -480,10 +480,10 @@ class stock_planning(osv.osv): 'to_procure': fields.float(string='Planned In', required=True, \ help = 'Enter quantity which (by your plan) should come in. Change this value and observe Stock simulation. ' \ 'This value should be equal or greater than Confirmed In.'), - 'line_time': fields.function(_get_past_future, method=True,type='char', string='Past/Future'), - 'minimum_op': fields.function(_get_op, method=True, type='float', string = 'Minimum Rule', multi= 'minimum', \ + 'line_time': fields.function(_get_past_future,type='char', string='Past/Future'), + 'minimum_op': fields.function(_get_op, type='float', string = 'Minimum Rule', multi= 'minimum', \ help = 'Minimum quantity set in Minimum Stock Rules for this Warhouse'), - 'maximum_op': fields.function(_get_op, method=True, type='float', string = 'Maximum Rule', multi= 'maximum', \ + 'maximum_op': fields.function(_get_op, type='float', string = 'Maximum Rule', multi= 'maximum', \ help = 'Maximum quantity set in Minimum Stock Rules for this Warhouse'), 'outgoing_before': fields.float('Planned Out Before', readonly=True, \ help= 'Planned Out in periods before calculated. '\ diff --git a/addons/survey/survey.py b/addons/survey/survey.py index 42111499187..74d15382670 100644 --- a/addons/survey/survey.py +++ b/addons/survey/survey.py @@ -247,7 +247,7 @@ class survey_question(osv.osv): 'req_error_msg': fields.text('Error Message'), 'allow_comment': fields.boolean('Allow Comment Field'), 'sequence': fields.integer('Sequence'), - 'tot_resp': fields.function(_calc_response, method=True, string="Total Answer"), + 'tot_resp': fields.function(_calc_response, string="Total Answer"), 'survey': fields.related('page_id', 'survey_id', type='many2one', relation='survey', string='Survey'), 'descriptive_text': fields.text('Descriptive Text', size=255), 'column_heading_ids': fields.one2many('survey.question.column.heading', 'question_id',' Column heading'), @@ -586,8 +586,8 @@ class survey_answer(osv.osv): 'question_id': fields.many2one('survey.question', 'Question', ondelete='cascade'), 'answer': fields.char('Answer', size=128, required=1), 'sequence': fields.integer('Sequence'), - 'response': fields.function(_calc_response_avg, method=True, string="#Answer", multi='sums'), - 'average': fields.function(_calc_response_avg, method=True, string="#Avg", multi='sums'), + 'response': fields.function(_calc_response_avg, string="#Answer", multi='sums'), + 'average': fields.function(_calc_response_avg, string="#Avg", multi='sums'), 'type': fields.selection([('char','Character'),('date','Date'),('datetime','Date & Time'),\ ('integer','Integer'),('float','Float'),('selection','Selection'),\ ('email','Email')], "Type of Answer",required=1),