[IMP] account_credit_control: add account_followup features

* Update translations
* Relocate credit control menu
* Improve partner followup info
* Add manual followup
This commit is contained in:
cubells
2017-11-08 11:27:25 +01:00
parent 8454635670
commit a7376bd24d
7 changed files with 580 additions and 1536 deletions

View File

@@ -1,5 +1,5 @@
.. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:target: https://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3
==============
@@ -64,7 +64,8 @@ Contributors
* Nicolas Bessi (Camptocamp)
* Guewen Baconnier (Camptocamp)
* Sylvain Van Hoof (Okia SPRL) <sylvain@okia.be>
* Akim Juillerat (Camptocamp <akim.juillerat@camptocamp.com>
* Akim Juillerat (Camptocamp) <akim.juillerat@camptocamp.com>
* Vicent Cubells (Tecnativa) <vicent.cubells@tecnativa.com>
Maintainer
----------

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -125,6 +125,8 @@ class CreditControlLine(models.Model):
run_id = fields.Many2one(comodel_name='credit.control.run',
string='Source')
manual_followup = fields.Boolean(string='Manual Followup')
@api.model
def _prepare_from_move_line(self, move_line, level, controlling_date,
open_amount):
@@ -216,3 +218,18 @@ class CreditControlLine(models.Model):
)
return super(CreditControlLine, self).unlink()
@api.multi
def write(self, values):
res = super(CreditControlLine, self).write(values)
if 'manual_followup' in values:
self.partner_id.write({
'manual_followup': values.get('manual_followup'),
})
return res
@api.model
def create(self, values):
line = super(CreditControlLine, self).create(values)
line.manual_followup = line.partner_id.manual_followup
return line

View File

@@ -26,11 +26,37 @@ class ResPartner(models.Model):
'invoice_id',
string='Credit Control Lines',
readonly=True)
payment_responsible_id = fields.Many2one(
comodel_name='res.users',
ondelete='set null',
string='Follow-up Responsible',
help="Optionally you can assign a user to this field, "
"which will make him responsible for the action.",
track_visibility="onchange",
)
payment_note = fields.Text(
string='Customer Payment Promise',
help="Payment Note",
track_visibility="onchange",
)
payment_next_action = fields.Text(
string='Next Action',
help="This is the next action to be taken.",
track_visibility="onchange",
)
payment_next_action_date = fields.Date(
string='Next Action Date',
help="This is when the manual follow-up is needed.",
)
manual_followup = fields.Boolean(
string='Manual Followup',
)
@api.constrains('credit_policy_id', 'property_account_receivable_id')
def _check_credit_policy(self):
""" Ensure that policy on partner are limited to the account policy """
for partner in self:
# sudo needed for those w/o permission that duplicate records
for partner in self.sudo():
if (not partner.property_account_receivable_id or
not partner.credit_policy_id):
continue

View File

@@ -84,6 +84,10 @@
string="Manual change"
domain="[('manually_overridden', '=', True)]"
help="The line was deprecated by a manual change of policy on invoice."/>
<filter name="filter_manual" icon="fa-hand-paper-o"
string="Manual followup"
domain="[('manually_followup', '=', True)]"
help="The partner had a manual followup."/>
</group>
<group expand="0" string="Group By" name="group_by">
<filter domain='[]' context="{'group_by': 'date'}"
@@ -107,6 +111,9 @@
<filter domain='[]'
context="{'group_by': 'manually_overridden'}"
icon="terp-document-new" string="Manual change"/>
<filter domain='[]'
context="{'group_by': 'manual_followup'}"
icon="terp-document-new" string="Manual followup"/>
</group>
</search>
</field>
@@ -126,6 +133,7 @@
<field name="channel"/>
<field name="invoice_id"/>
<field name="partner_id"/>
<field name="manual_followup"/>
<field name="amount_due"/>
<field name="balance_due"/>
<field name="currency_id"/>
@@ -140,8 +148,8 @@
<menuitem
name="Credit Control"
parent="account.menu_finance_entries"
id="base_credit_control_menu" sequence="10"
parent="account.menu_finance"
id="base_credit_control_menu" sequence="4"
groups="account_credit_control.group_account_credit_control_manager,account_credit_control.group_account_credit_control_user,account_credit_control.group_account_credit_control_info"/>
<record model="ir.actions.act_window" id="credit_control_line_action">
@@ -167,5 +175,4 @@
id="credit_control_line_action_menu"
/>
</odoo>

View File

@@ -6,9 +6,15 @@
<field name="inherit_id" ref="account.view_partner_property_form"/>
<field name="groups_id" eval="[(4, ref('account_credit_control.group_account_credit_control_manager')), (4, ref('account_credit_control.group_account_credit_control_user'))]"/>
<field name="arch" type="xml">
<field name="credit" position="after">
<field name="credit_policy_id" widget="selection"/>
</field>
<xpath expr="//group[@name='accounting_entries']" position="after">
<group string="Follow-up" name="followup">
<field name="credit_policy_id" widget="selection"/>
<field name="payment_responsible_id"/>
<field name="payment_note"/>
<field name="payment_next_action"/>
<field name="payment_next_action_date"/>
</group>
</xpath>
</field>
</record>
@@ -19,5 +25,41 @@
domain="[('partner_id', '=', active_id)]"
res_model="credit.control.line"
src_model="res.partner"/>
<record id="customer_followup_tree" model="ir.ui.view">
<field name="name">res.partner.followup.inherit.tree</field>
<field name="model">res.partner</field>
<field name="priority" eval="20"/>
<field name="groups_id" eval="[(4, ref('account_credit_control.group_account_credit_control_manager')), (4, ref('account_credit_control.group_account_credit_control_user'))]"/>
<field name="arch" type="xml">
<tree string="Customer Followup" create="false" delete="false">
<field name="display_name"/>
<field name="payment_next_action_date"/>
<field name="payment_next_action"/>
<field name="payment_responsible_id"/>
<field name="payment_note"/>
</tree>
</field>
</record>
<record id="action_customer_followup" model="ir.actions.act_window">
<field name="name">Manual Follow-Ups</field>
<field name="view_id" ref="customer_followup_tree"/>
<field name="res_model">res.partner</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
<field name="domain">[('manual_followup', '=', True)]</field>
<field name="context">{}</field>
</record>
<record id="action_view_customer_followup_tree" model="ir.actions.act_window.view">
<field name="sequence" eval="1"/>
<field name="view_mode">tree</field>
<field name="view_id" ref="customer_followup_tree"/>
<field name="act_window_id" ref="action_customer_followup"/>
</record>
<menuitem
name="Do Manual Follow-Ups"
parent="base_credit_control_menu"
action="action_customer_followup"
sequence="30"
id="credit_control_manual_action_menu"/>
</odoo>