Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 57ab58c

Browse files
committed
Merge pull request odoo#653 from odoo-dev/master-review-charfield-size-jar
[REM] Unnecessary `size` parameters on char fields (+some code linting)
2 parents 19c0435 + 026e38b commit 57ab58c

File tree

162 files changed

+585
-578
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

162 files changed

+585
-578
lines changed

addons/account/account.py

Lines changed: 28 additions & 29 deletions
Large diffs are not rendered by default.

addons/account/account_analytic_line.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ class account_analytic_line(osv.osv):
3333
'move_id': fields.many2one('account.move.line', 'Move Line', ondelete='cascade', select=True),
3434
'journal_id': fields.many2one('account.analytic.journal', 'Analytic Journal', required=True, ondelete='restrict', select=True),
3535
'code': fields.char('Code', size=8),
36-
'ref': fields.char('Ref.', size=64),
36+
'ref': fields.char('Ref.'),
3737
'currency_id': fields.related('move_id', 'currency_id', type='many2one', relation='res.currency', string='Account Currency', store=True, help="The related account currency if not equal to the company one.", readonly=True),
3838
'amount_currency': fields.related('move_id', 'amount_currency', type='float', string='Amount Currency', store=True, help="The amount expressed in the related account currency if not equal to the company one.", readonly=True),
3939
}

addons/account/account_bank_statement.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ def _all_lines_reconciled(self, cr, uid, ids, name, args, context=None):
114114
_description = "Bank Statement"
115115
_inherit = ['mail.thread']
116116
_columns = {
117-
'name': fields.char('Reference', size=64, 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'), # readonly for account_cash_statement
117+
'name': fields.char('Reference', 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'), # readonly for account_cash_statement
118118
'date': fields.date('Date', required=True, states={'confirm': [('readonly', True)]}, select=True),
119119
'journal_id': fields.many2one('account.journal', 'Journal', required=True,
120120
readonly=True, states={'draft':[('readonly',False)]}),

addons/account/account_financial_report.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ def _get_balance(self, cr, uid, ids, field_names, args, context=None):
9797
return res
9898

9999
_columns = {
100-
'name': fields.char('Report Name', size=128, required=True, translate=True),
100+
'name': fields.char('Report Name', required=True, translate=True),
101101
'parent_id': fields.many2one('account.financial.report', 'Parent'),
102102
'children_ids': fields.one2many('account.financial.report', 'parent_id', 'Account Report'),
103103
'sequence': fields.integer('Sequence'),

addons/account/account_invoice.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -226,8 +226,8 @@ def _get_invoice_from_reconcile(self, cr, uid, ids, context=None):
226226
},
227227
}
228228
_columns = {
229-
'name': fields.char('Reference/Description', size=64, select=True, readonly=True, states={'draft':[('readonly',False)]}),
230-
'origin': fields.char('Source Document', size=64, help="Reference of the document that produced this invoice.", readonly=True, states={'draft':[('readonly',False)]}),
229+
'name': fields.char('Reference/Description', select=True, readonly=True, states={'draft':[('readonly',False)]}),
230+
'origin': fields.char('Source Document', help="Reference of the document that produced this invoice.", readonly=True, states={'draft':[('readonly',False)]}),
231231
'supplier_invoice_number': fields.char('Supplier Invoice Number', size=64, help="The reference of this invoice as provided by the supplier.", readonly=True, states={'draft':[('readonly',False)]}),
232232
'type': fields.selection([
233233
('out_invoice','Customer Invoice'),
@@ -237,8 +237,8 @@ def _get_invoice_from_reconcile(self, cr, uid, ids, context=None):
237237
],'Type', readonly=True, select=True, change_default=True, track_visibility='always'),
238238

239239
'number': fields.related('move_id','name', type='char', readonly=True, size=64, relation='account.move', store=True, string='Number'),
240-
'internal_number': fields.char('Invoice Number', size=32, readonly=True, help="Unique number of the invoice, computed automatically when the invoice is created."),
241-
'reference': fields.char('Invoice Reference', size=64, help="The partner reference of this invoice."),
240+
'internal_number': fields.char('Invoice Number', readonly=True, help="Unique number of the invoice, computed automatically when the invoice is created."),
241+
'reference': fields.char('Invoice Reference', help="The partner reference of this invoice."),
242242
'reference_type': fields.selection(_get_reference_type, 'Payment Reference',
243243
required=True, readonly=True, states={'draft':[('readonly',False)]}),
244244
'comment': fields.text('Additional Information'),
@@ -318,7 +318,7 @@ def _get_invoice_from_reconcile(self, cr, uid, ids, context=None):
318318
},
319319
help="Remaining amount due."),
320320
'payment_ids': fields.function(_compute_lines, relation='account.move.line', type="many2many", string='Payments'),
321-
'move_name': fields.char('Journal Entry', size=64, readonly=True, states={'draft':[('readonly',False)]}),
321+
'move_name': fields.char('Journal Entry', readonly=True, states={'draft':[('readonly',False)]}),
322322
'user_id': fields.many2one('res.users', 'Salesperson', readonly=True, track_visibility='onchange', states={'draft':[('readonly',False)]}),
323323
'fiscal_position': fields.many2one('account.fiscal.position', 'Fiscal Position', readonly=True, states={'draft':[('readonly',False)]}),
324324
'commercial_partner_id': fields.related('partner_id', 'commercial_partner_id', string='Commercial Entity', type='many2one',
@@ -1402,7 +1402,7 @@ def _price_unit_default(self, cr, uid, context=None):
14021402
_order = "invoice_id,sequence,id"
14031403
_columns = {
14041404
'name': fields.text('Description', required=True),
1405-
'origin': fields.char('Source Document', size=256, help="Reference of the document that produced this invoice."),
1405+
'origin': fields.char('Source Document', help="Reference of the document that produced this invoice."),
14061406
'sequence': fields.integer('Sequence', help="Gives the sequence of this line when displaying the invoice."),
14071407
'invoice_id': fields.many2one('account.invoice', 'Invoice Reference', ondelete='cascade', select=True),
14081408
'uos_id': fields.many2one('product.uom', 'Unit of Measure', ondelete='set null', select=True),
@@ -1646,7 +1646,7 @@ def _count_factor(self, cr, uid, ids, name, args, context=None):
16461646

16471647
_columns = {
16481648
'invoice_id': fields.many2one('account.invoice', 'Invoice Line', ondelete='cascade', select=True),
1649-
'name': fields.char('Tax Description', size=64, required=True),
1649+
'name': fields.char('Tax Description', required=True),
16501650
'account_id': fields.many2one('account.account', 'Tax Account', required=True, domain=[('type','<>','view'),('type','<>','income'), ('type', '<>', 'closed')]),
16511651
'account_analytic_id': fields.many2one('account.analytic.account', 'Analytic account'),
16521652
'base': fields.float('Base', digits_compute=dp.get_precision('Account')),

addons/account/account_move_line.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -445,7 +445,7 @@ def _get_move_from_reconcile(self, cr, uid, ids, context=None):
445445

446446

447447
_columns = {
448-
'name': fields.char('Name', size=64, required=True),
448+
'name': fields.char('Name', required=True),
449449
'quantity': fields.float('Quantity', digits=(16,2), help="The optional quantity expressed by this line, eg: number of product sold. The quantity is not a legal requirement but is very useful for some reports."),
450450
'product_uom_id': fields.many2one('product.uom', 'Unit of Measure'),
451451
'product_id': fields.many2one('product.product', 'Product'),
@@ -454,7 +454,7 @@ def _get_move_from_reconcile(self, cr, uid, ids, context=None):
454454
'account_id': fields.many2one('account.account', 'Account', required=True, ondelete="cascade", domain=[('type','<>','view'), ('type', '<>', 'closed')], select=2),
455455
'move_id': fields.many2one('account.move', 'Journal Entry', ondelete="cascade", help="The move of this entry line.", select=2, required=True),
456456
'narration': fields.related('move_id','narration', type='text', relation='account.move', string='Internal Note'),
457-
'ref': fields.related('move_id', 'ref', string='Reference', type='char', size=64, store=True),
457+
'ref': fields.related('move_id', 'ref', string='Reference', type='char', store=True),
458458
'statement_id': fields.many2one('account.bank.statement', 'Statement', help="The bank statement used for bank reconciliation", select=1),
459459
'reconcile_id': fields.many2one('account.move.reconcile', 'Reconcile', readonly=True, ondelete='set null', select=2),
460460
'reconcile_partial_id': fields.many2one('account.move.reconcile', 'Partial Reconcile', readonly=True, ondelete='set null', select=2),

addons/account/partner.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ class account_fiscal_position(osv.osv):
2828
_name = 'account.fiscal.position'
2929
_description = 'Fiscal Position'
3030
_columns = {
31-
'name': fields.char('Fiscal Position', size=64, required=True),
31+
'name': fields.char('Fiscal Position', required=True),
3232
'active': fields.boolean('Active', help="By unchecking the active field, you may hide a fiscal position without deleting it."),
3333
'company_id': fields.many2one('res.company', 'Company'),
3434
'account_ids': fields.one2many('account.fiscal.position.account', 'position_id', 'Account Mapping'),

addons/account/project/project.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,10 @@ class account_analytic_journal(osv.osv):
2525
_name = 'account.analytic.journal'
2626
_description = 'Analytic Journal'
2727
_columns = {
28-
'name': fields.char('Journal Name', size=64, required=True),
28+
'name': fields.char('Journal Name', required=True),
2929
'code': fields.char('Journal Code', size=8),
3030
'active': fields.boolean('Active', help="If the active field is set to False, it will allow you to hide the analytic journal without removing it."),
31-
'type': fields.selection([('sale','Sale'), ('purchase','Purchase'), ('cash','Cash'), ('general','General'), ('situation','Situation')], 'Type', size=32, required=True, help="Gives the type of the analytic journal. When it needs for a document (eg: an invoice) to create analytic entries, OpenERP will look for a matching journal of the same type."),
31+
'type': fields.selection([('sale','Sale'), ('purchase','Purchase'), ('cash','Cash'), ('general','General'), ('situation','Situation')], 'Type', required=True, help="Gives the type of the analytic journal. When it needs for a document (eg: an invoice) to create analytic entries, OpenERP will look for a matching journal of the same type."),
3232
'line_ids': fields.one2many('account.analytic.line', 'journal_id', 'Lines'),
3333
'company_id': fields.many2one('res.company', 'Company', required=True),
3434
}

addons/account/report/account_entries_report.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ class account_entries_report(osv.osv):
3232
'date': fields.date('Effective Date', readonly=True),
3333
'date_created': fields.date('Date Created', readonly=True),
3434
'date_maturity': fields.date('Date Maturity', readonly=True),
35-
'ref': fields.char('Reference', size=64, readonly=True),
35+
'ref': fields.char('Reference', readonly=True),
3636
'nbr': fields.integer('# of Items', readonly=True),
3737
'debit': fields.float('Debit', readonly=True),
3838
'credit': fields.float('Credit', readonly=True),

addons/account/report/account_report.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ class temp_range(osv.osv):
7373
_description = 'A Temporary table used for Dashboard view'
7474

7575
_columns = {
76-
'name': fields.char('Range',size=64)
76+
'name': fields.char('Range')
7777
}
7878

7979

@@ -112,7 +112,7 @@ def _calc_bal(self, cr, uid, ids, name, args, context=None):
112112
return res
113113

114114
_columns = {
115-
'name': fields.char('Month Range', size=7, readonly=True),
115+
'name': fields.char('Month Range', size=24, readonly=True),
116116
'balance': fields.function(_calc_bal, string='Balance', readonly=True),
117117
}
118118

@@ -151,14 +151,14 @@ class report_invoice_created(osv.osv):
151151
_description = "Report of Invoices Created within Last 15 days"
152152
_auto = False
153153
_columns = {
154-
'name': fields.char('Description', size=64, readonly=True),
154+
'name': fields.char('Description', readonly=True),
155155
'type': fields.selection([
156156
('out_invoice','Customer Invoice'),
157157
('in_invoice','Supplier Invoice'),
158158
('out_refund','Customer Refund'),
159159
('in_refund','Supplier Refund'),
160160
],'Type', readonly=True),
161-
'number': fields.char('Invoice Number', size=32, readonly=True),
161+
'number': fields.char('Invoice Number', readonly=True),
162162
'partner_id': fields.many2one('res.partner', 'Partner', readonly=True),
163163
'amount_untaxed': fields.float('Untaxed', readonly=True),
164164
'amount_total': fields.float('Total', readonly=True),
@@ -174,7 +174,7 @@ class report_invoice_created(osv.osv):
174174
('paid','Done'),
175175
('cancel','Cancelled')
176176
],'Status', readonly=True),
177-
'origin': fields.char('Source Document', size=64, readonly=True, help="Reference of the document that generated this invoice report."),
177+
'origin': fields.char('Source Document', readonly=True, help="Reference of the document that generated this invoice report."),
178178
'create_date': fields.datetime('Create Date', readonly=True)
179179
}
180180
_order = 'create_date'
@@ -203,7 +203,7 @@ class report_account_type_sales(osv.osv):
203203
_description = "Report of the Sales by Account Type"
204204
_auto = False
205205
_columns = {
206-
'name': fields.char('Year', size=64, required=False, readonly=True),
206+
'name': fields.char('Year', required=False, readonly=True),
207207
'period_id': fields.many2one('account.period', 'Force Period', readonly=True),
208208
'product_id': fields.many2one('product.product', 'Product', readonly=True),
209209
'quantity': fields.float('Quantity', readonly=True),
@@ -244,7 +244,7 @@ class report_account_sales(osv.osv):
244244
_description = "Report of the Sales by Account"
245245
_auto = False
246246
_columns = {
247-
'name': fields.char('Year', size=64, required=False, readonly=True, select=True),
247+
'name': fields.char('Year', required=False, readonly=True, select=True),
248248
'period_id': fields.many2one('account.period', 'Force Period', readonly=True),
249249
'product_id': fields.many2one('product.product', 'Product', readonly=True),
250250
'quantity': fields.float('Quantity', readonly=True),

0 commit comments

Comments
 (0)