mirror of
https://github.com/OCA/account-financial-tools.git
synced 2025-02-02 12:47:26 +02:00
Merge pull request #695 from Tecnativa/11.0-IMP-account-financial-tools-imp_ux
[IMP] account_credit_control: UX improvements
This commit is contained in:
@@ -20,6 +20,7 @@
|
||||
'data': [
|
||||
# Security
|
||||
"security/res_groups.xml",
|
||||
"security/account_security.xml",
|
||||
"security/ir.model.access.csv",
|
||||
|
||||
# Reports
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<!--Email template -->
|
||||
<record id="email_template_credit_control_base" model="mail.template">
|
||||
<field name="name">Credit Control Email</field>
|
||||
<field name="email_from">${object.partner_id.company_id.email or ''}</field>
|
||||
<field name="email_from">${user.company_id.email or ''}</field>
|
||||
<field name="subject">Credit Control:
|
||||
(${object.current_policy_level.name or 'n/a'})
|
||||
</field>
|
||||
|
||||
@@ -6,6 +6,8 @@ msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: Odoo Server 11.0\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2018-11-26 12:28+0000\n"
|
||||
"PO-Revision-Date: 2018-11-26 12:28+0000\n"
|
||||
"Last-Translator: <>\n"
|
||||
"Language-Team: \n"
|
||||
"MIME-Version: 1.0\n"
|
||||
@@ -39,6 +41,13 @@ msgid "\n"
|
||||
" "
|
||||
msgstr ""
|
||||
|
||||
#. module: account_credit_control
|
||||
#: model:ir.model.fields,field_description:account_credit_control.field_credit_control_run_credit_control_count
|
||||
#: model:ir.model.fields,field_description:account_credit_control.field_res_partner_credit_control_count
|
||||
#: model:ir.model.fields,field_description:account_credit_control.field_res_users_credit_control_count
|
||||
msgid "# of Credit Control Lines"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_credit_control
|
||||
#: model:credit.control.policy.level,name:account_credit_control.3_time_3
|
||||
msgid "10 days last reminder"
|
||||
@@ -76,7 +85,7 @@ msgid "A credit control line"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_credit_control
|
||||
#: code:addons/account_credit_control/models/credit_control_run.py:73
|
||||
#: code:addons/account_credit_control/models/credit_control_run.py:100
|
||||
#, python-format
|
||||
msgid "A credit control line more recent than %s exists at %s"
|
||||
msgstr ""
|
||||
@@ -87,13 +96,13 @@ msgid "A credit control policy level"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_credit_control
|
||||
#: code:addons/account_credit_control/models/credit_control_run.py:139
|
||||
#: code:addons/account_credit_control/models/credit_control_run.py:166
|
||||
#, python-format
|
||||
msgid "A credit control run is already running in background, please try later."
|
||||
msgstr ""
|
||||
|
||||
#. module: account_credit_control
|
||||
#: code:addons/account_credit_control/models/credit_control_run.py:66
|
||||
#: code:addons/account_credit_control/models/credit_control_run.py:93
|
||||
#, python-format
|
||||
msgid "A run has already been executed more recently than %s"
|
||||
msgstr ""
|
||||
@@ -126,6 +135,16 @@ msgstr ""
|
||||
msgid "An error has occured during the sending of the email."
|
||||
msgstr ""
|
||||
|
||||
#. module: account_credit_control
|
||||
#: model:ir.ui.view,arch_db:account_credit_control.credit_control_run_form
|
||||
msgid "Are you sure you want to run all ready lines channel action?"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_credit_control
|
||||
#: model:ir.ui.view,arch_db:account_credit_control.credit_control_run_form
|
||||
msgid "Are you sure you want to set all Draft lines as Ready To Send?"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_credit_control
|
||||
#: code:addons/account_credit_control/models/credit_control_policy.py:292
|
||||
#, python-format
|
||||
@@ -184,6 +203,7 @@ msgstr ""
|
||||
#: model:ir.model.fields,field_description:account_credit_control.field_credit_control_communication_company_id
|
||||
#: model:ir.model.fields,field_description:account_credit_control.field_credit_control_line_company_id
|
||||
#: model:ir.model.fields,field_description:account_credit_control.field_credit_control_policy_company_id
|
||||
#: model:ir.model.fields,field_description:account_credit_control.field_credit_control_run_company_id
|
||||
msgid "Company"
|
||||
msgstr ""
|
||||
|
||||
@@ -214,6 +234,11 @@ msgstr ""
|
||||
msgid "Control Credit Lines"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_credit_control
|
||||
#: model:ir.ui.view,arch_db:account_credit_control.credit_control_run_form
|
||||
msgid "Control Lines"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_credit_control
|
||||
#: model:ir.model.fields,field_description:account_credit_control.field_credit_control_run_date
|
||||
msgid "Controlling Date"
|
||||
@@ -255,6 +280,7 @@ msgstr ""
|
||||
#: model:ir.ui.menu,name:account_credit_control.base_credit_control_configuration_menu
|
||||
#: model:ir.ui.menu,name:account_credit_control.base_credit_control_menu
|
||||
#: model:ir.ui.view,arch_db:account_credit_control.invoice_followup_form_view
|
||||
#: model:ir.ui.view,arch_db:account_credit_control.partner_view_buttons
|
||||
#: model:ir.ui.view,arch_db:account_credit_control.res_config_settings_view_form
|
||||
msgid "Credit Control"
|
||||
msgstr ""
|
||||
@@ -264,8 +290,6 @@ msgstr ""
|
||||
#: model:ir.model.fields,field_description:account_credit_control.field_credit_control_emailer_line_ids
|
||||
#: model:ir.model.fields,field_description:account_credit_control.field_credit_control_marker_line_ids
|
||||
#: model:ir.model.fields,field_description:account_credit_control.field_credit_control_printer_line_ids
|
||||
#: model:ir.model.fields,field_description:account_credit_control.field_res_partner_credit_control_line_ids
|
||||
#: model:ir.model.fields,field_description:account_credit_control.field_res_users_credit_control_line_ids
|
||||
#: model:ir.ui.menu,name:account_credit_control.credit_control_line_action_menu
|
||||
#: model:ir.ui.view,arch_db:account_credit_control.invoice_followup_form_view
|
||||
msgid "Credit Control Lines"
|
||||
@@ -561,6 +585,11 @@ msgstr ""
|
||||
msgid "Group By"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_credit_control
|
||||
#: model:ir.model.fields,field_description:account_credit_control.field_credit_control_run_hide_change_state_button
|
||||
msgid "Hide Change State Button"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_credit_control
|
||||
#: model:ir.model.fields,field_description:account_credit_control.field_credit_control_communication_id
|
||||
#: model:ir.model.fields,field_description:account_credit_control.field_credit_control_emailer_id
|
||||
@@ -859,11 +888,6 @@ msgstr ""
|
||||
msgid "Only letter lines will be marked."
|
||||
msgstr ""
|
||||
|
||||
#. module: account_credit_control
|
||||
#: model:ir.ui.view,arch_db:account_credit_control.credit_control_run_form
|
||||
msgid "Open Credit Control Lines"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_credit_control
|
||||
#: model:ir.ui.view,arch_db:account_credit_control.report_credit_control_summary_document
|
||||
msgid "Open amount"
|
||||
@@ -1000,7 +1024,7 @@ msgid "Payment Note"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_credit_control
|
||||
#: code:addons/account_credit_control/models/credit_control_run.py:87
|
||||
#: code:addons/account_credit_control/models/credit_control_run.py:114
|
||||
#, python-format
|
||||
msgid "Please select a policy"
|
||||
msgstr ""
|
||||
@@ -1023,13 +1047,13 @@ msgid "Policy"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_credit_control
|
||||
#: code:addons/account_credit_control/models/credit_control_run.py:110
|
||||
#: code:addons/account_credit_control/models/credit_control_run.py:137
|
||||
#, python-format
|
||||
msgid "Policy \"<b>%s</b>\" has generated <b>%d Credit Control Lines.</b><br/>"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_credit_control
|
||||
#: code:addons/account_credit_control/models/credit_control_run.py:114
|
||||
#: code:addons/account_credit_control/models/credit_control_run.py:141
|
||||
#, python-format
|
||||
msgid "Policy \"<b>%s</b>\" has not generated any Credit Control Lines.<br/>"
|
||||
msgstr ""
|
||||
@@ -1100,11 +1124,29 @@ msgstr ""
|
||||
msgid "Report Date"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_credit_control
|
||||
#: model:ir.ui.view,arch_db:account_credit_control.credit_control_run_form
|
||||
msgid "Run channel action"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_credit_control
|
||||
#: model:ir.ui.view,arch_db:account_credit_control.credit_control_line_search
|
||||
msgid "Run date"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_credit_control
|
||||
#: model:ir.model.fields,field_description:account_credit_control.field_credit_control_line_partner_user_id
|
||||
#: model:ir.ui.view,arch_db:account_credit_control.credit_control_line_search
|
||||
msgid "Salesperson"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_credit_control
|
||||
#: code:addons/account_credit_control/models/credit_control_line.py:244
|
||||
#: model:ir.ui.view,arch_db:account_credit_control.credit_control_line_tree
|
||||
#, python-format
|
||||
msgid "Schedule activity"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_credit_control
|
||||
#: model:ir.actions.act_window,name:account_credit_control.open_credit_line_emailer_wizard
|
||||
#: model:ir.actions.act_window,name:account_credit_control.open_credit_line_emailer_wizard_menu_action
|
||||
@@ -1151,6 +1193,11 @@ msgstr ""
|
||||
msgid "Set new policy"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_credit_control
|
||||
#: model:ir.ui.view,arch_db:account_credit_control.credit_control_run_form
|
||||
msgid "Set to ready all"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_credit_control
|
||||
#: model:ir.model.fields,field_description:account_credit_control.field_credit_control_line_run_id
|
||||
msgid "Source"
|
||||
@@ -1264,7 +1311,7 @@ msgid "Warning: you will maybe not be able to revert this operation."
|
||||
msgstr ""
|
||||
|
||||
#. module: account_credit_control
|
||||
#: code:addons/account_credit_control/models/credit_control_line.py:194
|
||||
#: code:addons/account_credit_control/models/credit_control_line.py:216
|
||||
#, python-format
|
||||
msgid "You are not allowed to delete a credit control line that is not in draft state."
|
||||
msgstr ""
|
||||
|
||||
@@ -18,13 +18,18 @@ class CreditControlLine(models.Model):
|
||||
"""
|
||||
|
||||
_name = "credit.control.line"
|
||||
_inherit = ['mail.thread', 'mail.activity.mixin']
|
||||
_description = "A credit control line"
|
||||
_rec_name = "id"
|
||||
_order = "date DESC"
|
||||
|
||||
date = fields.Date(string='Controlling date',
|
||||
required=True,
|
||||
index=True)
|
||||
date = fields.Date(
|
||||
string='Controlling date',
|
||||
required=True,
|
||||
index=True,
|
||||
readonly=True,
|
||||
states={'draft': [('readonly', False)]},
|
||||
)
|
||||
# maturity date of related move line we do not use
|
||||
# a related field in order to
|
||||
# allow manual changes
|
||||
@@ -61,9 +66,13 @@ class CreditControlLine(models.Model):
|
||||
invoice_id = fields.Many2one('account.invoice',
|
||||
string='Invoice',
|
||||
readonly=True)
|
||||
partner_id = fields.Many2one('res.partner',
|
||||
string='Partner',
|
||||
required=True)
|
||||
partner_id = fields.Many2one(
|
||||
comodel_name='res.partner',
|
||||
string='Partner',
|
||||
required=True,
|
||||
readonly=True,
|
||||
states={'draft': [('readonly', False)]},
|
||||
)
|
||||
amount_due = fields.Float(string='Due Amount Tax incl.',
|
||||
required=True, readonly=True)
|
||||
balance_due = fields.Float(string='Due balance', required=True,
|
||||
@@ -103,6 +112,19 @@ class CreditControlLine(models.Model):
|
||||
run_id = fields.Many2one(comodel_name='credit.control.run',
|
||||
string='Source')
|
||||
manual_followup = fields.Boolean()
|
||||
partner_user_id = fields.Many2one(
|
||||
comodel_name='res.users',
|
||||
string="Salesperson",
|
||||
# Use compute instead of related because it raises access error if the
|
||||
# user is in other company even using related_sudo
|
||||
compute='_compute_partner_user_id',
|
||||
store=True,
|
||||
)
|
||||
|
||||
@api.depends('partner_id.user_id')
|
||||
def _compute_partner_user_id(self):
|
||||
for line in self:
|
||||
line.partner_user_id = line.partner_id.user_id
|
||||
|
||||
@api.model
|
||||
def _prepare_from_move_line(self, move_line, level, controlling_date,
|
||||
@@ -194,7 +216,6 @@ class CreditControlLine(models.Model):
|
||||
_('You are not allowed to delete a credit control '
|
||||
'line that is not in draft state.')
|
||||
)
|
||||
|
||||
return super(CreditControlLine, self).unlink()
|
||||
|
||||
@api.multi
|
||||
@@ -211,3 +232,31 @@ class CreditControlLine(models.Model):
|
||||
line = super(CreditControlLine, self).create(values)
|
||||
line.manual_followup = line.partner_id.manual_followup
|
||||
return line
|
||||
|
||||
def button_schedule_activity(self):
|
||||
ctx = self.env.context.copy()
|
||||
ctx.update({
|
||||
'default_res_id': self.ids[0],
|
||||
'default_res_model': self._name,
|
||||
})
|
||||
return {
|
||||
'type': 'ir.actions.act_window',
|
||||
'name': _("Schedule activity"),
|
||||
'res_model': 'mail.activity',
|
||||
'view_type': 'form',
|
||||
'view_mode': 'form',
|
||||
'res_id': self.activity_ids and self.activity_ids.ids[0] or False,
|
||||
'views': [[False, 'form']],
|
||||
'context': ctx,
|
||||
'target': 'new',
|
||||
}
|
||||
|
||||
def button_credit_control_line_form(self):
|
||||
self.ensure_one()
|
||||
action = self.env.ref(
|
||||
'account_credit_control.credit_control_line_action')
|
||||
form = self.env.ref('account_credit_control.credit_control_line_form')
|
||||
action = action.read()[0]
|
||||
action['views'] = [(form.id, 'form')]
|
||||
action['res_id'] = self.id
|
||||
return action
|
||||
|
||||
@@ -53,6 +53,29 @@ class CreditControlRun(models.Model):
|
||||
readonly=True,
|
||||
copy=False,
|
||||
)
|
||||
credit_control_count = fields.Integer(
|
||||
compute='_compute_credit_control_count',
|
||||
string='# of Credit Control Lines',
|
||||
)
|
||||
hide_change_state_button = fields.Boolean()
|
||||
company_id = fields.Many2one(
|
||||
comodel_name='res.company',
|
||||
string='Company',
|
||||
default=lambda self: self.env['res.company']._company_default_get(
|
||||
'account.account'),
|
||||
index=True,
|
||||
)
|
||||
|
||||
def _compute_credit_control_count(self):
|
||||
fetch_data = self.env['credit.control.line'].read_group(
|
||||
domain=[('run_id', 'in', self.ids)],
|
||||
fields=['run_id'],
|
||||
groupby=['run_id'],
|
||||
)
|
||||
result = {data['run_id'][0]: data['run_id_count']
|
||||
for data in fetch_data}
|
||||
for rec in self:
|
||||
rec.credit_control_count = result.get(rec.id, 0)
|
||||
|
||||
@api.model
|
||||
def _check_run_date(self, controlling_date):
|
||||
@@ -60,8 +83,12 @@ class CreditControlRun(models.Model):
|
||||
using controlling_date
|
||||
|
||||
"""
|
||||
runs = self.search([('date', '>', controlling_date)],
|
||||
order='date DESC', limit=1)
|
||||
runs = self.search(
|
||||
[('date', '>', controlling_date),
|
||||
('company_id', '=', self.env.user.company_id.id)],
|
||||
order='date DESC',
|
||||
limit=1,
|
||||
)
|
||||
if runs:
|
||||
raise UserError(_('A run has already been executed more '
|
||||
'recently than %s') % (runs.date))
|
||||
@@ -142,7 +169,11 @@ class CreditControlRun(models.Model):
|
||||
self._generate_credit_lines()
|
||||
return True
|
||||
|
||||
@api.multi
|
||||
def unlink(self):
|
||||
# Ondelete cascade don't check unlink lines restriction
|
||||
self.mapped('line_ids').unlink()
|
||||
return super().unlink()
|
||||
|
||||
def open_credit_lines(self):
|
||||
""" Open the generated lines """
|
||||
self.ensure_one()
|
||||
@@ -151,3 +182,35 @@ class CreditControlRun(models.Model):
|
||||
action = action.read()[0]
|
||||
action['domain'] = [('id', 'in', self.line_ids.ids)]
|
||||
return action
|
||||
|
||||
def set_to_ready_lines(self):
|
||||
self.ensure_one()
|
||||
draft_lines = self.line_ids.filtered(lambda x: x.state == 'draft')
|
||||
draft_lines.write({'state': 'to_be_sent'})
|
||||
self.hide_change_state_button = True
|
||||
# if not draft_lines:
|
||||
# raise UserError(_('No lines in draft state'))
|
||||
# action_name = ('account_credit_control'
|
||||
# '.open_credit_line_marker_wizard_menu_action')
|
||||
# action = self.env.ref(action_name)
|
||||
# action = action.read()[0]
|
||||
# action['context'] = {
|
||||
# 'active_model': 'credit.control.line',
|
||||
# 'active_ids': draft_lines.ids,
|
||||
# }
|
||||
# return action
|
||||
|
||||
def run_channel_action(self):
|
||||
self.ensure_one()
|
||||
lines = self.line_ids.filtered(lambda x: x.state == 'to_be_sent')
|
||||
letter_lines = lines.filtered(lambda x: x.channel == 'letter')
|
||||
email_lines = lines.filtered(lambda x: x.channel == 'email')
|
||||
if email_lines:
|
||||
comm_obj = self.env['credit.control.communication']
|
||||
comms = comm_obj._generate_comm_from_credit_lines(email_lines)
|
||||
comms._generate_emails()
|
||||
if letter_lines:
|
||||
wiz = self.env['credit.control.printer'].create({
|
||||
'line_ids': letter_lines.ids,
|
||||
})
|
||||
return wiz.print_lines
|
||||
|
||||
@@ -21,10 +21,10 @@ class ResPartner(models.Model):
|
||||
"invoice. If nothing is defined, it will use "
|
||||
"the company setting.",
|
||||
)
|
||||
credit_control_line_ids = fields.One2many('credit.control.line',
|
||||
'invoice_id',
|
||||
string='Credit Control Lines',
|
||||
readonly=True)
|
||||
credit_control_count = fields.Integer(
|
||||
compute='_compute_credit_control_count',
|
||||
string='# of Credit Control Lines',
|
||||
)
|
||||
payment_responsible_id = fields.Many2one(
|
||||
comodel_name='res.users',
|
||||
ondelete='set null',
|
||||
@@ -49,6 +49,18 @@ class ResPartner(models.Model):
|
||||
)
|
||||
manual_followup = fields.Boolean()
|
||||
|
||||
def _compute_credit_control_count(self):
|
||||
partners = self.filtered(lambda x: not x.parent_id)
|
||||
fetch_data = self.env['credit.control.line'].read_group(
|
||||
domain=[('partner_id', 'in', partners.ids)],
|
||||
fields=['partner_id'],
|
||||
groupby=['partner_id'],
|
||||
)
|
||||
result = {data['partner_id'][0]: data['partner_id_count']
|
||||
for data in fetch_data}
|
||||
for partner in self:
|
||||
partner.credit_control_count = result.get(partner.id, 0)
|
||||
|
||||
@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 """
|
||||
|
||||
41
account_credit_control/security/account_security.xml
Normal file
41
account_credit_control/security/account_security.xml
Normal file
@@ -0,0 +1,41 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<odoo>
|
||||
<data noupdate="0">
|
||||
<record id="category_credit_control" model="ir.module.category">
|
||||
<field name="name">Credit Control</field>
|
||||
<field name="sequence" eval="99" />
|
||||
</record>
|
||||
|
||||
<record id="group_account_credit_control_info" model="res.groups" context="{'noadmin':True}">
|
||||
<field name="name">Info</field>
|
||||
<field name="category_id" ref="category_credit_control"/>
|
||||
</record>
|
||||
|
||||
<record id="group_account_credit_control_user" model="res.groups" context="{'noadmin':True}">
|
||||
<field name="name">User</field>
|
||||
<field name="category_id" ref="category_credit_control"/>
|
||||
<field name="implied_ids" eval="[(4, ref('group_account_credit_control_info'))]"/>
|
||||
</record>
|
||||
|
||||
<record id="group_account_credit_control_manager" model="res.groups">
|
||||
<field name="name">Manager</field>
|
||||
<field name="category_id" ref="category_credit_control"/>
|
||||
<field name="implied_ids" eval="[(4, ref('group_account_credit_control_user'))]"/>
|
||||
</record>
|
||||
</data>
|
||||
|
||||
<data noupdate="1">
|
||||
<record id="credit_control_run_rule" model="ir.rule">
|
||||
<field name="name">Credit Control Run</field>
|
||||
<field name="model_id" ref="model_credit_control_run"/>
|
||||
<field name="global" eval="True"/>
|
||||
<field name="domain_force">['|',('company_id','=',False),('company_id','child_of',[user.company_id.id])]</field>
|
||||
</record>
|
||||
<record id="credit_control_line_rule" model="ir.rule">
|
||||
<field name="name">Credit Control Line</field>
|
||||
<field name="model_id" ref="model_credit_control_line"/>
|
||||
<field name="global" eval="True"/>
|
||||
<field name="domain_force">['|',('company_id','=',False),('company_id','child_of',[user.company_id.id])]</field>
|
||||
</record>
|
||||
</data>
|
||||
</odoo>
|
||||
@@ -39,6 +39,11 @@
|
||||
</group>
|
||||
</group>
|
||||
</sheet>
|
||||
<div class="oe_chatter">
|
||||
<field name="message_follower_ids" widget="mail_followers"/>
|
||||
<field name="activity_ids" widget="mail_activity"/>
|
||||
<field name="message_ids" widget="mail_thread"/>
|
||||
</div>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
@@ -54,6 +59,7 @@
|
||||
<field name="policy_id"/>
|
||||
<separator />
|
||||
<field name="partner_id"/>
|
||||
<field name="partner_user_id"/>
|
||||
<field name="account_id"/>
|
||||
<field name="invoice_id"/>
|
||||
<field name="level"/>
|
||||
@@ -85,7 +91,7 @@
|
||||
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)]"
|
||||
domain="[('manual_followup', '=', True)]"
|
||||
help="The partner had a manual followup."/>
|
||||
</group>
|
||||
<group expand="0" string="Group By" name="group_by">
|
||||
@@ -113,6 +119,7 @@
|
||||
<filter domain='[]'
|
||||
context="{'group_by': 'manual_followup'}"
|
||||
icon="terp-document-new" string="Manual followup"/>
|
||||
<filter string="Salesperson" context="{'group_by':'partner_user_id'}"/>
|
||||
</group>
|
||||
</search>
|
||||
</field>
|
||||
@@ -122,9 +129,12 @@
|
||||
<field name="name">credit.control.line.tree</field>
|
||||
<field name="model">credit.control.line</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree editable="bottom" string="Control Credit Lines"
|
||||
<tree string="Control Credit Lines" editable="bottom"
|
||||
decoration-danger="state in ('error', 'email_error')"
|
||||
decoration-muted="state == 'ignored'"
|
||||
decoration-success="state == 'sent'">
|
||||
<button name="button_credit_control_line_form"
|
||||
type="object" icon="fa-external-link" class="oe_stat_button"/>
|
||||
<field name="date"/>
|
||||
<field name="date_due"/>
|
||||
<field name="level"/>
|
||||
@@ -142,6 +152,10 @@
|
||||
<field name="policy_level_id"/>
|
||||
<field name="policy_id"/>
|
||||
<field name="mail_message_id"/>
|
||||
<field name="activity_date_deadline"/>
|
||||
<button name="button_schedule_activity" type="object"
|
||||
string="Schedule activity" icon="fa fa-clock-o"/>
|
||||
<field name="activity_summary"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
@@ -22,16 +22,27 @@
|
||||
class="oe_highlight"
|
||||
type="object" icon="fa-cogs"
|
||||
attrs="{'invisible': [('state', '!=', 'draft')]}"/>
|
||||
<button name="open_credit_lines"
|
||||
string="Open Credit Control Lines"
|
||||
type="object"
|
||||
<button name="set_to_ready_lines" type="object"
|
||||
string="Set to ready all"
|
||||
confirm="Are you sure you want to set all Draft lines as Ready To Send?"
|
||||
attrs="{'invisible': ['|', ('hide_change_state_button', '=', True), ('state', '=', 'draft')]}"/>
|
||||
<button name="run_channel_action" type="object"
|
||||
string="Run channel action"
|
||||
confirm="Are you sure you want to run all ready lines channel action?"
|
||||
attrs="{'invisible': [('state', '=', 'draft')]}"/>
|
||||
<field name="state" widget="statusbar"
|
||||
statusbar_visible="draft,done"/>
|
||||
</header>
|
||||
<sheet>
|
||||
<div class="oe_button_box" name="button_box">
|
||||
<button class="oe_stat_button" type="object" name="open_credit_lines"
|
||||
icon="fa-tasks" attrs="{'invisible': [('state', '=', 'draft')]}">
|
||||
<field string="Control Lines" name="credit_control_count" widget="statinfo"/>
|
||||
</button>
|
||||
</div>
|
||||
<group>
|
||||
<field name="date"/>
|
||||
<field name="hide_change_state_button" invisible="1"/>
|
||||
</group>
|
||||
<notebook>
|
||||
<page string="Policies">
|
||||
|
||||
@@ -1,5 +1,26 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<odoo>
|
||||
<act_window
|
||||
id="act_partner_credit_relation_relation"
|
||||
name="Credit Lines"
|
||||
groups="account_credit_control.group_account_credit_control_manager,account_credit_control.group_account_credit_control_user"
|
||||
domain="[('partner_id', '=', active_id)]"
|
||||
res_model="credit.control.line"
|
||||
src_model="res.partner"/>
|
||||
<record id="partner_view_buttons" model="ir.ui.view">
|
||||
<field name="model">res.partner</field>
|
||||
<field name="inherit_id" ref="account.partner_view_buttons"/>
|
||||
<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">
|
||||
<button name="action_view_partner_invoices" position="after">
|
||||
<button class="oe_stat_button" type="action" name="%(act_partner_credit_relation_relation)d"
|
||||
context="{'search_default_partner_id': active_id, 'default_partner_id': active_id}" attrs="{'invisible': [('credit_control_count', '=', 0)]}"
|
||||
icon="fa-tasks">
|
||||
<field string="Credit Control" name="credit_control_count" widget="statinfo"/>
|
||||
</button>
|
||||
</button>
|
||||
</field>
|
||||
</record>
|
||||
<record id="partner_followup_form_view" model="ir.ui.view">
|
||||
<field name="name">partner.credit_control.form.view</field>
|
||||
<field name="model">res.partner</field>
|
||||
@@ -18,13 +39,6 @@
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<act_window
|
||||
id="act_partner_credit_relation_relation"
|
||||
name="Credit Lines"
|
||||
groups="account_credit_control.group_account_credit_control_manager,account_credit_control.group_account_credit_control_user"
|
||||
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>
|
||||
|
||||
Reference in New Issue
Block a user