diff --git a/account_credit_control/account.py b/account_credit_control/account.py index c8928f624..01aa8c642 100644 --- a/account_credit_control/account.py +++ b/account_credit_control/account.py @@ -31,33 +31,13 @@ class AccountAccount(Model): _inherit = "account.account" - def _check_account_type_compatibility(self, cursor, uid, acc_ids, context=None): - """We check that account is of type reconcile""" - if isinstance(acc_ids, (int, long)): - acc_ids = [acc_ids] - for acc in self.browse(cursor, uid, acc_ids, context): - if acc.credit_policy_id and not acc.reconcile: - return False - return True - _columns = { - 'credit_policy_id': fields.many2one('credit.control.policy', - 'Credit Control Policy', - help=("The Credit Control Policy " - "used for this account. This " - "setting can be forced on the " - "partner or the invoice.")), - 'credit_control_line_ids': fields.one2many('credit.control.line', 'account_id', string='Credit Lines', readonly=True) } - _constraints = [(_check_account_type_compatibility, - _('You can not set a credit control policy on a non reconcilable account'), - ['credit_policy_id'])] - class AccountInvoice(Model): """Add a link to a credit control policy on account.account""" diff --git a/account_credit_control/account_view.xml b/account_credit_control/account_view.xml index 7d8036921..36fecb432 100644 --- a/account_credit_control/account_view.xml +++ b/account_credit_control/account_view.xml @@ -1,18 +1,6 @@ - - account.followup.form.view - account.account - - form - - - - - - - - + - + @@ -38,6 +38,9 @@ + + + @@ -61,7 +64,7 @@ id="base_credit_control_configuration_menu"/> - Credit Policies + Credit Control Policies ir.actions.act_window credit.control.policy @@ -71,7 +74,7 @@ diff --git a/account_credit_control/run_view.xml b/account_credit_control/run_view.xml index cdd49b401..b3a7be8ae 100644 --- a/account_credit_control/run_view.xml +++ b/account_credit_control/run_view.xml @@ -18,7 +18,7 @@ credit.control.run form -
+ @@ -28,15 +28,15 @@ - +