${line.currency_id.name or comm.company_id.currency_id.name}
-
-%endfor
-
-
-
-<%doc>
-
-
${_('If you have any question, do not hesitate to contact us.')}
-
-
${comm.user_id.name} ${comm.user_id.email and '<%s>'%(comm.user_id.email) or ''}
- ${comm.company_id.name}
- % if comm.company_id.street:
- ${comm.company_id.street or ''}
-
- % endif
-
- % if comm.company_id.street2:
- ${comm.company_id.street2}
- % endif
- % if comm.company_id.city or comm.company_id.zip:
- ${comm.company_id.zip or ''} ${comm.company_id.city or ''}
- % endif
- % if comm.company_id.country_id:
- ${comm.company_id.state_id and ('%s, ' % comm.company_id.state_id.name) or ''} ${comm.company_id.country_id.name or ''}
- % endif
- % if comm.company_id.phone:
- Phone: ${comm.company_id.phone}
- % endif
- % if comm.company_id.website:
- ${comm.company_id.website or ''}
- % endif
-%doc>
-
-
- %endfor
-
-
-
diff --git a/account_credit_control/report/credit_control_summary.py b/account_credit_control/report/credit_control_summary.py
deleted file mode 100644
index 6a19659b7..000000000
--- a/account_credit_control/report/credit_control_summary.py
+++ /dev/null
@@ -1,37 +0,0 @@
-# -*- coding: utf-8 -*-
-##############################################################################
-#
-# Author: Nicolas Bessi, Guewen Baconnier
-# Copyright 2012 Camptocamp SA
-#
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Affero General Public License as
-# published by the Free Software Foundation, either version 3 of the
-# License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Affero General Public License for more details.
-#
-# You should have received a copy of the GNU Affero General Public License
-# along with this program. If not, see .
-#
-##############################################################################
-import time
-
-from openerp.report import report_sxw
-
-class CreditSummaryReport(report_sxw.rml_parse):
- def __init__(self, cr, uid, name, context):
- super(CreditSummaryReport, self).__init__(cr, uid, name, context=context)
- self.localcontext.update({
- 'time': time,
- 'cr':cr,
- 'uid': uid,
- })
-
-report_sxw.report_sxw('report.credit_control_summary',
- 'credit.control.communication',
- 'addons/account_credit_control/report/credit_control_summary.html.mako',
- parser=CreditSummaryReport)
diff --git a/account_credit_control/report/report.xml b/account_credit_control/report/report.xml
deleted file mode 100644
index dee64b896..000000000
--- a/account_credit_control/report/report.xml
+++ /dev/null
@@ -1,16 +0,0 @@
-
-
-
-
-
-
-
-
-
diff --git a/account_credit_control/run.py b/account_credit_control/run.py
deleted file mode 100644
index 91b4f63ba..000000000
--- a/account_credit_control/run.py
+++ /dev/null
@@ -1,169 +0,0 @@
-# -*- coding: utf-8 -*-
-##############################################################################
-#
-# Author: Nicolas Bessi, Guewen Baconnier
-# Copyright 2012 Camptocamp SA
-#
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Affero General Public License as
-# published by the Free Software Foundation, either version 3 of the
-# License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Affero General Public License for more details.
-#
-# You should have received a copy of the GNU Affero General Public License
-# along with this program. If not, see .
-#
-##############################################################################
-import logging
-
-from openerp.osv import orm, fields
-from openerp.tools.translate import _
-
-logger = logging.getLogger('credit.control.run')
-
-
-class CreditControlRun(orm.Model):
- """Credit Control run generate all credit control lines and reject"""
-
- _name = "credit.control.run"
- _rec_name = 'date'
- _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)]}),
-
- 'report': fields.text('Report', readonly=True),
-
- 'state': fields.selection([('draft', 'Draft'),
- ('done', 'Done')],
- string='State',
- 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 '
- 'in the meantime, it has to be handled '
- 'manually'),
- readonly=True),
- }
-
- def copy_data(self, cr, uid, id, default=None, context=None):
- if default is None:
- default = {}
- else:
- default = default.copy()
- default.update({
- 'report': False,
- 'manual_ids': False,
- })
- return super(CreditControlRun, self).copy_data(
- cr, uid, id, default=default, context=context)
-
- def _get_policies(self, cr, uid, context=None):
- return self.pool['credit.control.policy'].search(cr, uid, [], context=context)
-
- _defaults = {'state': 'draft',
- 'policy_ids': _get_policies}
-
- def _check_run_date(self, cr, uid, ids, controlling_date, context=None):
- """Ensure that there is no credit line in the future using controlling_date"""
- run_obj = self.pool['credit.control.run']
- runs = run_obj.search(cr, uid, [('date', '>', controlling_date)],
- order='date DESC', limit=1, context=context)
- if runs:
- run = run_obj.browse(cr, uid, runs[0], context=context)
- raise orm.except_orm(_('Error'),
- _('A run has already been executed more '
- 'recently than %s') % (run.date))
-
- line_obj = self.pool['credit.control.line']
- lines = line_obj.search(cr, uid, [('date', '>', controlling_date)],
- order='date DESC', limit=1, context=context)
- if lines:
- line = line_obj.browse(cr, uid, lines[0], context=context)
- raise orm.except_orm(_('Error'),
- _('A credit control line more '
- 'recent than %s exists at %s') %
- (controlling_date, line.date))
- return True
-
- def _generate_credit_lines(self, cr, uid, run_id, context=None):
- """ Generate credit control lines. """
- cr_line_obj = self.pool.get('credit.control.line')
- assert not (isinstance(run_id, list) and len(run_id) > 1), \
- "run_id: only one id expected"
- if isinstance(run_id, list):
- run_id = run_id[0]
-
- run = self.browse(cr, uid, run_id, context=context)
- manually_managed_lines = set() # line who changed policy
- credit_line_ids = [] # generated lines
- run._check_run_date(run.date, context=context)
-
- policies = run.policy_ids
- if not policies:
- raise orm.except_orm(_('Error'),
- _('Please select a policy'))
-
- report = ''
- generated_ids = []
- for policy in policies:
- if policy.do_nothing:
- continue
- lines = policy._get_move_lines_to_process(run.date, context=context)
- manual_lines = policy._lines_different_policy(lines, context=context)
- lines.difference_update(manual_lines)
- manually_managed_lines.update(manual_lines)
- policy_generated_ids = []
- if lines:
- # policy levels are sorted by level so iteration is in the correct order
- for level in reversed(policy.level_ids):
- level_lines = level.get_level_lines(run.date, lines, context=context)
- policy_generated_ids += cr_line_obj.create_or_update_from_mv_lines(
- cr, uid, [], list(level_lines), level.id, run.date, context=context)
- generated_ids.extend(policy_generated_ids)
- if policy_generated_ids:
- report += _("Policy \"%s\" has generated %d Credit Control Lines.\n") % \
- (policy.name, len(policy_generated_ids))
- credit_line_ids += policy_generated_ids
- else:
- report += _("Policy \"%s\" has not generated any Credit Control Lines.\n" %
- policy.name)
-
- vals = {'state': 'done',
- 'report': report,
- 'manual_ids': [(6, 0, manually_managed_lines)]}
- run.write(vals, context=context)
- return generated_ids
-
- def generate_credit_lines(self, cr, uid, run_id, context=None):
- """Generate credit control lines
-
- Lock the ``credit_control_run`` Postgres table to avoid concurrent
- calls of this method.
- """
- try:
- cr.execute('SELECT id FROM credit_control_run'
- ' LIMIT 1 FOR UPDATE NOWAIT')
- except Exception as exc:
- # in case of exception openerp will do a rollback for us and free the lock
- raise orm.except_orm(_('Error'),
- _('A credit control run is already running'
- ' in background, please try later.'))
-
- self._generate_credit_lines(cr, uid, run_id, context)
- return True
diff --git a/account_credit_control/run_view.xml b/account_credit_control/run_view.xml
deleted file mode 100644
index 59c99b9a5..000000000
--- a/account_credit_control/run_view.xml
+++ /dev/null
@@ -1,66 +0,0 @@
-
-
-
-
- credit.control.run.tree
- credit.control.run
- tree
-
-
-
-
-
-
-
-
-
- credit.control.run.form
- credit.control.run
- form
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Credit Control Run
- ir.actions.act_window
- credit.control.run
-
- form
- tree,form
-
-
-
-
-
-
-
-
diff --git a/account_credit_control/scenarios/features/00_credit_control_param.feature b/account_credit_control/scenarios/features/00_credit_control_param.feature
deleted file mode 100644
index c189a55fb..000000000
--- a/account_credit_control/scenarios/features/00_credit_control_param.feature
+++ /dev/null
@@ -1,55 +0,0 @@
-###############################################################################
-#
-# OERPScenario, OpenERP Functional Tests
-# Copyright 2009 Camptocamp SA
-#
-##############################################################################
-##############################################################################
-# Branch # Module # Processes # System
-@account_credit_control @account_credit_control_setup
-
-Feature: General parameters in order to test the credit control module
-
-
- @account_credit_control_setup_install_modules
- Scenario: MODULES INSTALLATION
-
- Given I do not want all demo data to be loaded on install
- Given I install the required modules with dependencies:
- | name |
- | account_credit_control |
-
- Then my modules should have been installed and models reloaded
-
-
- @deactivate_journal_control
- Scenario: Journal setup to avoid unfixed voucher bug
- Given I execute the SQL commands
- """
- UPDATE account_journal SET allow_date = false;
- """
-
- @email_params_mailtrap
- Scenario: E-MAIL PARAMS WITH EMAIL EATER (http://mailtrap.railsware.com/)
- Given I need a "ir.mail_server" with name: mailstrap_testings
- And having:
- | name | value |
- | smtp_host | mailtrap.railsware.com |
- | sequence | 1 |
- | smtp_port | 2525 |
- | smtp_user | camptocamp1 |
- | smtp_pass | 20468fa2f2879cb9 |
-
- @account_credit_control_policy_2_times
- Scenario: Configure the credit control policy in 2 times
- Given I configure the following accounts on the credit control policy with oid: "account_credit_control.credit_control_2_time":
- | account code |
- | 4111 |
- | 4112 |
-
- @account_credit_control_policy_3_times
- Scenario: Configure the credit control policy in 3 times
- Given I configure the following accounts on the credit control policy with oid: "account_credit_control.credit_control_3_time":
- | account code |
- | 4111 |
- | 4112 |
diff --git a/account_credit_control/scenarios/features/01_credit_control_partners.feature b/account_credit_control/scenarios/features/01_credit_control_partners.feature
deleted file mode 100644
index 9edb192c7..000000000
--- a/account_credit_control/scenarios/features/01_credit_control_partners.feature
+++ /dev/null
@@ -1,105 +0,0 @@
-###############################################################################
-#
-# OERPScenario, OpenERP Functional Tests
-# Copyright 2009 Camptocamp SA
-#
-##############################################################################
-##############################################################################
-# Branch # Module # Processes # System
-@account_credit_control @account_credit_control_add_policy @account_credit_control_setup
-
-Feature: I add policy to partners already created
- @account_credit_control_partner_1
- Scenario: Partner_1
- Given I need a "res.partner" with oid: scen.partner_1
- And having:
- | name | value |
- | name | partner_1 |
- | credit_policy_id | by name: No follow |
-
- @account_credit_control_customer_1
- Scenario: Customer_1
- Given I need a "res.partner" with oid: scen.customer_1
- And having:
- | name | value |
- | name | customer_1 |
- | credit_policy_id | by name: 2 time policy |
-
- @account_credit_control_customer_2
- Scenario: Customer_2
- Given I need a "res.partner" with oid: scen.customer_2
- And having:
- | name | value |
- | name | customer_2 |
- | credit_policy_id | by name: 2 time policy |
-
- @account_credit_control_customer_3
- Scenario: Customer_3
- Given I need a "res.partner" with oid: scen.customer_3
- And having:
- | name | value |
- | name | customer_3 |
- | credit_policy_id | by name: 2 time policy |
-
- @account_credit_control_customer_4
- Scenario: Customer_4
- Given I need a "res.partner" with oid: scen.customer_4
- And having:
- | name | value |
- | name | customer_4 |
- # the credit policy must be 3 time policy (inherited from company)
-
- @account_credit_control_customer_5
- Scenario: Customer_5
- Given I need a "res.partner" with oid: scen.customer_5
- And having:
- | name | value |
- | name | customer_5_usd |
- | credit_policy_id | by name: 3 time policy |
-
- @account_credit_control_customer_6
- Scenario: Customer_6
- Given I need a "res.partner" with oid: scen.customer_6
- And having:
- | name | value |
- | name | customer_6 |
- | credit_policy_id | by name: 3 time policy |
-
- @account_credit_control_customer_partial_pay
- Scenario: A customer who like to do partial payments
- Given I need a "res.partner" with oid: scen.customer_partial_pay
- And having:
- | name | value |
- | name | Scrooge McDuck |
- | zip | 1000 |
- | city | Duckburg |
- | email | openerp@locahost.dummy |
- | phone | |
- | street | Duckstreet |
-
-
- @account_credit_control_customer_multiple_payterm
- Scenario: A customer who use payment terms in 2 times
- Given I need a "res.partner" with oid: scen.customer_multiple_payterm
- And having:
- | name | value |
- | name | Donald Duck |
- | zip | 1100 |
- | city | Duckburg |
- | email | openerp@locahost.dummy |
- | phone | |
- | street | Duckstreet |
-
- @account_credit_control_customer_multiple_payterm2
- Scenario: A customer who use payment terms in 2 times
- Given I need a "res.partner" with oid: scen.customer_multiple_payterm2
- And having:
- | name | value |
- | name | Gus Goose |
- | type | default |
- | name | Gus Goose |
- | zip | 1100 |
- | city | Duckburg |
- | email | openerp@locahost.dummy |
- | phone | |
- | street | Duckstreet |
diff --git a/account_credit_control/scenarios/features/02_credit_control_invoices.feature b/account_credit_control/scenarios/features/02_credit_control_invoices.feature
deleted file mode 100644
index 4e80f7695..000000000
--- a/account_credit_control/scenarios/features/02_credit_control_invoices.feature
+++ /dev/null
@@ -1,588 +0,0 @@
-###############################################################################
-#
-# OERPScenario, OpenERP Functional Tests
-# Copyright 2012 Camptocamp SA
-# Author Nicolas Bessi
-##############################################################################
-
-
-@account_credit_control @account_credit_control_setup @account_credit_control_base_data @account_credit_control_invoices
-
-Feature: Invoices creation
-
-##################### Partner 1 ##########################################################
-
- @inv_1
- Scenario: Create invoice 1
-
- Given I need a "account.invoice" with oid: scen._inv_1
- And having:
- | name | value |
- | name | SI_1 |
- | date_invoice | 2013-01-15 |
- | partner_id | by oid: scen.partner_1 |
- | account_id | by name: Debtors |
- | journal_id | by name: Sales |
- | currency_id | by name: EUR |
- | payment_term | by name: 30 Days End of Month |
- | type | out_invoice |
-
-
- Given I need a "account.invoice.line" with oid: scen._inv1_line1
- And having:
- | name | value |
- | name | invoice line 1 |
- | quantity | 1 |
- | price_unit | 1000 |
- | account_id | by name: Sales |
- | invoice_id | by oid: scen._inv_1 |
- Given I find a "account.invoice" with oid: scen._inv_1
-
- Given I need a "account.invoice.line" with oid: scen._inv1_line2
- And having:
- | name | value |
- | name | invoice line 2 |
- | quantity | 1 |
- | price_unit | 1000 |
- | account_id | by name: Sales |
- | invoice_id | by oid: scen._inv_1 |
- Given I find a "account.invoice" with oid: scen._inv_1
- And I open the credit invoice
-
- @inv_2
- Scenario: Create invoice 2
- Given I need a "account.invoice" with oid: scen._inv_2
- And having:
- | name | value |
- | name | SI_2 |
- | date_invoice | 2013-02-15 |
- | partner_id | by oid: scen.partner_1 |
- | account_id | by name: Debtors |
- | journal_id | by name: Sales |
- | currency_id | by name: USD |
- | payment_term | by name: 30 Days End of Month |
- | type | out_invoice |
-
-
- Given I need a "account.invoice.line" with oid: scen._inv2_line1
- And having:
- | name | value |
- | name | invoice line 1 |
- | quantity | 1 |
- | price_unit | 1200 |
- | account_id | by name: Sales |
- | invoice_id | by oid: scen._inv_2 |
- Given I find a "account.invoice" with oid: scen._inv_2
- And I open the credit invoice
-
-
- @inv_3
- Scenario: Create invoice 3
- Given I need a "account.invoice" with oid: scen._inv_3
- And having:
- | name | value |
- | name | SI_3 |
- | date_invoice | 2013-03-15 |
- | partner_id | by oid: scen.partner_1 |
- | account_id | by name: Debtors |
- | journal_id | by name: Sales |
- | currency_id | by name: USD |
- | payment_term | by name: 30 Days End of Month |
- | type | out_invoice |
-
-
- Given I need a "account.invoice.line" with oid: scen._inv3_line1
- And having:
- | name | value |
- | name | invoice line 1 |
- | quantity | 1 |
- | price_unit | 1500 |
- | account_id | by name: Sales |
- | invoice_id | by oid: scen._inv_3 |
- Given I find a "account.invoice" with oid: scen._inv_3
- And I open the credit invoice
-
-##################### Customer 2 ##########################################################
-
- @inv_4
- Scenario: Create invoice 4
-
- Given I need a "account.invoice" with oid: scen._inv_4
- And having:
- | name | value |
- | name | SI_4 |
- | date_invoice | 2013-01-18 |
- | partner_id | by oid: scen.customer_2 |
- | account_id | by name: Debtors |
- | journal_id | by name: Sales |
- | currency_id | by name: EUR |
- | payment_term | by name: 30 Days End of Month |
- | type | out_invoice |
-
-
- Given I need a "account.invoice.line" with oid: scen._inv4_line1
- And having:
- | name | value |
- | name | invoice line 1 |
- | quantity | 1 |
- | price_unit | 1000 |
- | account_id | by name: Sales |
- | invoice_id | by oid: scen._inv_4 |
- Given I find a "account.invoice" with oid: scen._inv_4
- And I open the credit invoice
-
-
-
- @inv_5
- Scenario: Create invoice 5
- Given I need a "account.invoice" with oid: scen._inv_5
- And having:
- | name | value |
- | name | SI_5 |
- | date_invoice | 2013-02-15 |
- | partner_id | by oid: scen.customer_2 |
- | account_id | by name: Debtors |
- | journal_id | by name: Sales |
- | currency_id | by name: USD |
- | payment_term | by name: 30 Days End of Month |
- | type | out_invoice |
-
-
- Given I need a "account.invoice.line" with oid: scen._inv5_line1
- And having:
- | name | value |
- | name | invoice line 1 |
- | quantity | 1 |
- | price_unit | 1200 |
- | account_id | by name: Sales |
- | invoice_id | by oid: scen._inv_5 |
- Given I find a "account.invoice" with oid: scen._inv_5
- And I open the credit invoice
-
-
- @inv_6
- Scenario: Create invoice 6
- Given I need a "account.invoice" with oid: scen._inv_6
- And having:
- | name | value |
- | name | SI_6 |
- | date_invoice | 2013-03-15 |
- | partner_id | by oid: scen.customer_2 |
- | account_id | by name: Debtors |
- | journal_id | by name: Sales |
- | currency_id | by name: USD |
- | payment_term | by name: 30 Days End of Month |
- | type | out_invoice |
-
-
- Given I need a "account.invoice.line" with oid: scen._inv6_line1
- And having:
- | name | value |
- | name | invoice line 1 |
- | quantity | 1 |
- | price_unit | 1500 |
- | account_id | by name: Sales |
- | invoice_id | by oid: scen._inv_6 |
- Given I find a "account.invoice" with oid: scen._inv_6
- And I open the credit invoice
-
-##################### Customer 3 ##########################################################
-
- @inv_7
- Scenario: Create invoice 7
-
- Given I need a "account.invoice" with oid: scen._inv_7
- And having:
- | name | value |
- | name | SI_7 |
- | date_invoice | 2013-01-18 |
- | partner_id | by oid: scen.customer_3 |
- | account_id | by name: Debtors |
- | journal_id | by name: Sales |
- | currency_id | by name: EUR |
- | payment_term | by name: 30 Net Days |
- | type | out_invoice |
-
-
- Given I need a "account.invoice.line" with oid: scen._inv7_line1
- And having:
- | name | value |
- | name | invoice line 1 |
- | quantity | 1 |
- | price_unit | 1000 |
- | account_id | by name: Sales |
- | invoice_id | by oid: scen._inv_7 |
- Given I find a "account.invoice" with oid: scen._inv_7
- And I open the credit invoice
-
-
-
- @inv_8
- Scenario: Create invoice 8
- Given I need a "account.invoice" with oid: scen._inv_8
- And having:
- | name | value |
- | name | SI_8 |
- | date_invoice | 2013-02-15 |
- | partner_id | by oid: scen.customer_3 |
- | account_id | by name: Debtors |
- | journal_id | by name: Sales |
- | currency_id | by name: USD |
- | payment_term | by name: 30 Net Days |
- | type | out_invoice |
-
-
- Given I need a "account.invoice.line" with oid: scen._inv8_line1
- And having:
- | name | value |
- | name | invoice line 1 |
- | quantity | 1 |
- | price_unit | 1200 |
- | account_id | by name: Sales |
- | invoice_id | by oid: scen._inv_8 |
- Given I find a "account.invoice" with oid: scen._inv_8
- And I open the credit invoice
-
-
- @inv_9
- Scenario: Create invoice 9
- Given I need a "account.invoice" with oid: scen._inv_9
- And having:
- | name | value |
- | name | SI_9 |
- | date_invoice | 2013-03-15 |
- | partner_id | by oid: scen.customer_3 |
- | account_id | by name: Debtors |
- | journal_id | by name: Sales |
- | currency_id | by name: USD |
- | payment_term | by name: 30 Net Days |
- | type | out_invoice |
-
-
- Given I need a "account.invoice.line" with oid: scen._inv9_line1
- And having:
- | name | value |
- | name | invoice line 1 |
- | quantity | 1 |
- | price_unit | 1500 |
- | account_id | by name: Sales |
- | invoice_id | by oid: scen._inv_9 |
- Given I find a "account.invoice" with oid: scen._inv_9
- And I open the credit invoice
-
-##################### Customer 4 ##########################################################
-
- @inv_10
- Scenario: Create invoice 10
-
- Given I need a "account.invoice" with oid: scen._inv_10
- And having:
- | name | value |
- | name | SI_10 |
- | date_invoice | 2013-01-18 |
- | partner_id | by oid: scen.customer_4 |
- | account_id | by name: Debtors |
- | journal_id | by name: Sales |
- | currency_id | by name: EUR |
- | payment_term | by name: 30% Advance End 30 Days |
- | type | out_invoice |
-
-
- Given I need a "account.invoice.line" with oid: scen._inv10_line1
- And having:
- | name | value |
- | name | invoice line 1 |
- | quantity | 1 |
- | price_unit | 1000 |
- | account_id | by name: Sales |
- | invoice_id | by oid: scen._inv_10 |
- Given I find a "account.invoice" with oid: scen._inv_10
- And I open the credit invoice
-
-
-
- @inv_11
- Scenario: Create invoice 11
- Given I need a "account.invoice" with oid: scen._inv_11
- And having:
- | name | value |
- | name | SI_11 |
- | date_invoice | 2013-02-15 |
- | partner_id | by oid: scen.customer_4 |
- | account_id | by name: Debtors |
- | journal_id | by name: Sales |
- | currency_id | by name: USD |
- | payment_term | by name: 30% Advance End 30 Days |
- | type | out_invoice |
-
-
- Given I need a "account.invoice.line" with oid: scen._inv11_line1
- And having:
- | name | value |
- | name | invoice line 1 |
- | quantity | 1 |
- | price_unit | 1200 |
- | account_id | by name: Sales |
- | invoice_id | by oid: scen._inv_11 |
- Given I find a "account.invoice" with oid: scen._inv_11
- And I open the credit invoice
-
-
- @inv_12
- Scenario: Create invoice 12
- Given I need a "account.invoice" with oid: scen._inv_12
- And having:
- | name | value |
- | name | SI_12 |
- | date_invoice | 2013-03-15 |
- | partner_id | by oid: scen.customer_4 |
- | account_id | by name: Debtors |
- | journal_id | by name: Sales |
- | currency_id | by name: USD |
- | payment_term | by name: 30% Advance End 30 Days |
- | type | out_invoice |
-
-
- Given I need a "account.invoice.line" with oid: scen._inv12_line1
- And having:
- | name | value |
- | name | invoice line 1 |
- | quantity | 1 |
- | price_unit | 1500 |
- | account_id | by name: Sales |
- | invoice_id | by oid: scen._inv_12 |
- Given I find a "account.invoice" with oid: scen._inv_12
- And I open the credit invoice
-
-##################### Customer 5 ##########################################################
-
- @inv_13
- Scenario: Create invoice 13
-
- Given I need a "account.invoice" with oid: scen._inv_13
- And having:
- | name | value |
- | name | SI_13 |
- | date_invoice | 2013-01-18 |
- | partner_id | by oid: scen.customer_5 |
- | account_id | by name: Debtors USD |
- | journal_id | by name: Sales |
- | currency_id | by name: USD |
- | payment_term | by name: 30 Net Days |
- | type | out_invoice |
-
-
- Given I need a "account.invoice.line" with oid: scen._inv13_line1
- And having:
- | name | value |
- | name | invoice line 1 |
- | quantity | 1 |
- | price_unit | 1000 |
- | account_id | by name: Sales |
- | invoice_id | by oid: scen._inv_13 |
- Given I find a "account.invoice" with oid: scen._inv_13
- And I open the credit invoice
-
-
-
- @inv_14
- Scenario: Create invoice 14
- Given I need a "account.invoice" with oid: scen._inv_14
- And having:
- | name | value |
- | name | SI_14 |
- | date_invoice | 2013-02-15 |
- | partner_id | by oid: scen.customer_5 |
- | account_id | by name: Debtors USD |
- | journal_id | by name: Sales |
- | currency_id | by name: USD |
- | payment_term | by name: 30 Net Days |
- | type | out_invoice |
-
-
- Given I need a "account.invoice.line" with oid: scen._inv14_line1
- And having:
- | name | value |
- | name | invoice line 1 |
- | quantity | 1 |
- | price_unit | 1200 |
- | account_id | by name: Sales |
- | invoice_id | by oid: scen._inv_14 |
- Given I find a "account.invoice" with oid: scen._inv_14
- And I open the credit invoice
-
-
- @inv_15
- Scenario: Create invoice 15
- Given I need a "account.invoice" with oid: scen._inv_15
- And having:
- | name | value |
- | name | SI_15 |
- | date_invoice | 2013-03-15 |
- | partner_id | by oid: scen.customer_5 |
- | account_id | by name: Debtors USD |
- | journal_id | by name: Sales |
- | currency_id | by name: USD |
- | payment_term | by name: 30 Net Days |
- | type | out_invoice |
-
-
- Given I need a "account.invoice.line" with oid: scen._inv15_line1
- And having:
- | name | value |
- | name | invoice line 1 |
- | quantity | 1 |
- | price_unit | 1500 |
- | account_id | by name: Sales |
- | invoice_id | by oid: scen._inv_15 |
- Given I find a "account.invoice" with oid: scen._inv_15
- And I open the credit invoice
-
- @inv_16
- Scenario: Create invoice 16
- Given I need a "account.invoice" with oid: scen._inv_16
- And having:
- | name | value |
- | name | SI_16 |
- | date_invoice | 2013-03-15 |
- | partner_id | by oid: scen.customer_4 |
- | account_id | by name: Debtors |
- | journal_id | by name: Sales |
- | currency_id | by name: EUR |
- | payment_term | by name: 30 Net Days |
- | type | out_invoice |
-
- And I need a "account.invoice.line" with oid: scen._inv16_line1
- And having:
- | name | value |
- | name | invoice line 1 |
- | quantity | 1 |
- | price_unit | 1500 |
- | account_id | by name: Sales |
- | invoice_id | by oid: scen._inv_16 |
- Then I find a "account.invoice" with oid: scen._inv_16
- And I open the credit invoice
-
- @inv_17
- Scenario: Create invoice 17
- Given I need a "account.invoice" with oid: scen._inv_17
- And having:
- | name | value |
- | name | SI_17 |
- | date_invoice | 2013-03-15 |
- | partner_id | by oid: scen.customer_partial_pay |
- | account_id | by name: Debtors |
- | journal_id | by name: Sales |
- | currency_id | by name: EUR |
- | payment_term | by name: 30 Net Days |
- | type | out_invoice |
-
- And I need a "account.invoice.line" with oid: scen._inv17_line1
- And having:
- | name | value |
- | name | invoice line 1 |
- | quantity | 1 |
- | price_unit | 1500 |
- | account_id | by name: Sales |
- | invoice_id | by oid: scen._inv_17 |
- Then I find a "account.invoice" with oid: scen._inv_17
- And I open the credit invoice
-
- @inv_18
- Scenario: Create invoice 18
- Given I need a "account.invoice" with oid: scen._inv_18
- And having:
- | name | value |
- | name | SI_18 |
- | date_invoice | 2013-03-15 |
- | partner_id | by oid: scen.customer_multiple_payterm |
- | account_id | by name: Debtors |
- | journal_id | by name: Sales |
- | currency_id | by name: EUR |
- | payment_term | by name: 30% Advance End 30 Days |
- | type | out_invoice |
-
- And I need a "account.invoice.line" with oid: scen._inv18_line1
- And having:
- | name | value |
- | name | invoice line 1 |
- | quantity | 1 |
- | price_unit | 1500 |
- | account_id | by name: Sales |
- | invoice_id | by oid: scen._inv_18 |
- Then I find a "account.invoice" with oid: scen._inv_18
- And I open the credit invoice
-
- @inv_19
- Scenario: Create invoice 19
- Given I need a "account.invoice" with oid: scen._inv_19
- And having:
- | name | value |
- | name | SI_19 |
- | date_invoice | 2013-03-15 |
- | partner_id | by oid: scen.customer_multiple_payterm2 |
- | account_id | by name: Debtors |
- | journal_id | by name: Sales |
- | currency_id | by name: EUR |
- | payment_term | by name: 30% Advance End 30 Days |
- | type | out_invoice |
- And I need a "account.invoice.line" with oid: scen._inv19_line1
- And having:
- | name | value |
- | name | invoice line 1 |
- | quantity | 1 |
- | price_unit | 1500 |
- | account_id | by name: Sales |
- | invoice_id | by oid: scen._inv_19 |
- Then I find a "account.invoice" with oid: scen._inv_19
- And I open the credit invoice
-
- @inv_20
- Scenario: Create invoice 20
- Given I need a "account.invoice" with oid: scen._inv_20
- And having:
- | name | value |
- | name | SI_20_test_tolerance |
- | date_invoice | 2013-03-23 |
- | partner_id | by oid: scen.customer_6 |
- | account_id | by name: Debtors |
- | journal_id | by name: Sales |
- | currency_id | by name: EUR |
- | payment_term | by name: 30 Net Days |
- | type | out_invoice |
-
- And I need a "account.invoice.line" with oid: scen._inv20_line1
- And having:
- | name | value |
- | name | invoice line 1 |
- | quantity | 1 |
- | price_unit | 0.09 |
- | account_id | by name: Sales |
- | invoice_id | by oid: scen._inv_20 |
- Then I find a "account.invoice" with oid: scen._inv_20
- And I open the credit invoice
-
- @inv_20
- Scenario: Create invoice 21 (this receivable account must not be chased-> no credit line creation)
- Given I need a "account.invoice" with oid: scen._inv_21
- And having:
- | name | value |
- | name | SI_21_test_receivable_account_excluded |
- | date_invoice | 2013-03-25 |
- | partner_id | by oid: scen.customer_6 |
- | account_id | by name: Debtors GBP |
- | journal_id | by name: Sales |
- | currency_id | by name: EUR |
- | payment_term | by name: 30 Net Days |
- | type | out_invoice |
-
- And I need a "account.invoice.line" with oid: scen._inv21_line1
- And having:
- | name | value |
- | name | invoice line 1 |
- | quantity | 1 |
- | price_unit | 6666 |
- | account_id | by name: Sales |
- | invoice_id | by oid: scen._inv_21 |
- Then I find a "account.invoice" with oid: scen._inv_21
- And I open the credit invoice
diff --git a/account_credit_control/scenarios/features/03_credit_control_run_jan.feature b/account_credit_control/scenarios/features/03_credit_control_run_jan.feature
deleted file mode 100644
index 5a9e66fec..000000000
--- a/account_credit_control/scenarios/features/03_credit_control_run_jan.feature
+++ /dev/null
@@ -1,29 +0,0 @@
-###############################################################################
-#
-# OERPScenario, OpenERP Functional Tests
-# Copyright 2012 Camptocamp SA
-# Author Nicolas Bessi
-##############################################################################
-
-# Features Generic tags (none for all)
-##############################################################################
-
-@account_credit_control @account_credit_control_run @account_credit_control_run_jan
-
-Feature: Ensure that mail credit line generation first pass is correct
-
- Scenario: clean data
- Given I clean all the credit lines
- #Given I unreconcile and clean all move line
-
- @account_credit_control_run_month
- Scenario: Create run
- Given I need a "credit.control.run" with oid: credit_control.run1
- And having:
- | name | value |
- | date | 2013-01-31 |
- When I launch the credit run
- Then my credit run should be in state "done"
- And the generated credit lines should have the following values:
- | balance | date due | account | policy | date | partner | channel | level | move line | policy level | state | amount due | currency |
- | 300 | 2013-01-18 | Debtors | 3 time policy | 2013-01-31 | customer_4 | email | 1 | SI_10 | 10 days net | draft | 300 | |
diff --git a/account_credit_control/scenarios/features/04_credit_control_run_feb.feature b/account_credit_control/scenarios/features/04_credit_control_run_feb.feature
deleted file mode 100644
index 154cf2600..000000000
--- a/account_credit_control/scenarios/features/04_credit_control_run_feb.feature
+++ /dev/null
@@ -1,33 +0,0 @@
-###############################################################################
-#
-# OERPScenario, OpenERP Functional Tests
-# Copyright 2012 Camptocamp SA
-# Author Nicolas Bessi
-##############################################################################
-
-# Features Generic tags (none for all)
-##############################################################################
-
-@account_credit_control @account_credit_control_run @account_credit_control_run_feb
-
-Feature: Ensure that mail credit line generation first pass is correct
-
- @account_credit_control_mark
- Scenario: mark lines
- Given there is "draft" credit lines
- And I mark all draft email to state "to_be_sent"
- Then the draft line should be in state "to_be_sent"
-
- @account_credit_control_run_month
- Scenario: Create run
- Given I need a "credit.control.run" with oid: credit_control.run2
- And having:
- | name | value |
- | date | 2013-02-28 |
- When I launch the credit run
- Then my credit run should be in state "done"
- And the generated credit lines should have the following values:
- | balance | date due | account | policy | date | partner | channel | level | move line | policy level | state | amount due | currency |
- | 360 | 2013-02-15 | Debtors | 3 time policy | 2013-02-28 | customer_4 | email | 1 | SI_11 | 10 days net | draft | 360 | USD |
- | 1000 | 2013-02-17 | Debtors USD | 3 time policy | 2013-02-28 | customer_5_usd | email | 1 | SI_13 | 10 days net | draft | 1000 | USD |
- | 300 | 2013-01-18 | Debtors | 3 time policy | 2013-02-28 | customer_4 | email | 2 | SI_10 | 30 days end of month | draft | 300 | |
diff --git a/account_credit_control/scenarios/features/05_credit_control_run_mar.feature b/account_credit_control/scenarios/features/05_credit_control_run_mar.feature
deleted file mode 100644
index 0885fa71e..000000000
--- a/account_credit_control/scenarios/features/05_credit_control_run_mar.feature
+++ /dev/null
@@ -1,63 +0,0 @@
-###############################################################################
-#
-# OERPScenario, OpenERP Functional Tests
-# Copyright 2012 Camptocamp SA
-# Author Nicolas Bessi
-##############################################################################
-
-# Features Generic tags (none for all)
-##############################################################################
-
-@account_credit_control @account_credit_control_run @account_credit_control_run_mar
-
-Feature: Ensure that email credit line generation first pass is correct
-
- @account_credit_control_mark
- Scenario: mark lines
- Given there is "draft" credit lines
- And I mark all draft email to state "to_be_sent"
- Then the draft line should be in state "to_be_sent"
-
- @pay_invoice_si_19_part1
- Scenario: I pay a part of the first part of the invoice SI 19,
- Given I need a "account.bank.statement" with oid: scen.state_control_eur_1
- And having:
- | name | value |
- | name | Bk.St.si_19_part1 |
- | date | 2013-03-31 |
- | journal_id | by oid: scen.eur_journal |
- | period_id | by name: 03/2013 |
-
- And I import invoice "SI_19" using import invoice button
- And I should have a "account.bank.statement.line" with name: "SI_19" and amount: "450"
- And I set the voucher paid amount to "300"
- And I save the voucher
- And I should have a "account.bank.statement.line" with name: "SI_19" and amount: "1050"
- And I set the voucher paid amount to "0"
- And I save the voucher
- Then I modify the line amount to "0"
- Given I need a "account.bank.statement" with oid: scen.state_control_eur_1
- And I set bank statement end-balance
- When I confirm bank statement
- Then My invoice "SI_19" is in state "open" reconciled with a residual amount of "1200.0"
-
- @account_credit_control_run_month_mar
- Scenario: Create run
- Given I need a "credit.control.run" with oid: credit_control.run3
- And having:
- | name | value |
- | date | 2013-03-31 |
- When I launch the credit run
- Then my credit run should be in state "done"
- And the generated credit lines should have the following values:
- | balance | date due | account | policy | date | partner | channel | level | move line | policy level | state | amount due | currency |
- | 1000 | 2013-02-28 | Debtors | 2 time policy | 2013-03-31 | customer_2 | email | 1 | SI_4 | 30 days end of month | draft | 1000 | |
- | 1000 | 2013-02-17 | Debtors | 2 time policy | 2013-03-31 | customer_3 | email | 1 | SI_7 | 30 days end of month | draft | 1000 | |
- | 700 | 2013-02-28 | Debtors | 3 time policy | 2013-03-31 | customer_4 | email | 1 | SI_10 | 10 days net | draft | 700 | |
- | 449.99 | 2013-03-15 | Debtors | 3 time policy | 2013-03-31 | customer_4 | email | 1 | SI_12 | 10 days net | draft | 449.99 | USD |
- | 1200 | 2013-03-17 | Debtors USD | 3 time policy | 2013-03-31 | customer_5_usd | email | 1 | SI_14 | 10 days net | draft | 1200 | USD |
- | 360 | 2013-02-15 | Debtors | 3 time policy | 2013-03-31 | customer_4 | email | 2 | SI_11 | 30 days end of month | draft | 360 | USD |
- | 1000 | 2013-02-17 | Debtors USD | 3 time policy | 2013-03-31 | customer_5_usd | email | 2 | SI_13 | 30 days end of month | draft | 1000 | USD |
- | 300 | 2013-01-18 | Debtors | 3 time policy | 2013-03-31 | customer_4 | letter | 3 | SI_10 | 10 days last reminder | draft | 300 | |
- | 450 | 2013-03-15 | Debtors | 3 time policy | 2013-03-31 | Donald Duck | email | 1 | SI_18 | 10 days net | draft | 450 | |
- | 150 | 2013-03-15 | Debtors | 3 time policy | 2013-03-31 | Gus Goose | email | 1 | SI_19 | 10 days net | draft | 450 | |
diff --git a/account_credit_control/scenarios/features/06_credit_control_run_apr.feature b/account_credit_control/scenarios/features/06_credit_control_run_apr.feature
deleted file mode 100644
index 0d3d7f82f..000000000
--- a/account_credit_control/scenarios/features/06_credit_control_run_apr.feature
+++ /dev/null
@@ -1,44 +0,0 @@
-###############################################################################
-#
-# OERPScenario, OpenERP Functional Tests
-# Copyright 2012 Camptocamp SA
-# Author Nicolas Bessi
-##############################################################################
-
-# Features Generic tags (none for all)
-##############################################################################
-
-@account_credit_control @account_credit_control_run @account_credit_control_run_apr
-
-Feature: Ensure that email credit line generation first pass is correct
-
- @account_credit_control_mark
- Scenario: mark lines
- Given there is "draft" credit lines
- And I mark all draft email to state "to_be_sent"
- Then the draft line should be in state "to_be_sent"
-
- @account_credit_control_run_month
- Scenario: Create run
- Given I need a "credit.control.run" with oid: credit_control.run4
- And having:
- | name | value |
- | date | 2013-04-30 |
-
- When I launch the credit run
- Then my credit run should be in state "done"
- And the generated credit lines should have the following values:
- | balance | date due | account | policy | date | partner | channel | level | move line | policy level | state | amount due | currency |
- | 360 | 2013-02-15 | Debtors | 3 time policy | 2013-04-30 | customer_4 | letter | 3 | SI_11 | 10 days last reminder | draft | 360 | USD |
- | 1200 | 2013-03-31 | Debtors | 2 time policy | 2013-04-30 | customer_2 | email | 1 | SI_5 | 30 days end of month | draft | 1200 | USD |
- | 1200 | 2013-03-17 | Debtors | 2 time policy | 2013-04-30 | customer_3 | email | 1 | SI_8 | 30 days end of month | draft | 1200 | USD |
- | 700 | 2013-02-28 | Debtors | 3 time policy | 2013-04-30 | customer_4 | email | 2 | SI_10 | 30 days end of month | draft | 700 | |
- | 840 | 2013-03-31 | Debtors | 3 time policy | 2013-04-30 | customer_4 | email | 1 | SI_11 | 10 days net | draft | 840 | USD |
- | 449.99 | 2013-03-15 | Debtors | 3 time policy | 2013-04-30 | customer_4 | email | 2 | SI_12 | 30 days end of month | draft | 449.99 | USD |
- | 1500 | 2013-04-14 | Debtors USD | 3 time policy | 2013-04-30 | customer_5_usd | email | 1 | SI_15 | 10 days net | draft | 1500 | USD |
- | 1200 | 2013-03-17 | Debtors USD | 3 time policy | 2013-04-30 | customer_5_usd | email | 2 | SI_14 | 30 days end of month | draft | 1200 | USD |
- | 1500 | 2013-04-14 | Debtors USD | 3 time policy | 2013-04-30 | customer_5_usd | email | 1 | SI_15 | 10 days net | draft | 1500 | USD |
- | 1500 | 2013-04-14 | Debtors | 3 time policy | 2013-04-30 | customer_4 | email | 1 | SI_16 | 10 days net | draft | 1500 | |
- | 1500 | 2013-04-14 | Debtors | 3 time policy | 2013-04-30 | Scrooge McDuck | email | 1 | SI_17 | 10 days net | draft | 1500 | |
- | 450 | 2013-03-15 | Debtors | 3 time policy | 2013-04-30 | Donald Duck | email | 2 | SI_18 | 30 days end of month | draft | 450 | |
- | 150 | 2013-03-15 | Debtors | 3 time policy | 2013-04-30 | Gus Goose | email | 2 | SI_19 | 30 days end of month | draft | 450 | |
diff --git a/account_credit_control/scenarios/features/07_credit_control_run_may.feature b/account_credit_control/scenarios/features/07_credit_control_run_may.feature
deleted file mode 100644
index e046c12e3..000000000
--- a/account_credit_control/scenarios/features/07_credit_control_run_may.feature
+++ /dev/null
@@ -1,103 +0,0 @@
-###############################################################################
-#
-# OERPScenario, OpenERP Functional Tests
-# Copyright 2012 Camptocamp SA
-# Author Nicolas Bessi
-##############################################################################
-
-# Features Generic tags (none for all)
-##############################################################################
-
-@account_credit_control @account_credit_control_run @account_credit_control_run_may
-
-Feature: Ensure that email credit line generation first pass is correct
-
- @account_credit_control_mark
- Scenario: mark lines
- Given there is "draft" credit lines
- And I mark all draft email to state "to_be_sent"
- Then the draft line should be in state "to_be_sent"
-
- @pay_invoice_si_16
- Scenario: I pay entirely the invoice SI 16, so it should no longer appear in the credit control lines
- Given I need a "account.bank.statement" with oid: scen.voucher_statement_si_16
- And having:
- | name | value |
- | name | Bk.St.si_16 |
- | date | 2013-05-30 |
- | journal_id | by oid: scen.eur_journal |
- | period_id | by name: 05/2013 |
-
- And I import invoice "SI_16" using import invoice button
- And I set bank statement end-balance
- When I confirm bank statement
- Then My invoice "SI_16" is in state "paid" reconciled with a residual amount of "0.0"
-
- @pay_invoice_si_17
- Scenario: I pay entirely the invoice SI 17, so it should no longer appear in the credit control lines
- Given I need a "account.bank.statement" with oid: scen.voucher_statement_si_17
- And having:
- | name | value |
- | name | Bk.St.si_17 |
- | date | 2013-05-30 |
- | journal_id | by oid: scen.eur_journal |
- | period_id | by name: 05/2013 |
-
- And I import invoice "SI_17" using import invoice button
- And I should have a "account.bank.statement.line" with name: "SI_17" and amount: "1500"
- And I set the voucher paid amount to "1000"
- And I save the voucher
- And I modify the line amount to "1000"
- And I need a "account.bank.statement" with oid: scen.voucher_statement_si_17
- And I set bank statement end-balance
- When I confirm bank statement
- Then My invoice "SI_17" is in state "open" reconciled with a residual amount of "500.0"
-
- @pay_invoice_si_18_part1
- Scenario: I pay the first part of the invoice SI 18, so it should no longer appear in the credit control lines however, the second move lines should still appears
- Given I need a "account.bank.statement" with oid: scen.voucher_statement_si_18
- And having:
- | name | value |
- | name | Bk.St.si_18_part1 |
- | date | 2013-05-30 |
- | journal_id | by oid: scen.eur_journal |
- | period_id | by name: 05/2013 |
-
- And I import invoice "SI_18" using import invoice button
- And I should have a "account.bank.statement.line" with name: "SI_18" and amount: "450"
- And I set the voucher paid amount to "450"
- And I save the voucher
- And I modify the line amount to "450"
- And I should have a "account.bank.statement.line" with name: "SI_18" and amount: "1050"
- And I set the voucher paid amount to "0"
- And I save the voucher
- Then I modify the line amount to "0"
- And I need a "account.bank.statement" with oid: scen.voucher_statement_si_18
- And I set bank statement end-balance
- When I confirm bank statement
- Then My invoice "SI_18" is in state "open" reconciled with a residual amount of "1050.0"
-
- @account_credit_control_run_month
- Scenario: Create run
- Given I need a "credit.control.run" with oid: credit_control.run5
- And having:
- | name | value |
- | date | 2013-05-31 |
- When I launch the credit run
- Then my credit run should be in state "done"
- And the generated credit lines should have the following values:
- | balance | date due | account | policy | date | partner | channel | level | move line | policy level | state | amount due | currency |
- | 1500 | 2013-04-30 | Debtors | 2 time policy | 2013-05-31 | customer_2 | email | 1 | SI_6 | 30 days end of month | draft | 1500 | USD |
- | 1000 | 2013-02-28 | Debtors | 2 time policy | 2013-05-31 | customer_2 | letter | 2 | SI_4 | 60 days last reminder | draft | 1000 | |
- | 1000 | 2013-02-17 | Debtors | 2 time policy | 2013-05-31 | customer_3 | letter | 2 | SI_7 | 60 days last reminder | draft | 1000 | |
- | 1500 | 2013-04-14 | Debtors | 2 time policy | 2013-05-31 | customer_3 | email | 1 | SI_9 | 30 days end of month | draft | 1500 | |
- | 840 | 2013-03-31 | Debtors | 3 time policy | 2013-05-31 | customer_4 | email | 2 | SI_11 | 30 days end of month | draft | 840 | USD |
- | 1500 | 2013-04-14 | Debtors USD | 3 time policy | 2013-05-31 | customer_5_usd | email | 2 | SI_15 | 30 days end of month | draft | 1500 | USD |
- | 700 | 2013-02-28 | Debtors | 3 time policy | 2013-05-31 | customer_4 | letter | 3 | SI_10 | 10 days last reminder | draft | 700 | |
- | 449.99 | 2013-03-15 | Debtors | 3 time policy | 2013-05-31 | customer_4 | letter | 3 | SI_12 | 10 days last reminder | draft | 449.99 | USD |
- | 1050.01 | 2013-04-30 | Debtors | 3 time policy | 2013-05-31 | customer_4 | email | 1 | SI_12 | 10 days net | draft | 1050.01 | USD |
- | 1200 | 2013-03-17 | Debtors USD | 3 time policy | 2013-05-31 | customer_5_usd | letter | 3 | SI_14 | 10 days last reminder | draft | 1200 | USD |
- | 500 | 2013-04-14 | Debtors | 3 time policy | 2013-05-31 | Scrooge McDuck | email | 2 | SI_17 | 30 days end of month | draft | 1500 | |
- | 1050 | 2013-04-30 | Debtors | 3 time policy | 2013-05-31 | Donald Duck | email | 1 | SI_18 | 10 days net | draft | 1050 | |
- | 150 | 2013-03-15 | Debtors | 3 time policy | 2013-05-31 | Gus Goose | letter | 3 | SI_19 | 10 days last reminder | draft | 450 | |
- | 1050 | 2013-04-30 | Debtors | 3 time policy | 2013-05-31 | Gus Goose | email | 1 | SI_19 | 10 days net | draft | 1050 | |
diff --git a/account_credit_control/scenarios/features/08_credit_control_run_jun.feature b/account_credit_control/scenarios/features/08_credit_control_run_jun.feature
deleted file mode 100644
index 556c779df..000000000
--- a/account_credit_control/scenarios/features/08_credit_control_run_jun.feature
+++ /dev/null
@@ -1,38 +0,0 @@
-###############################################################################
-#
-# OERPScenario, OpenERP Functional Tests
-# Copyright 2012 Camptocamp SA
-# Author Nicolas Bessi
-##############################################################################
-
-# Features Generic tags (none for all)
-##############################################################################
-
-@account_credit_control @account_credit_control_run @account_credit_control_run_jun
-
-Feature: Ensure that email credit line generation first pass is correct
-
- @account_credit_control_mark
- Scenario: mark lines
- Given there is "draft" credit lines
- And I mark all draft email to state "to_be_sent"
- Then the draft line should be in state "to_be_sent"
-
- @account_credit_control_run_month
- Scenario: Create run
- Given I need a "credit.control.run" with oid: credit_control.run6
- And having:
- | name | value |
- | date | 2013-06-30 |
- When I launch the credit run
- Then my credit run should be in state "done"
- And the generated credit lines should have the following values:
- | balance | date due | account | policy | date | partner | channel | level | move line | policy level | state | amount due | currency |
- | 1200 | 2013-03-31 | Debtors | 2 time policy | 2013-06-30 | customer_2 | letter | 2 | SI_5 | 60 days last reminder | draft | 1200 | USD |
- | 1200 | 2013-03-17 | Debtors | 2 time policy | 2013-06-30 | customer_3 | letter | 2 | SI_8 | 60 days last reminder | draft | 1200 | USD |
- | 1050.01 | 2013-04-30 | Debtors | 3 time policy | 2013-06-30 | customer_4 | email | 2 | SI_12 | 30 days end of month | draft | 1050.01 | USD |
- | 840 | 2013-03-31 | Debtors | 3 time policy | 2013-06-30 | customer_4 | letter | 3 | SI_11 | 10 days last reminder | draft | 840 | USD |
- | 1500 | 2013-04-14 | Debtors USD | 3 time policy | 2013-06-30 | customer_5_usd | letter | 3 | SI_15 | 10 days last reminder | draft | 1500 | USD |
- | 500 | 2013-04-14 | Debtors | 3 time policy | 2013-06-30 | Scrooge McDuck | letter | 3 | SI_17 | 10 days last reminder | draft | 1500 | |
- | 1050 | 2013-04-30 | Debtors | 3 time policy | 2013-06-30 | Donald Duck | email | 2 | SI_18 | 30 days end of month | draft | 1050 | |
- | 1050 | 2013-04-30 | Debtors | 3 time policy | 2013-06-30 | Gus Goose | email | 2 | SI_19 | 30 days end of month | draft | 1050 | |
diff --git a/account_credit_control/scenarios/features/09_credit_control_run_jul.feature b/account_credit_control/scenarios/features/09_credit_control_run_jul.feature
deleted file mode 100644
index 9bd9df52d..000000000
--- a/account_credit_control/scenarios/features/09_credit_control_run_jul.feature
+++ /dev/null
@@ -1,35 +0,0 @@
-###############################################################################
-#
-# OERPScenario, OpenERP Functional Tests
-# Copyright 2012 Camptocamp SA
-# Author Nicolas Bessi
-##############################################################################
-
-# Features Generic tags (none for all)
-##############################################################################
-
-@account_credit_control @account_credit_control_run @account_credit_control_run_jul
-
-Feature: Ensure that email credit line generation first pass is correct
-
- @account_credit_control_mark
- Scenario: mark lines
- Given there is "draft" credit lines
- And I mark all draft email to state "to_be_sent"
- Then the draft line should be in state "to_be_sent"
-
- @account_credit_control_run_month
- Scenario: Create run
- Given I need a "credit.control.run" with oid: credit_control.run7
- And having:
- | name | value |
- | date | 2013-07-31 |
- When I launch the credit run
- Then my credit run should be in state "done"
- And the generated credit lines should have the following values:
- | balance | date due | account | policy | date | partner | channel | level | move line | policy level | state | amount due | currency |
- | 1500 | 2013-04-30 | Debtors | 2 time policy | 2013-07-31 | customer_2 | letter | 2 | SI_6 | 60 days last reminder | draft | 1500 | USD |
- | 1500 | 2013-04-14 | Debtors | 2 time policy | 2013-07-31 | customer_3 | letter | 2 | SI_9 | 60 days last reminder | draft | 1500 | USD |
- | 1050.01 | 2013-04-30 | Debtors | 3 time policy | 2013-07-31 | customer_4 | letter | 3 | SI_12 | 10 days last reminder | draft | 1050.01 | USD |
- | 1050 | 2013-04-30 | Debtors | 3 time policy | 2013-07-31 | Donald Duck | letter | 3 | SI_18 | 10 days last reminder | draft | 1050 | |
- | 1050 | 2013-04-30 | Debtors | 3 time policy | 2013-07-31 | Gus Goose | letter | 3 | SI_19 | 10 days last reminder | draft | 1050 | |
diff --git a/account_credit_control/scenarios/features/10_credit_control_run_aug.feature b/account_credit_control/scenarios/features/10_credit_control_run_aug.feature
deleted file mode 100644
index 12b27b8de..000000000
--- a/account_credit_control/scenarios/features/10_credit_control_run_aug.feature
+++ /dev/null
@@ -1,30 +0,0 @@
-###############################################################################
-#
-# OERPScenario, OpenERP Functional Tests
-# Copyright 2012 Camptocamp SA
-# Author Nicolas Bessi
-##############################################################################
-
-# Features Generic tags (none for all)
-##############################################################################
-
-@account_credit_control @account_credit_control_run @account_credit_control_run_aug
-
-Feature: Ensure that ignore feature works as expected
-
- @account_credit_control_mark_as_ignore
- Scenario: mark last line as ignore
- Given I ignore the "Gus Goose" credit line at level "3" for move line "SI_19" with amount "1050.0"
-
- @account_credit_control_run_month_aug
- Scenario: Create run
- Given I need a "credit.control.run" with oid: credit_control.runignored
- And having:
- | name | value |
- | date | 2013-08-30 |
- When I launch the credit run
- Then my credit run should be in state "done"
-
- @check_ignored_line
- Scenario: Check ignored lines
- Given I have for "Gus Goose" "2" credit lines at level "3" for move line "SI_19" with amount "1050.0" respectively in state "draft" and "ignored"
diff --git a/account_credit_control/scenarios/features/11_credit_control_manual_setting.feature b/account_credit_control/scenarios/features/11_credit_control_manual_setting.feature
deleted file mode 100644
index 1a34ac71a..000000000
--- a/account_credit_control/scenarios/features/11_credit_control_manual_setting.feature
+++ /dev/null
@@ -1,42 +0,0 @@
-###############################################################################
-#
-# OERPScenario, OpenERP Functional Tests
-# Copyright 2012 Camptocamp SA
-# Author Nicolas Bessi
-##############################################################################
-
-# Features Generic tags (none for all)
-##############################################################################
-
-@account_credit_control @account_credit_control_run @account_credit_control_run_change_level
-
-Feature: Ensure that manually changing an invoice level feature works as expected
-
- @account_credit_control_change_level
- Scenario: Change level
- Given I change level for invoice "SAJ/2014/0004" to "10 days net" of policy "3 time policy"
- Then wizard selected move lines should be:
- | name |
- | SI_4 |
- When I confirm the level change
- And I should have "3" credit control lines overridden
- And one new credit control line of level "10 days net" related to invoice "SAJ/2014/0004"
- Then I force date of generated credit line to "2013-09-15"
-
- @account_credit_control_run_month_sept
- Scenario: Create run
- Given there is "draft" credit lines
- And I mark all draft email to state "to_be_sent"
- Then the draft line should be in state "to_be_sent"
- Given I need a "credit.control.run" with oid: credit_control.manual_change
- And having:
- | name | value |
- | date | 2013-09-30 |
- When I launch the credit run
- Then my credit run should be in state "done"
-
- @account_credit_control_manual_next_step
- Scenario: Check manually managed line on run
- Given the invoice "SAJ/2014/0004" with manual changes
- And the invoice has "1" line of level "1" for policy "3 time policy"
- And the invoice has "1" line of level "2" for policy "3 time policy"
diff --git a/account_credit_control/scenarios/features/steps/account_credit_control.py b/account_credit_control/scenarios/features/steps/account_credit_control.py
deleted file mode 100644
index f8718e7c0..000000000
--- a/account_credit_control/scenarios/features/steps/account_credit_control.py
+++ /dev/null
@@ -1,145 +0,0 @@
-import time
-from behave import given, when
-from support import model
-
-@given(u'I configure the following accounts on the credit control policy with oid: "{policy_oid}"')
-def impl(ctx, policy_oid):
- policy = model('credit.control.policy').get(policy_oid)
- assert policy, 'No policy % found' % policy_oid
- acc_obj = model('account.account')
- accounts = []
- for row in ctx.table:
- acc = acc_obj.get(['code = %s' % row['account code']])
- assert acc, "Account with code %s not found" % row['account code']
- accounts.append(acc)
- policy.write({'account_ids': [x.id for x in accounts]})
-
-
-@when(u'I launch the credit run')
-def impl(ctx):
- assert ctx.found_item
- # Must be a cleaner way to do it
- assert 'credit.control.run' == ctx.found_item._model._name
- ctx.found_item.generate_credit_lines()
-
-@given(u'I clean all the credit lines')
-def impl(ctx):
- model('credit.control.line').browse([]).unlink()
-
-@then(u'my credit run should be in state "done"')
-def impl(ctx):
- assert ctx.found_item
- # Must be a cleaner way to do it
- assert model("credit.control.run").get(ctx.found_item.id).state == 'done'
-
-@then(u'the generated credit lines should have the following values')
-def impl(ctx):
- def _row_to_dict(row):
- return dict((name, row[name]) for name in row.headings if row[name])
- rows = map(_row_to_dict, ctx.table)
-
- def _parse_date(value):
- return time.strftime(value) if '%' in value else value
-
- for row in rows:
- account = model('account.account').get(['name = %s' % row['account']])
- assert account, "no account named %s found" % row['account']
-
- policy = model('credit.control.policy').get(['name = %s' % row['policy']])
- assert policy, "No policy %s found" % row['policy']
-
- partner = model('res.partner').get(['name = %s' % row['partner']])
- assert partner, "No partner %s found" % row['partner']
-
- maturity_date = _parse_date(row['date due'])
- move_line = model('account.move.line').get(['name = %s' % row['move line'],
- 'date_maturity = %s' % maturity_date])
- assert move_line, "No move line %s found" % row['move line']
-
- level = model('credit.control.policy.level').get(['name = %s' % row['policy level'],
- 'policy_id = %s' % policy.id])
- assert level, "No level % found" % row['policy level']
-
- domain = [['account_id', '=', account.id],
- ['policy_id', '=', policy.id],
- ['partner_id', '=', partner.id],
- ['policy_level_id', '=', level.id],
- ['amount_due', '=', row.get('amount due', 0.0)],
- ['state', '=', row['state']],
- ['level', '=', row.get('level', 0.0)],
- ['channel', '=', row['channel']],
- ['balance_due', '=', row.get('balance', 0.0)],
- ['date_due', '=', _parse_date(row['date due'])],
- ['date', '=', _parse_date(row['date'])],
- ['move_line_id', '=', move_line.id],
- ]
- if row.get('currency'):
- curreny = model('res.currency').get(['name = %s' % row['currency']])
- assert curreny, "No currency %s found" % row['currency']
- domain.append(('currency_id', '=', curreny.id))
-
- lines = model('credit.control.line').search(domain)
- assert lines, "no line found for %s" % repr(row)
- assert len(lines) == 1, "Too many lines found for %s" % repr(row)
- date_lines = model('credit.control.line').search([('date', '=', ctx.found_item.date)])
- assert len(date_lines) == len(ctx.table.rows), "Too many lines generated"
-
-
-def open_invoice(ctx):
- assert ctx.found_item
- ctx.found_item._send('invoice_open')
- # _send refresh object
- assert ctx.found_item.state == 'open'
-
-@then(u'I open the credit invoice')
-def impl(ctx):
- open_invoice(ctx)
-
-@given(u'I open the credit invoice')
-def impl(ctx):
- open_invoice(ctx)
-
-@given(u'there is "{state}" credit lines')
-def impl(ctx, state):
- assert model('credit.control.line').search(['state = %s' % state])
-
-@given(u'I mark all draft email to state "{state}"')
-def impl(ctx, state):
- wiz = model('credit.control.marker').create({'name': state})
- lines = model('credit.control.line').search([('state', '=', 'draft')])
- assert lines
- ctx.lines = lines
- wiz.write({'line_ids': lines})
- wiz.mark_lines()
-
-@then(u'the draft line should be in state "{state}"')
-def impl(ctx, state):
- assert ctx.lines
- lines = model('credit.control.line').search([('state', '!=', state),
- ('id', 'in', ctx.lines)])
- assert not lines
-
-@given(u'I ignore the "{partner}" credit line at level "{level:d}" for move line "{move_line_name}" with amount "{amount:f}"')
-def impl(ctx, partner, level, move_line_name, amount):
- print ctx, partner, level, move_line_name, amount
- to_ignore = model('credit.control.line').search([('partner_id.name', '=', partner),
- ('level', '=', level),
- ('amount_due', '=', amount),
- ('move_line_id.name', '=', move_line_name)])
- assert to_ignore
- wiz = model('credit.control.marker').create({'name': 'ignored'})
- ctx.lines = to_ignore
- wiz.write({'line_ids': to_ignore})
- wiz.mark_lines()
- assert model('credit.control.line').get(to_ignore[0]).state == 'ignored'
-
-@given(u'I have for "{partner}" "{number:d}" credit lines at level "{level:d}" for move line "{move_line_name}" with amount "{amount:f}" respectively in state "draft" and "ignored"')
-def impl(ctx, partner, number, level, move_line_name, amount):
- to_check = model('credit.control.line').search([('partner_id.name', '=', partner),
- ('level', '=', level),
- ('amount_due', '=', amount),
- ('move_line_id.name', '=', move_line_name),
- ('state', 'in', ('draft', 'ignored'))])
- assert_equal(len(to_check), int(number), msg="More than %s found" % number)
- lines = model('credit.control.line').browse(to_check)
- assert set(['ignored', 'draft']) == set(lines.state)
diff --git a/account_credit_control/scenarios/features/steps/account_credit_control_changer.py b/account_credit_control/scenarios/features/steps/account_credit_control_changer.py
deleted file mode 100644
index 0597438b6..000000000
--- a/account_credit_control/scenarios/features/steps/account_credit_control_changer.py
+++ /dev/null
@@ -1,76 +0,0 @@
-# -*- coding: utf-8 -*-
-@given(u'I change level for invoice "{invoice_name}" to "{level_name}" of policy "{policy_name}"')
-def impl(ctx, invoice_name, level_name, policy_name):
- invoice = model('account.invoice').get([('number', '=', invoice_name)])
- assert_true(invoice, msg='No invoices found')
- level = model('credit.control.policy.level').get([('name', '=', level_name)])
- assert_true(level, 'level not found')
- policy = model('credit.control.policy').get([('name', '=', policy_name)])
- assert_true(policy, 'Policy not found')
- assert_equal(policy.id, level.policy_id.id)
- context = {'active_ids': [invoice.id]}
- data = {'new_policy_id': policy.id,
- 'new_policy_level_id': level.id}
- wizard = model('credit.control.policy.changer').create(data, context=context)
- ctx.wizard = wizard
-
-@then(u'wizard selected move lines should be')
-def impl(ctx):
- assert_true(ctx.wizard)
- names = [x.name for x in ctx.wizard.move_line_ids]
- for line in ctx.table:
- assert_in(line['name'], names)
-
-@when(u'I confirm the level change')
-def impl(ctx):
- assert_true(ctx.wizard)
- ctx.wizard.set_new_policy()
-
-@when(u'I should have "{line_number:d}" credit control lines overridden')
-def impl(ctx, line_number):
- assert_true(ctx.wizard)
- move_ids = [x.id for x in ctx.wizard.move_line_ids]
- overridden = model('credit.control.line').search([('move_line_id', 'in', move_ids),
- ('manually_overridden', '=', True)])
-# assert len(overridden) == line_number
-
-@when(u'one new credit control line of level "{level_name}" related to invoice "{invoice_name}"')
-def impl(ctx, level_name, invoice_name):
- invoice = model('account.invoice').get([('number', '=', invoice_name)])
- assert_true(invoice, msg='No invoices found')
- level = model('credit.control.policy.level').get([('name', '=', level_name)])
- assert_true(level, 'level not found')
- assert_true(ctx.wizard)
- move_ids = [x.id for x in ctx.wizard.move_line_ids]
- created_id = model('credit.control.line').search([('move_line_id', 'in', move_ids),
- ('manually_overridden', '=', False)])
-
- assert len(created_id) == 1
- created = model('credit.control.line').get(created_id[0])
- ctx.created = created
- assert_equal(created.policy_level_id.id, level.id)
- assert_equal(created.invoice_id.id, invoice.id)
- assert_equal(created.invoice_id.credit_policy_id.id, level.policy_id.id)
-
-@then(u'I force date of generated credit line to "{date}"')
-def impl(ctx, date):
- assert_true(ctx.created)
- ctx.created.write({'date': date})
-
-@given(u'the invoice "{invoice_name}" with manual changes')
-def impl(ctx, invoice_name):
- invoice = model('account.invoice').get([('number', '=', invoice_name)])
- assert_true(invoice, msg='No invoices found')
- man_lines = (x for x in invoice.credit_control_line_ids if x.manually_overridden)
- assert_true(next(man_lines, None), 'No manual change on the invoice')
- ctx.invoice = invoice
-
-@given(u'the invoice has "{line_number:d}" line of level "{level:d}" for policy "{policy_name}"')
-def impl(ctx, line_number, level, policy_name):
- assert_true(ctx.invoice)
- policy = model('credit.control.policy').get([('name', '=', policy_name)])
- assert_true(policy)
- lines = model('credit.control.line').search([('invoice_id', '=', ctx.invoice.id),
- ('level', '=', level),
- ('policy_id', '=', policy.id)])
- assert_equal(len(lines), line_number)
diff --git a/account_credit_control/scenarios/features/steps/account_voucher.py b/account_credit_control/scenarios/features/steps/account_voucher.py
deleted file mode 100644
index f89ce5721..000000000
--- a/account_credit_control/scenarios/features/steps/account_voucher.py
+++ /dev/null
@@ -1,97 +0,0 @@
-from support import *
-import datetime
-
-@step('I import invoice "{inv_name}" using import invoice button')
-def impl(ctx, inv_name):
- invoice = model('account.invoice').get([('name', '=', inv_name)])
- assert invoice
- bank_statement = ctx.found_item
- for line in bank_statement.line_ids:
- line.unlink()
- lines = model('account.move.line').browse([('move_id', '=', invoice.move_id.id),
- ('account_id', '=', invoice.account_id.id)])
-
- wizard = model('account.statement.from.invoice.lines').create({'line_ids': lines})
- wizard.populate_statement({'statement_id': bank_statement.id})
-
-@given(u'I should have a "account.bank.statement.line" with name: "{name}" and amount: "{amount}"')
-def impl(ctx, name, amount):
- assert ctx.found_item
- line = model('account.bank.statement.line').get([('name', '=', name),
- ('amount', '=', amount),
- ('statement_id', '=', ctx.found_item.id)])
- assert line
- ctx.line = line
-
-@given(u'I set the voucher paid amount to "{amount}"')
-def impl(ctx, amount):
- assert ctx.line
- voucher = model('account.voucher').get(ctx.line.voucher_id.id)
- assert voucher
-
- vals = voucher.onchange_amount(float(amount),
- voucher.payment_rate,
- voucher.partner_id.id,
- voucher.journal_id.id if voucher.journal_id else False,
- voucher.currency_id.id if voucher.currency_id else False,
- voucher.type,
- voucher.date,
- voucher.payment_rate,
- voucher.company_id.id if voucher.company_id else false)
- vals = vals['value']
- vals.update({'amount': ctx.line.voucher_id.amount})
- voucher_line_ids = []
- voucher_line_dr_ids = []
- v_l_obj = model('account.voucher.line')
- for v_line_vals in vals.get('line_cr_ids', []) or []:
- v_line_vals['voucher_id'] = voucher.id
- voucher_line_ids.append(v_l_obj.create(v_line_vals).id)
- vals['line_cr_ids'] = voucher_line_ids
-
- for v_line_vals in vals.get('line_dr_ids', []) or []:
- v_line_vals['voucher_id'] = voucher.id
- voucher_line_dr_ids.append(v_l_obj.create(v_line_vals).id)
- vals['line_dr_ids'] = voucher_line_ids
-
- voucher.write(vals)
- ctx.vals = vals
- ctx.voucher = voucher
-
-@given(u'I save the voucher')
-def impl(ctx):
- assert True
-
-@given(u'I modify the line amount to "{amount}"')
-@then(u'I modify the line amount to "{amount}"')
-def impl(ctx, amount):
- assert ctx.line
- # we have to change voucher amount before chaning statement line amount
- if ctx.line.voucher_id:
- model('account.voucher').write([ctx.line.voucher_id.id],
- {'amount': float(amount)})
- ctx.line.write({'amount': float(amount)})
-
-@step('My invoice "{inv_name}" is in state "{state}" reconciled with a residual amount of "{amount:f}"')
-def impl(ctx, inv_name, state, amount):
- invoice = model('account.invoice').get([('name', '=', inv_name)])
- assert_almost_equal(invoice.residual, amount)
- assert_equal(invoice.state, state)
-
-@step('I modify the bank statement line amount to {amount:f}')
-def impl(ctx, amount):
- line = ctx.found_item.voucher_id.line_cr_ids[0]
- #ctx.voucher = model('account.voucher').get(ctx.found_item.voucher_id.id)
- ctx.found_item.on_change('onchange_amount', 'amount', (), amount)
-
-@then(u'I set bank statement end-balance')
-@given(u'I set bank statement end-balance')
-def impl(ctx):
- assert ctx.found_item, "No statement found"
- ctx.found_item.write({'balance_end_real': ctx.found_item.balance_end})
- assert ctx.found_item.balance_end == ctx.found_item.balance_end_real
-
-@when(u'I confirm bank statement')
-def impl(ctx):
- assert ctx.found_item
- assert_equal(ctx.found_item._model._name, 'account.bank.statement')
- ctx.found_item.button_confirm_bank()
diff --git a/account_credit_control/security/ir.model.access.csv b/account_credit_control/security/ir.model.access.csv
deleted file mode 100644
index c47087e6e..000000000
--- a/account_credit_control/security/ir.model.access.csv
+++ /dev/null
@@ -1,21 +0,0 @@
-"id","perm_create","perm_unlink","group_id/id","name","model_id/id","perm_read","perm_write"
-"account_credit_control.ir_model_access_270",1,1,"group_account_credit_control_manager","credit_control_manager_line","account_credit_control.model_credit_control_line",1,1
-"account_credit_control.ir_model_access_271",1,1,"group_account_credit_control_user","credit_control_user_line","account_credit_control.model_credit_control_line",1,1
-"account_credit_control.ir_model_access_272",0,0,"group_account_credit_control_info","credit_control_info_line","account_credit_control.model_credit_control_line",1,0
-"account_credit_control.ir_model_access_273",1,1,"group_account_credit_control_manager","credit_control_manager_mail_template","email_template.model_email_template",1,1
-"account_credit_control.ir_model_access_274",1,1,"group_account_credit_control_manager","credit_control_manager_mail_template_preview","email_template.model_email_template_preview",1,1
-"account_credit_control.ir_model_access_275",1,1,"group_account_credit_control_manager","credit_control_manager_mail_message","mail.model_mail_message",1,1
-"account_credit_control.ir_model_access_276",1,0,"group_account_credit_control_user","credit_control_user_mail_message","mail.model_mail_message",1,1
-"account_credit_control.ir_model_access_277",0,0,"group_account_credit_control_info","credit_control_info_mail_message","mail.model_mail_message",1,0
-"account_credit_control.ir_model_access_281",1,1,"group_account_credit_control_manager","credit_control_mananger_run","account_credit_control.model_credit_control_run",1,1
-"account_credit_control.ir_model_access_282",1,1,"group_account_credit_control_user","credit_control_user_run","account_credit_control.model_credit_control_run",1,1
-"account_credit_control.ir_model_access_283",0,0,"group_account_credit_control_info","credit_control_info_run","account_credit_control.model_credit_control_run",1,0
-"account_credit_control.ir_model_access_284",1,1,"group_account_credit_control_manager","credit_control_manager_policy","account_credit_control.model_credit_control_policy",1,1
-"account_credit_control.ir_model_access_285",0,0,"group_account_credit_control_user","credit_control_user_policy","account_credit_control.model_credit_control_policy",1,0
-"account_credit_control.ir_model_access_286",0,0,"group_account_credit_control_info","credit_control_info_policy","account_credit_control.model_credit_control_policy",1,0
-"account_credit_control.ir_model_access_287",1,1,"group_account_credit_control_manager","credit_control_manager_level","account_credit_control.model_credit_control_policy_level",1,1
-"account_credit_control.ir_model_access_288",0,0,"group_account_credit_control_user","credit_control_user_level","account_credit_control.model_credit_control_policy_level",1,0
-"account_credit_control.ir_model_access_289",0,0,"group_account_credit_control_info","credit_control_info_level","account_credit_control.model_credit_control_policy_level",1,0
-"account_credit_control.ir_model_access_290",0,0,"account.group_account_user","credit_control_fin_user_line","account_credit_control.model_credit_control_line",1,0
-"account_credit_control.ir_model_access_291",0,0,"account.group_account_invoice","credit_control_fin_invoice_line","account_credit_control.model_credit_control_line",1,0
-"account_credit_control.ir_model_access_292",1,1,"account.group_account_manager","credit_control_fin_manager_line","account_credit_control.model_credit_control_line",1,1
\ No newline at end of file
diff --git a/account_credit_control/wizard/__init__.py b/account_credit_control/wizard/__init__.py
deleted file mode 100644
index f12dea14d..000000000
--- a/account_credit_control/wizard/__init__.py
+++ /dev/null
@@ -1,25 +0,0 @@
-# -*- coding: utf-8 -*-
-##############################################################################
-#
-# Author: Nicolas Bessi, Guewen Baconnier
-# Copyright 2012 Camptocamp SA
-#
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Affero General Public License as
-# published by the Free Software Foundation, either version 3 of the
-# License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Affero General Public License for more details.
-#
-# You should have received a copy of the GNU Affero General Public License
-# along with this program. If not, see .
-#
-##############################################################################
-from . import credit_control_emailer
-from . import credit_control_marker
-from . import credit_control_printer
-from . import credit_control_communication
-from . import credit_control_policy_changer
diff --git a/account_credit_control/wizard/credit_control_communication.py b/account_credit_control/wizard/credit_control_communication.py
deleted file mode 100644
index 2584660dd..000000000
--- a/account_credit_control/wizard/credit_control_communication.py
+++ /dev/null
@@ -1,183 +0,0 @@
-# -*- coding: utf-8 -*-
-##############################################################################
-#
-# Author: Nicolas Bessi, Guewen Baconnier
-# Copyright 2012 Camptocamp SA
-#
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Affero General Public License as
-# published by the Free Software Foundation, either version 3 of the
-# License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Affero General Public License for more details.
-#
-# You should have received a copy of the GNU Affero General Public License
-# along with this program. If not, see .
-#
-##############################################################################
-import netsvc
-import logging
-from openerp.osv.orm import TransientModel, fields
-
-logger = logging.getLogger('credit.control.line.mailing')
-
-
-class CreditCommunication(TransientModel):
- """Shell class used to provide a base model to email template and reporting.
- Il use this approche in version 7 a browse record will exist even if not saved"""
- _name = "credit.control.communication"
- _description = "credit control communication"
- _rec_name = 'partner_id'
- _columns = {'partner_id': fields.many2one('res.partner', 'Partner', required=True),
-
- 'current_policy_level': fields.many2one('credit.control.policy.level',
- 'Level', required=True),
-
- 'credit_control_line_ids': fields.many2many('credit.control.line',
- rel='comm_credit_rel',
- string='Credit Lines'),
-
- 'company_id': fields.many2one('res.company', 'Company',
- required=True),
-
- 'user_id': fields.many2one('res.users', 'User')}
-
- _defaults = {'company_id': lambda s, cr, uid, c: s.pool.get('res.company')._company_default_get(
- cr, uid, 'credit.control.policy', context=c),
- 'user_id': lambda s, cr, uid, c: uid}
-
- def get_email(self, cr, uid, com_id, context=None):
- """Return a valid email for customer"""
- if isinstance(com_id, list):
- assert len(com_id) == 1, "get_email only support one id as parameter"
- com_id = com_id[0]
- form = self.browse(cr, uid, com_id, context=context)
- contact = form.get_contact_address()
- return contact.email
-
- def get_contact_address(self, cr, uid, com_id, context=None):
- pmod = self.pool['res.partner']
- if isinstance(com_id, list):
- com_id = com_id[0]
- form = self.browse(cr, uid, com_id, context=context)
- part = form.partner_id
- add_ids = part.address_get(adr_pref=['invoice']) or {}
- add_id = add_ids.get('invoice', add_ids.get('default', False))
- return pmod.browse(cr, uid, add_id, context)
-
- def _get_credit_lines(self, cr, uid, line_ids, partner_id, level_id, context=None):
- """Return credit lines related to a partner and a policy level"""
- cr_line_obj = self.pool.get('credit.control.line')
- cr_l_ids = cr_line_obj.search(cr,
- uid,
- [('id', 'in', line_ids),
- ('partner_id', '=', partner_id),
- ('policy_level_id', '=', level_id)],
- context=context)
- return cr_l_ids
-
- def _generate_comm_from_credit_line_ids(self, cr, uid, line_ids, context=None):
- """Aggregate credit control line by partner, level, and currency
- It also generate a communication object per aggregation.
- """
- if not line_ids:
- return []
- comms = []
- sql = ("SELECT distinct partner_id, policy_level_id, "
- " credit_control_line.currency_id, credit_control_policy_level.level"
- " FROM credit_control_line JOIN credit_control_policy_level "
- " ON (credit_control_line.policy_level_id = credit_control_policy_level.id)"
- " WHERE credit_control_line.id in %s"
- " ORDER by credit_control_policy_level.level, credit_control_line.currency_id")
-
- cr.execute(sql, (tuple(line_ids),))
- res = cr.dictfetchall()
- for level_assoc in res:
- data = {}
- data['credit_control_line_ids'] = \
- [(6, 0, self._get_credit_lines(cr, uid, line_ids,
- level_assoc['partner_id'],
- level_assoc['policy_level_id'],
- context=context))]
- data['partner_id'] = level_assoc['partner_id']
- data['current_policy_level'] = level_assoc['policy_level_id']
- comm_id = self.create(cr, uid, data, context=context)
- comms.append(self.browse(cr, uid, comm_id, context=context))
- return comms
-
- def _generate_emails(self, cr, uid, comms, context=None):
- """Generate email message using template related to level"""
- cr_line_obj = self.pool.get('credit.control.line')
- email_temp_obj = self.pool.get('email.template')
- email_message_obj = self.pool.get('mail.mail')
- att_obj = self.pool.get('ir.attachment')
- email_ids = []
- essential_fields = ['subject',
- 'body_html',
- 'email_from',
- 'email_to']
-
- for comm in comms:
- # we want to use a local cr in order to send the maximum
- # of email
- template = comm.current_policy_level.email_template_id.id
- email_values = {}
- cl_ids = [cl.id for cl in comm.credit_control_line_ids]
- email_values = email_temp_obj.generate_email(cr, uid,
- template,
- comm.id,
- context=context)
- email_values['body_html'] = email_values['body']
- email_values['type'] = 'email'
-
- email_id = email_message_obj.create(cr, uid, email_values, context=context)
-
- state = 'sent'
- # The mail will not be send, however it will be in the pool, in an
- # error state. So we create it, link it with the credit control line
- # and put this latter in a `email_error` state we not that we have a
- # problem with the email
- if any(not email_values.get(field) for field in essential_fields):
- state = 'email_error'
-
- cr_line_obj.write(
- cr, uid, cl_ids,
- {'mail_message_id': email_id,
- 'state': state},
- context=context)
- att_ids = []
- for att in email_values.get('attachments', []):
- attach_fname = att[0]
- attach_datas = att[1]
- data_attach = {
- 'name': attach_fname,
- 'datas': attach_datas,
- 'datas_fname': attach_fname,
- 'res_model': 'mail.mail',
- 'res_id': email_id,
- 'type': 'binary',
- }
- att_ids.append(att_obj.create(cr, uid, data_attach, context=context))
- email_message_obj.write(cr, uid, [email_id],
- {'attachment_ids': [(6, 0, att_ids)]},
- context=context)
- email_ids.append(email_id)
- return email_ids
-
- def _generate_report(self, cr, uid, comms, context=None):
- """Will generate a report by inserting mako template of related policy template"""
- service = netsvc.LocalService('report.credit_control_summary')
- ids = [x.id for x in comms]
- result, format = service.create(cr, uid, ids, {}, {})
- return result
-
- def _mark_credit_line_as_sent(self, cr, uid, comms, context=None):
- line_ids = []
- for comm in comms:
- line_ids += [x.id for x in comm.credit_control_line_ids]
- l_obj = self.pool.get('credit.control.line')
- l_obj.write(cr, uid, line_ids, {'state': 'sent'}, context=context)
- return line_ids
diff --git a/account_credit_control/wizard/credit_control_emailer.py b/account_credit_control/wizard/credit_control_emailer.py
deleted file mode 100644
index f0d3f7c6d..000000000
--- a/account_credit_control/wizard/credit_control_emailer.py
+++ /dev/null
@@ -1,82 +0,0 @@
-# -*- coding: utf-8 -*-
-##############################################################################
-#
-# Author: Nicolas Bessi, Guewen Baconnier
-# Copyright 2012 Camptocamp SA
-#
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Affero General Public License as
-# published by the Free Software Foundation, either version 3 of the
-# License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Affero General Public License for more details.
-#
-# You should have received a copy of the GNU Affero General Public License
-# along with this program. If not, see .
-#
-##############################################################################
-
-from openerp.osv import orm, fields
-from openerp.tools.translate import _
-
-
-class CreditControlEmailer(orm.TransientModel):
- """Send emails for each selected credit control lines."""
-
- _name = "credit.control.emailer"
- _description = """Mass credit line emailer"""
- _rec_name = 'id'
-
- def _get_line_ids(self, cr, uid, context=None):
- if context is None:
- context = {}
- res = False
- if (context.get('active_model') == 'credit.control.line' and
- context.get('active_ids')):
- res = self._filter_line_ids(
- cr, uid,
- context['active_ids'],
- context=context)
- return res
-
- _columns = {
- 'line_ids': fields.many2many(
- 'credit.control.line',
- string='Credit Control Lines',
- domain="[('state', '=', 'to_be_sent'), ('channel', '=', 'email')]"),
- }
-
- _defaults = {
- 'line_ids': _get_line_ids,
- }
-
- def _filter_line_ids(self, cr, uid, active_ids, context=None):
- """filter lines to use in the wizard"""
- line_obj = self.pool.get('credit.control.line')
- domain = [('state', '=', 'to_be_sent'),
- ('id', 'in', active_ids),
- ('channel', '=', 'email')]
- return line_obj.search(cr, uid, domain, context=context)
-
- def email_lines(self, cr, uid, wiz_id, context=None):
- assert not (isinstance(wiz_id, list) and len(wiz_id) > 1), \
- "wiz_id: only one id expected"
- comm_obj = self.pool.get('credit.control.communication')
- if isinstance(wiz_id, list):
- wiz_id = wiz_id[0]
- form = self.browse(cr, uid, wiz_id, context)
-
- if not form.line_ids:
- raise orm.except_orm(_('Error'), _('No credit control lines selected.'))
-
- line_ids = [l.id for l in form.line_ids]
- filtered_ids = self._filter_line_ids(
- cr, uid, line_ids, context)
- comms = comm_obj._generate_comm_from_credit_line_ids(
- cr, uid, filtered_ids, context=context)
- comm_obj._generate_emails(cr, uid, comms, context=context)
- return {}
-
diff --git a/account_credit_control/wizard/credit_control_emailer_view.xml b/account_credit_control/wizard/credit_control_emailer_view.xml
deleted file mode 100644
index 2c299a64b..000000000
--- a/account_credit_control/wizard/credit_control_emailer_view.xml
+++ /dev/null
@@ -1,54 +0,0 @@
-
-
-
-
- credit.line.emailer.form
- credit.control.emailer
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Send By Email
- credit.control.emailer
- form
- form
-
- new
- Send an email for the selected lines.
-
-
-
-
-
diff --git a/account_credit_control/wizard/credit_control_marker.py b/account_credit_control/wizard/credit_control_marker.py
deleted file mode 100644
index a458ab394..000000000
--- a/account_credit_control/wizard/credit_control_marker.py
+++ /dev/null
@@ -1,100 +0,0 @@
-# -*- coding: utf-8 -*-
-##############################################################################
-#
-# Author: Nicolas Bessi, Guewen Baconnier
-# Copyright 2012 Camptocamp SA
-#
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Affero General Public License as
-# published by the Free Software Foundation, either version 3 of the
-# License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Affero General Public License for more details.
-#
-# You should have received a copy of the GNU Affero General Public License
-# along with this program. If not, see .
-#
-##############################################################################
-from openerp.osv import orm, fields
-from openerp.tools.translate import _
-
-
-class CreditControlMarker(orm.TransientModel):
- """Change the state of lines in mass"""
-
- _name = 'credit.control.marker'
- _description = 'Mass marker'
-
- def _get_line_ids(self, cr, uid, context=None):
- if context is None:
- context = {}
- res = False
- if (context.get('active_model') == 'credit.control.line' and
- context.get('active_ids')):
- res = self._filter_line_ids(
- cr, uid,
- context['active_ids'],
- context=context)
- return res
-
- _columns = {
- 'name': fields.selection([('ignored', 'Ignored'),
- ('to_be_sent', 'Ready To Send'),
- ('sent', 'Done')],
- 'Mark as', required=True),
- 'line_ids': fields.many2many(
- 'credit.control.line',
- string='Credit Control Lines',
- domain="[('state', '!=', 'sent')]"),
- }
-
- _defaults = {
- 'name': 'to_be_sent',
- 'line_ids': _get_line_ids,
- }
-
- def _filter_line_ids(self, cr, uid, active_ids, context=None):
- """get line to be marked filter done lines"""
- line_obj = self.pool.get('credit.control.line')
- domain = [('state', '!=', 'sent'), ('id', 'in', active_ids)]
- return line_obj.search(cr, uid, domain, context=context)
-
- def _mark_lines(self, cr, uid, filtered_ids, state, context=None):
- """write hook"""
- line_obj = self.pool.get('credit.control.line')
- if not state:
- raise ValueError(_('state can not be empty'))
- line_obj.write(cr, uid, filtered_ids, {'state': state}, context=context)
- return filtered_ids
-
- def mark_lines(self, cr, uid, wiz_id, context=None):
- """Write state of selected credit lines to the one in entry
- done credit line will be ignored"""
- assert not (isinstance(wiz_id, list) and len(wiz_id) > 1), \
- "wiz_id: only one id expected"
- if isinstance(wiz_id, list):
- wiz_id = wiz_id[0]
- form = self.browse(cr, uid, wiz_id, context)
-
- if not form.line_ids:
- raise orm.except_orm(_('Error'), _('No credit control lines selected.'))
-
- line_ids = [l.id for l in form.line_ids]
-
- filtered_ids = self._filter_line_ids(cr, uid, line_ids, context)
- if not filtered_ids:
- raise except_osv(_('Information'),
- _('No lines will be changed. All the selected lines are already done.'))
-
- self._mark_lines(cr, uid, filtered_ids, form.name, context)
-
- return {'domain': unicode([('id', 'in', filtered_ids)]),
- 'view_type': 'form',
- 'view_mode': 'tree,form',
- 'view_id': False,
- 'res_model': 'credit.control.line',
- 'type': 'ir.actions.act_window'}
-
diff --git a/account_credit_control/wizard/credit_control_marker_view.xml b/account_credit_control/wizard/credit_control_marker_view.xml
deleted file mode 100644
index c32cc8e18..000000000
--- a/account_credit_control/wizard/credit_control_marker_view.xml
+++ /dev/null
@@ -1,60 +0,0 @@
-
-
-
-
- credit.line.marker.form
- credit.control.marker
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Change Lines' State
- credit.control.marker
- credit.control.line
- form
- form
-
- new
- Change the state of the selected lines.
-
-
-
-
diff --git a/account_credit_control/wizard/credit_control_policy_changer.py b/account_credit_control/wizard/credit_control_policy_changer.py
deleted file mode 100644
index 41dbea5f7..000000000
--- a/account_credit_control/wizard/credit_control_policy_changer.py
+++ /dev/null
@@ -1,178 +0,0 @@
-# -*- coding: utf-8 -*-
-##############################################################################
-#
-# Author: Nicolas Bessi
-# Copyright 2014 Camptocamp SA
-#
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Affero General Public License as
-# published by the Free Software Foundation, either version 3 of the
-# License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Affero General Public License for more details.
-#
-# You should have received a copy of the GNU Affero General Public License
-# along with this program. If not, see .
-#
-##############################################################################
-import logging
-from openerp.tools.translate import _
-from openerp.osv import orm, fields
-logger = logging.getLogger(__name__)
-
-
-class credit_control_policy_changer(orm.TransientModel):
- """Wizard that is run from invoices and allows to set manually a policy
- Policy are actually apply to related move lines availabe
- in selection widget
-
- """
- _name = "credit.control.policy.changer"
- _columns = {
- 'new_policy_id': fields.many2one('credit.control.policy',
- 'New Policy to Apply',
- required=True),
- 'new_policy_level_id': fields.many2one('credit.control.policy.level',
- 'New level to apply',
- required=True),
- # Only used to provide dynamic filtering on form
- 'do_nothing': fields.boolean('No follow policy'),
- 'move_line_ids': fields.many2many('account.move.line',
- rel='credit_changer_ml_rel',
- string='Move line to change'),
- }
-
- def _get_default_lines(self, cr, uid, context=None):
- """Get default lines for fields move_line_ids
- of wizard. Only take lines that are on the same account
- and move of the invoice and not reconciled
-
- :return: list of compliant move line ids
-
- """
- if context is None:
- context = {}
- active_ids = context.get('active_ids')
- selected_line_ids = []
- inv_model = self.pool['account.invoice']
- move_line_model = self.pool['account.move.line']
- if not active_ids:
- return False
- # raise ValueError('No active_ids passed in context')
- for invoice in inv_model.browse(cr, uid, active_ids, context=context):
- if invoice.type in ('in_invoice', 'in_refund', 'out_refund'):
- raise orm.except_orm(_('User error'),
- _('Please use wizard on cutomer invoices'))
-
- domain = [('account_id', '=', invoice.account_id.id),
- ('move_id', '=', invoice.move_id.id),
- ('reconcile_id', '=', False)]
- move_ids = move_line_model.search(cr, uid, domain, context=context)
- selected_line_ids.extend(move_ids)
- return selected_line_ids
-
- _defaults = {'move_line_ids': _get_default_lines}
-
- def onchange_policy_id(self, cr, uid, ids, new_policy_id, context=None):
- if not new_policy_id:
- return {}
- policy = self.pool['credit.control.policy'].browse(cr, uid,
- new_policy_id,
- context=context)
- return {'value': {'do_nothing': policy.do_nothing}}
-
- def _mark_as_overridden(self, cr, uid, move_lines, context=None):
- """Mark `move_lines` related credit control line as overridden
- This is done by setting manually_overridden fields to True
-
- :param move_lines: move line to mark as overridden
-
- :retun: list of credit line ids that where marked as overridden
-
- """
- credit_model = self.pool['credit.control.line']
- domain = [('move_line_id', 'in', [x.id for x in move_lines])]
- credits_ids = credit_model.search(cr, uid, domain, context=context)
- credit_model.write(cr, uid,
- credits_ids,
- {'manually_overridden': True},
- context)
- return credits_ids
-
- def _set_invoice_policy(self, cr, uid, move_line_ids, policy,
- context=None):
- """Force policy on invoice"""
- invoice_model = self.pool['account.invoice']
- invoice_ids = set([x.invoice.id for x in move_line_ids if x.invoice])
- invoice_model.write(cr, uid, list(invoice_ids),
- {'credit_policy_id': policy.id},
- context=context)
-
- def _check_accounts_policies(self, cr, uid, lines, policy, context=None):
- policy_obj = self.pool['credit.control.policy']
- for line in lines:
- policy_obj.check_policy_against_account(
- cr, uid,
- line.account_id.id,
- policy.id,
- context=context
- )
- return True
-
- def set_new_policy(self, cr, uid, wizard_id, context=None):
- """Set new policy on an invoice.
-
- This is done by creating a new credit control line
- related to the move line and the policy setted in
- the wizard form
-
- :return: ir.actions.act_windows dict
-
- """
- assert len(wizard_id) == 1, "Only one id expected"
- wizard_id = wizard_id[0]
-
- credit_line_model = self.pool['credit.control.line']
- ir_model = self.pool['ir.model.data']
- ui_act_model = self.pool['ir.actions.act_window']
- wizard = self.browse(cr, uid, wizard_id, context=context)
- controlling_date = fields.date.today()
- self._check_accounts_policies(
- cr,
- uid,
- wizard.move_line_ids,
- wizard.new_policy_id)
- self._mark_as_overridden(cr,
- uid,
- wizard.move_line_ids,
- context=context)
- # As disscused with business expert
- # draft lines should be passed to ignored
- # if same level as the new one
- # As it is a manual action
- # We also ignore rounding tolerance
- generated_ids = None
- generated_ids = credit_line_model.create_or_update_from_mv_lines(
- cr, uid, [],
- [x.id for x in wizard.move_line_ids],
- wizard.new_policy_level_id.id,
- controlling_date,
- check_tolerance=False,
- context=None
- )
- self._set_invoice_policy(cr, uid,
- wizard.move_line_ids,
- wizard.new_policy_id,
- context=context)
- if not generated_ids:
- return {}
- view_id = ir_model.get_object_reference(cr, uid,
- "account_credit_control",
- "credit_control_line_action")
- assert view_id, 'No view found'
- action = ui_act_model.read(cr, uid, view_id[1], context=context)
- action['domain'] = [('id', 'in', generated_ids)]
- return action
diff --git a/account_credit_control/wizard/credit_control_policy_changer_view.xml b/account_credit_control/wizard/credit_control_policy_changer_view.xml
deleted file mode 100644
index f65356ea0..000000000
--- a/account_credit_control/wizard/credit_control_policy_changer_view.xml
+++ /dev/null
@@ -1,65 +0,0 @@
-
-
-
-
- credit control policy form
- credit.control.policy.changer
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Change current credit policy
- credit.control.policy.changer
- account.invoice
- form
- form
-
- new
- Allows to manually change credit level
-
-
-
-
-
-
-
diff --git a/account_credit_control/wizard/credit_control_printer.py b/account_credit_control/wizard/credit_control_printer.py
deleted file mode 100644
index 028f18e1c..000000000
--- a/account_credit_control/wizard/credit_control_printer.py
+++ /dev/null
@@ -1,109 +0,0 @@
-# -*- coding: utf-8 -*-
-##############################################################################
-#
-# Author: Nicolas Bessi, Guewen Baconnier
-# Copyright 2012 Camptocamp SA
-#
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Affero General Public License as
-# published by the Free Software Foundation, either version 3 of the
-# License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Affero General Public License for more details.
-#
-# You should have received a copy of the GNU Affero General Public License
-# along with this program. If not, see .
-#
-##############################################################################
-import base64
-
-from openerp.osv import orm, fields
-from openerp.tools.translate import _
-
-
-class CreditControlPrinter(orm.TransientModel):
- """Print lines"""
-
- _name = "credit.control.printer"
- _rec_name = 'id'
- _description = 'Mass printer'
-
- def _get_line_ids(self, cr, uid, context=None):
- if context is None:
- context = {}
- res = False
- if context.get('active_model') != 'credit.control.line':
- return res
- res = context.get('active_ids', False)
- return res
-
- _columns = {
- 'mark_as_sent': fields.boolean('Mark letter lines as sent',
- help="Only letter lines will be marked."),
- 'report_file': fields.binary('Generated Report', readonly=True),
- 'report_name': fields.char('Report name'),
- 'state': fields.char('state', size=32),
- 'line_ids': fields.many2many(
- 'credit.control.line',
- string='Credit Control Lines'),
- }
-
- _defaults = {
- 'mark_as_sent': True,
- 'line_ids': _get_line_ids,
- }
-
- def _filter_line_ids(self, cr, uid, active_ids, context=None):
- """filter lines to use in the wizard"""
- line_obj = self.pool.get('credit.control.line')
- domain = [('state', '=', 'to_be_sent'),
- ('id', 'in', active_ids),
- ('channel', '=', 'letter')]
- return line_obj.search(cr, uid, domain, context=context)
-
- def _credit_line_predicate(self, cr, uid, line_record, context=None):
- return True
-
- def _get_line_ids(self, cr, uid, lines, predicate, context=None):
- return [l.id for l in lines if predicate(cr, uid, l, context)]
-
- def print_lines(self, cr, uid, wiz_id, context=None):
- assert not (isinstance(wiz_id, list) and len(wiz_id) > 1), \
- "wiz_id: only one id expected"
- comm_obj = self.pool.get('credit.control.communication')
- if isinstance(wiz_id, list):
- wiz_id = wiz_id[0]
- form = self.browse(cr, uid, wiz_id, context)
-
- if not form.line_ids and not form.print_all:
- raise orm.except_orm(_('Error'),
- _('No credit control lines selected.'))
-
- line_ids = self._get_line_ids(cr,
- uid,
- form.line_ids,
- self._credit_line_predicate,
- context=context)
-
- comms = comm_obj._generate_comm_from_credit_line_ids(cr, uid, line_ids,
- context=context)
- report_file = comm_obj._generate_report(cr, uid, comms, context=context)
-
- form.write({'report_file': base64.b64encode(report_file),
- 'report_name': 'credit_control_esr_bvr_%s.pdf' % fields.datetime.now(),
- 'state': 'done'})
-
- if form.mark_as_sent:
- comm_obj._mark_credit_line_as_sent(cr, uid, comms, context=context)
-
- return {'type': 'ir.actions.act_window',
- 'res_model': 'credit.control.printer',
- 'view_mode': 'form',
- 'view_type': 'form',
- 'res_id': form.id,
- 'views': [(False, 'form')],
- 'target': 'new',
- }
diff --git a/account_credit_control/wizard/credit_control_printer_view.xml b/account_credit_control/wizard/credit_control_printer_view.xml
deleted file mode 100644
index 68b67aa31..000000000
--- a/account_credit_control/wizard/credit_control_printer_view.xml
+++ /dev/null
@@ -1,62 +0,0 @@
-
-
-
-
- credit.line.printer.form
- credit.control.printer
- form
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Print Lines
- credit.control.printer
- credit.control.line
- form
- form
-
- new
- Print selected lines
-
-
-
-