From f36e724804ba112e63c702950b573d355168b13d Mon Sep 17 00:00:00 2001 From: Olivier Dony Date: Tue, 5 Jul 2011 14:28:57 +0200 Subject: [PATCH] [IMP] removed remaining method=True params from fields.function Server revision 3495 odo@openerp.com-20110701232328-flgxulxva70vnyxr removed the need for passing method=True to function fields. bzr revid: odo@openerp.com-20110705122857-zvzpamu0n24zst1q --- addons/account/company.py | 1 - addons/account/partner.py | 4 ---- addons/account/product.py | 4 ---- addons/account_anglo_saxon/product.py | 6 ------ addons/account_payment/account_payment.py | 4 ++-- addons/base_crypt/crypt.py | 2 +- addons/crm/crm_lead.py | 4 ++-- addons/delivery/partner.py | 1 - addons/hr_payroll/hr_payroll.py | 1 - addons/hr_payroll_account/hr_payroll_account.py | 4 ---- addons/hr_recruitment/hr_recruitment.py | 4 ++-- addons/point_of_sale/point_of_sale.py | 1 - addons/product/partner.py | 1 - addons/product/product.py | 2 +- addons/project_issue/project_issue.py | 8 ++++---- addons/purchase/partner.py | 1 - addons/report_webkit/ir_report.py | 1 - addons/stock/partner.py | 2 -- addons/stock/product.py | 5 +---- addons/stock/stock.py | 4 ++-- 20 files changed, 15 insertions(+), 45 deletions(-) diff --git a/addons/account/company.py b/addons/account/company.py index a3886cdf14e..c7836e0128b 100644 --- a/addons/account/company.py +++ b/addons/account/company.py @@ -30,7 +30,6 @@ class res_company(osv.osv): type='many2one', relation='account.account', string="Reserve and Profit/Loss Account", - method=True, view_load=True, domain="[('type', '=', 'other')]", help="This Account is used for transferring Profit/Loss(If It is Profit: Amount will be added, Loss : Amount will be deducted.), Which is calculated from Profit & Loss Report"), diff --git a/addons/account/partner.py b/addons/account/partner.py index 984c7e037e0..6ff3879889c 100644 --- a/addons/account/partner.py +++ b/addons/account/partner.py @@ -150,7 +150,6 @@ class res_partner(osv.osv): type='many2one', relation='account.account', string="Account Payable", - method=True, view_load=True, domain="[('type', '=', 'payable')]", help="This account will be used instead of the default one as the payable account for the current partner", @@ -160,7 +159,6 @@ class res_partner(osv.osv): type='many2one', relation='account.account', string="Account Receivable", - method=True, view_load=True, domain="[('type', '=', 'receivable')]", help="This account will be used instead of the default one as the receivable account for the current partner", @@ -170,7 +168,6 @@ class res_partner(osv.osv): type='many2one', relation='account.fiscal.position', string="Fiscal Position", - method=True, view_load=True, help="The fiscal position will determine taxes and the accounts used for the partner.", ), @@ -179,7 +176,6 @@ class res_partner(osv.osv): type='many2one', relation='account.payment.term', string ='Payment Term', - method=True, view_load=True, help="This payment term will be used instead of the default one for the current partner"), 'ref_companies': fields.one2many('res.company', 'partner_id', diff --git a/addons/account/product.py b/addons/account/product.py index b8af27b03e5..9be49b4c56a 100644 --- a/addons/account/product.py +++ b/addons/account/product.py @@ -29,7 +29,6 @@ class product_category(osv.osv): type='many2one', relation='account.account', string="Income Account", - method=True, view_load=True, help="This account will be used for invoices to value sales for the current product category"), 'property_account_expense_categ': fields.property( @@ -37,7 +36,6 @@ class product_category(osv.osv): type='many2one', relation='account.account', string="Expense Account", - method=True, view_load=True, help="This account will be used for invoices to value expenses for the current product category"), } @@ -61,7 +59,6 @@ class product_template(osv.osv): type='many2one', relation='account.account', string="Income Account", - method=True, view_load=True, help="This account will be used for invoices instead of the default one to value sales for the current product"), 'property_account_expense': fields.property( @@ -69,7 +66,6 @@ class product_template(osv.osv): type='many2one', relation='account.account', string="Expense Account", - method=True, view_load=True, help="This account will be used for invoices instead of the default one to value expenses for the current product"), } diff --git a/addons/account_anglo_saxon/product.py b/addons/account_anglo_saxon/product.py index ebb9bde3d00..a2a5f7e6e95 100644 --- a/addons/account_anglo_saxon/product.py +++ b/addons/account_anglo_saxon/product.py @@ -28,7 +28,6 @@ class product_category(osv.osv): type='many2one', relation='account.account', string="Price Difference Account", - method=True, view_load=True, help="This account will be used to value price difference between purchase price and cost price."), @@ -38,7 +37,6 @@ class product_category(osv.osv): type='many2one', relation='account.account', string="Income Account", - method=True, view_load=True, help="This account will be used to value outgoing stock for the current product category using sale price"), 'property_account_expense_categ': fields.property( @@ -46,7 +44,6 @@ class product_category(osv.osv): type='many2one', relation='account.account', string="Expense Account", - method=True, view_load=True, help="This account will be used to value outgoing stock for the current product category using cost price"), @@ -61,7 +58,6 @@ class product_template(osv.osv): type='many2one', relation='account.account', string="Price Difference Account", - method=True, view_load=True, help="This account will be used to value price difference between purchase price and cost price."), @@ -71,7 +67,6 @@ class product_template(osv.osv): type='many2one', relation='account.account', string="Income Account", - method=True, view_load=True, help="This account will be used to value outgoing stock for the current product category using sale price"), 'property_account_expense': fields.property( @@ -79,7 +74,6 @@ class product_template(osv.osv): type='many2one', relation='account.account', string="Expense Account", - method=True, view_load=True, help="This account will be used to value outgoing stock for the current product category using cost price"), diff --git a/addons/account_payment/account_payment.py b/addons/account_payment/account_payment.py index a7b803b2d3b..9858d536d17 100644 --- a/addons/account_payment/account_payment.py +++ b/addons/account_payment/account_payment.py @@ -344,10 +344,10 @@ class payment_line(osv.osv): ondelete='cascade', select=True), 'partner_id': fields.many2one('res.partner', string="Partner", required=True, help='The Ordering Customer'), 'amount': fields.function(_amount, string='Amount in Company Currency', - method=True, type='float', + type='float', 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"), + type='date', help="Invoice Effective Date"), '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'), diff --git a/addons/base_crypt/crypt.py b/addons/base_crypt/crypt.py index a616b7e5b74..5a55c02269d 100644 --- a/addons/base_crypt/crypt.py +++ b/addons/base_crypt/crypt.py @@ -163,7 +163,7 @@ class users(osv.osv): # an existing column cannot be downsized; thus we use the original # column size. 'password': fields.function(get_pw, fnct_inv=set_pw, type='char', - method=True, size=64, string='Password', invisible=True, + size=64, string='Password', invisible=True, store=True), } diff --git a/addons/crm/crm_lead.py b/addons/crm/crm_lead.py index ceb9af6b215..98bc01a51af 100644 --- a/addons/crm/crm_lead.py +++ b/addons/crm/crm_lead.py @@ -161,9 +161,9 @@ class crm_lead(crm_case, osv.osv): 'referred': fields.char('Referred By', size=64), 'date_open': fields.datetime('Opened', readonly=True), 'day_open': fields.function(_compute_day, string='Days to Open', \ - method=True, multi='day_open', type="float", store=True), + multi='day_open', type="float", store=True), 'day_close': fields.function(_compute_day, string='Days to Close', \ - method=True, multi='day_close', type="float", store=True), + multi='day_close', type="float", store=True), 'state': fields.selection(crm.AVAILABLE_STATES, 'State', size=16, readonly=True, help='The state is set to \'Draft\', when a case is created.\ \nIf the case is in progress the state is set to \'Open\'.\ diff --git a/addons/delivery/partner.py b/addons/delivery/partner.py index 386e9d08139..62008c2c7cf 100644 --- a/addons/delivery/partner.py +++ b/addons/delivery/partner.py @@ -29,7 +29,6 @@ class res_partner(osv.osv): type='many2one', relation='delivery.carrier', string="Delivery Method", - method=True, view_load=True, help="This delivery method will be used when invoicing from picking."), } diff --git a/addons/hr_payroll/hr_payroll.py b/addons/hr_payroll/hr_payroll.py index 43e35424da0..7b94ecc5dbb 100644 --- a/addons/hr_payroll/hr_payroll.py +++ b/addons/hr_payroll/hr_payroll.py @@ -711,7 +711,6 @@ class company_contribution(osv.osv): type='many2one', relation='hr.contibution.register', string="Contribution Register", - method=True, view_load=True, help="Contribution register based on company", required=False diff --git a/addons/hr_payroll_account/hr_payroll_account.py b/addons/hr_payroll_account/hr_payroll_account.py index deb06b121d0..7d069bdf346 100644 --- a/addons/hr_payroll_account/hr_payroll_account.py +++ b/addons/hr_payroll_account/hr_payroll_account.py @@ -60,7 +60,6 @@ class hr_employee(osv.osv): type='many2one', relation='account.account', string="Bank Account", - method=True, domain="[('type', '=', 'liquidity')]", view_load=True, help="Select Bank Account from where Salary Expense will be Paid, to be used for payslip verification."), @@ -69,7 +68,6 @@ class hr_employee(osv.osv): type='many2one', relation='account.account', string="Salary Account", - method=True, domain="[('type', '=', 'other')]", view_load=True, help="Expense account when Salary Expense will be recorded"), @@ -78,7 +76,6 @@ class hr_employee(osv.osv): type='many2one', relation='account.account', string="Employee Account", - method=True, domain="[('type', '=', 'other')]", view_load=True, help="Employee Payable Account"), @@ -87,7 +84,6 @@ class hr_employee(osv.osv): type='many2one', relation='account.analytic.account', string="Analytic Account", - method=True, view_load=True, help="Analytic Account for Salary Analysis"), } diff --git a/addons/hr_recruitment/hr_recruitment.py b/addons/hr_recruitment/hr_recruitment.py index d716764e7a2..5e738fc6f48 100644 --- a/addons/hr_recruitment/hr_recruitment.py +++ b/addons/hr_recruitment/hr_recruitment.py @@ -157,9 +157,9 @@ class hr_applicant(crm.crm_case, osv.osv): 'response': fields.integer("Response"), 'reference': fields.char('Reference', size=128), 'day_open': fields.function(_compute_day, string='Days to Open', \ - method=True, multi='day_open', type="float", store=True), + multi='day_open', type="float", store=True), 'day_close': fields.function(_compute_day, string='Days to Close', \ - method=True, multi='day_close', type="float", store=True), + multi='day_close', type="float", store=True), } def _get_stage(self, cr, uid, context=None): diff --git a/addons/point_of_sale/point_of_sale.py b/addons/point_of_sale/point_of_sale.py index 917e6273ddc..90bfa975a76 100644 --- a/addons/point_of_sale/point_of_sale.py +++ b/addons/point_of_sale/point_of_sale.py @@ -250,7 +250,6 @@ class pos_order(osv.osv): states={'draft': [('readonly', False)]}, readonly=True), 'date_order': fields.datetime('Date Ordered', readonly=True, select=True), 'date_validation': fields.function(_get_date_payment, - method=True, string='Validation Date', type='date', select=True, store=True), 'date_payment': fields.function(_get_date_payment2, diff --git a/addons/product/partner.py b/addons/product/partner.py index 7aa9b3bc426..f779f3dcd4d 100644 --- a/addons/product/partner.py +++ b/addons/product/partner.py @@ -32,7 +32,6 @@ class res_partner(osv.osv): relation='product.pricelist', domain=[('type','=','sale')], string="Sale Pricelist", - method=True, view_load=True, help="This pricelist will be used, instead of the default one, for sales to the current partner"), } diff --git a/addons/product/product.py b/addons/product/product.py index 320b4552c18..9deaf3398b1 100644 --- a/addons/product/product.py +++ b/addons/product/product.py @@ -102,7 +102,7 @@ class product_uom(osv.osv): '1 * (reference unit) = ratio * (this unit)'), 'factor_inv': fields.function(_factor_inv, digits_compute=dp.get_precision('Product UoM'), fnct_inv=_factor_inv_write, - method=True, string='Ratio', + string='Ratio', help='How many times this UoM is bigger than the reference UoM in this category:\n'\ '1 * (this unit) = ratio * (reference unit)', required=True), 'rounding': fields.float('Rounding Precision', digits_compute=dp.get_precision('Product UoM'), required=True, diff --git a/addons/project_issue/project_issue.py b/addons/project_issue/project_issue.py index abb9b7e92ff..b6032241a8e 100644 --- a/addons/project_issue/project_issue.py +++ b/addons/project_issue/project_issue.py @@ -205,14 +205,14 @@ class project_issue(crm.crm_case, osv.osv): 'duration': fields.float('Duration'), 'task_id': fields.many2one('project.task', 'Task', domain="[('project_id','=',project_id)]"), 'day_open': fields.function(_compute_day, string='Days to Open', \ - method=True, multi='compute_day', type="float", store=True), + multi='compute_day', type="float", store=True), 'day_close': fields.function(_compute_day, string='Days to Close', \ - method=True, multi='compute_day', type="float", store=True), + multi='compute_day', type="float", store=True), 'assigned_to': fields.many2one('res.users', 'Assigned to', required=False, select=1), 'working_hours_open': fields.function(_compute_day, string='Working Hours to Open the Issue', \ - method=True, multi='compute_day', type="float", store=True), + multi='compute_day', type="float", store=True), 'working_hours_close': fields.function(_compute_day, string='Working Hours to Close the Issue', \ - method=True, multi='compute_day', type="float", store=True), + multi='compute_day', type="float", store=True), '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), diff --git a/addons/purchase/partner.py b/addons/purchase/partner.py index 48d006f2c15..86cce749a21 100644 --- a/addons/purchase/partner.py +++ b/addons/purchase/partner.py @@ -31,7 +31,6 @@ class res_partner(osv.osv): relation='product.pricelist', domain=[('type','=','purchase')], string="Purchase Pricelist", - method=True, view_load=True, help="This pricelist will be used, instead of the default one, for purchases from the current partner"), } diff --git a/addons/report_webkit/ir_report.py b/addons/report_webkit/ir_report.py index 8f89fb51698..e6f4a81f9e7 100644 --- a/addons/report_webkit/ir_report.py +++ b/addons/report_webkit/ir_report.py @@ -125,7 +125,6 @@ class ReportXML(osv.osv): relation='ir.header_webkit', string='WebKit Header', help="The header linked to the report", - method=True, view_load=True, required=True ), diff --git a/addons/stock/partner.py b/addons/stock/partner.py index 7a7ac058936..6cce00cf75c 100644 --- a/addons/stock/partner.py +++ b/addons/stock/partner.py @@ -29,7 +29,6 @@ class res_partner(osv.osv): type='many2one', relation='stock.location', string="Customer Location", - method=True, view_load=True, help="This stock location will be used, instead of the default one, as the destination location for goods you send to this partner"), @@ -38,7 +37,6 @@ class res_partner(osv.osv): type='many2one', relation='stock.location', string="Supplier Location", - method=True, view_load=True, help="This stock location will be used, instead of the default one, as the source location for goods you receive from the current partner"), } diff --git a/addons/stock/product.py b/addons/stock/product.py index 49068deba96..c5d1eabdd5a 100644 --- a/addons/stock/product.py +++ b/addons/stock/product.py @@ -399,7 +399,6 @@ class product_template(osv.osv): type='many2one', relation='stock.location', string="Procurement Location", - method=True, view_load=True, domain=[('usage','like','procurement')], help="For the current product, this stock location will be used, instead of the default one, as the source location for stock moves generated by procurements"), @@ -408,7 +407,6 @@ class product_template(osv.osv): type='many2one', relation='stock.location', string="Production Location", - method=True, view_load=True, domain=[('usage','like','production')], help="For the current product, this stock location will be used, instead of the default one, as the source location for stock moves generated by production orders"), @@ -417,7 +415,6 @@ class product_template(osv.osv): type='many2one', relation='stock.location', string="Inventory Location", - method=True, view_load=True, domain=[('usage','like','inventory')], 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"), @@ -453,7 +450,7 @@ class product_category(osv.osv): type='many2one', relation='account.account', string="Stock Variation Account", - method=True, view_load=True, + view_load=True, help="When real-time inventory valuation is enabled on a product, this account will hold the current value of the products.",), } diff --git a/addons/stock/stock.py b/addons/stock/stock.py index e93a60289aa..1907397be67 100644 --- a/addons/stock/stock.py +++ b/addons/stock/stock.py @@ -636,11 +636,11 @@ class stock_picking(osv.osv): "* Done: has been processed, can't be modified or cancelled anymore\n"\ "* Cancelled: has been cancelled, can't be confirmed anymore"), 'min_date': fields.function(get_min_max_date, fnct_inv=_set_minimum_date, multi="min_max_date", - method=True, store=True, type='datetime', string='Expected Date', select=1, help="Expected date for the picking to be processed"), + store=True, type='datetime', string='Expected Date', select=1, help="Expected date for the picking to be processed"), 'date': fields.datetime('Order Date', help="Date of Order", select=True), 'date_done': fields.datetime('Date Done', help="Date of Completion"), 'max_date': fields.function(get_min_max_date, fnct_inv=_set_maximum_date, multi="min_max_date", - method=True, store=True, type='datetime', string='Max. Expected Date', select=2), + store=True, type='datetime', string='Max. Expected Date', select=2), 'move_lines': fields.one2many('stock.move', 'picking_id', 'Internal Moves', states={'done': [('readonly', True)], 'cancel': [('readonly', True)]}), 'auto_picking': fields.boolean('Auto-Picking'), 'address_id': fields.many2one('res.partner.address', 'Address', help="Address of partner"),