mirror of
https://github.com/OCA/account-financial-tools.git
synced 2025-02-02 12:47:26 +02:00
[REF] reindent code
This commit is contained in:
@@ -20,37 +20,42 @@
|
||||
##############################################################################
|
||||
from openerp.osv import orm, fields
|
||||
|
||||
o2m = fields.one2many
|
||||
m2o = fields.many2one
|
||||
|
||||
class AccountAccount(orm.Model):
|
||||
"""Add a link to a credit control policy on account.account"""
|
||||
|
||||
_inherit = "account.account"
|
||||
|
||||
_columns = {'credit_control_line_ids': fields.one2many('credit.control.line',
|
||||
'account_id',
|
||||
string='Credit Lines',
|
||||
readonly=True)
|
||||
}
|
||||
_columns = {
|
||||
'credit_control_line_ids':
|
||||
fields.one2many('credit.control.line',
|
||||
'account_id',
|
||||
string='Credit Lines',
|
||||
readonly=True),
|
||||
}
|
||||
|
||||
|
||||
class AccountInvoice(orm.Model):
|
||||
"""Add a link to a credit control policy on account.account"""
|
||||
|
||||
_inherit = "account.invoice"
|
||||
_columns = {'credit_policy_id': fields.many2one('credit.control.policy',
|
||||
'Credit Control Policy',
|
||||
help=("The Credit Control Policy "
|
||||
"used for this invoice. "
|
||||
"If nothing is defined, "
|
||||
"it will use the account "
|
||||
"setting or the partner "
|
||||
"setting.")),
|
||||
|
||||
'credit_control_line_ids': fields.one2many('credit.control.line',
|
||||
'invoice_id',
|
||||
string='Credit Lines',
|
||||
readonly=True)
|
||||
}
|
||||
_columns = {
|
||||
'credit_policy_id':
|
||||
fields.many2one('credit.control.policy',
|
||||
'Credit Control Policy',
|
||||
help=("The Credit Control Policy used for this "
|
||||
"invoice. If nothing is defined, it will "
|
||||
"use the account setting or the partner "
|
||||
"setting.")
|
||||
),
|
||||
'credit_control_line_ids':
|
||||
fields.one2many('credit.control.line',
|
||||
'invoice_id',
|
||||
string='Credit Lines',
|
||||
readonly=True),
|
||||
}
|
||||
|
||||
def action_move_create(self, cr, uid, ids, context=None):
|
||||
""" Write the id of the invoice in the generated moves. """
|
||||
|
||||
@@ -28,16 +28,16 @@ class ResPartner(orm.Model):
|
||||
_inherit = "res.partner"
|
||||
|
||||
_columns = {
|
||||
'credit_policy_id': fields.many2one('credit.control.policy',
|
||||
'Credit Control Policy',
|
||||
help=("The Credit Control Policy"
|
||||
"used for this partner. This "
|
||||
"setting can be forced on the "
|
||||
"invoice. If nothing is defined, "
|
||||
"it will use the company "
|
||||
"setting.")),
|
||||
'credit_control_line_ids': fields.one2many('credit.control.line',
|
||||
'invoice_id',
|
||||
string='Credit Control Lines',
|
||||
readonly=True)
|
||||
'credit_policy_id':
|
||||
fields.many2one('credit.control.policy',
|
||||
'Credit Control Policy',
|
||||
help=("The Credit Control Policy used for this "
|
||||
"partner. This setting can be forced on the "
|
||||
"invoice. If nothing is defined, it will use "
|
||||
"the company setting.")),
|
||||
'credit_control_line_ids':
|
||||
fields.one2many('credit.control.line',
|
||||
'invoice_id',
|
||||
string='Credit Control Lines',
|
||||
readonly=True)
|
||||
}
|
||||
|
||||
@@ -34,12 +34,13 @@ class CreditControlRun(orm.Model):
|
||||
_description = """Credit control line generator"""
|
||||
_columns = {
|
||||
'date': fields.date('Controlling Date', required=True),
|
||||
'policy_ids': fields.many2many('credit.control.policy',
|
||||
rel="credit_run_policy_rel",
|
||||
id1='run_id', id2='policy_id',
|
||||
string='Policies',
|
||||
readonly=True,
|
||||
states={'draft': [('readonly', False)]}),
|
||||
'policy_ids':
|
||||
fields.many2many('credit.control.policy',
|
||||
rel="credit_run_policy_rel",
|
||||
id1='run_id', id2='policy_id',
|
||||
string='Policies',
|
||||
readonly=True,
|
||||
states={'draft': [('readonly', False)]}),
|
||||
|
||||
'report': fields.text('Report', readonly=True),
|
||||
|
||||
@@ -49,14 +50,16 @@ class CreditControlRun(orm.Model):
|
||||
required=True,
|
||||
readonly=True),
|
||||
|
||||
'manual_ids': fields.many2many('account.move.line',
|
||||
rel="credit_runreject_rel",
|
||||
string='Lines to handle manually',
|
||||
help=('If a credit control line has been generated on a policy'
|
||||
' and the policy has been changed meantime,'
|
||||
' it has to be handled manually'),
|
||||
readonly=True),
|
||||
}
|
||||
'manual_ids':
|
||||
fields.many2many('account.move.line',
|
||||
rel="credit_runreject_rel",
|
||||
string='Lines to handle manually',
|
||||
help=('If a credit control line has been generated'
|
||||
'on a policy and the policy has been changed '
|
||||
'in the meantime, it has to be handled '
|
||||
'manually'),
|
||||
readonly=True),
|
||||
xs}
|
||||
|
||||
def _get_policies(self, cr, uid, context=None):
|
||||
return self.pool['credit.control.policy'].search(cr, uid, [], context=context)
|
||||
|
||||
Reference in New Issue
Block a user