[IMP] kanban view, greys, first tab context

bzr revid: jco@openerp.com-20121116161437-pdjig82ybpxda184
This commit is contained in:
Josse Colpaert 2012-11-16 17:14:37 +01:00
parent 863b991fb4
commit 5f6255c970
8 changed files with 201 additions and 176 deletions

View File

@ -23,7 +23,8 @@ from osv import fields, osv
from datetime import date
import time
import datetime
from lxml import etree
from copy import deepcopy
from tools.translate import _
@ -77,6 +78,7 @@ class followup_line(osv.osv):
_defaults = {
'send_email': True,
'send_letter': False,
'manual_action':False,
'description': """
Dear %(partner_name)s,
@ -122,6 +124,11 @@ followup_line()
class account_move_line(osv.osv):
def set_kanban_state_litigation(self, cr, uid, ids, context=None):
for l in self.browse(cr, uid, ids, context):
self.write(cr, uid, [l.id], {'blocked': not l.blocked})
return False
def _get_result(self, cr, uid, ids, name, arg, context=None):
res = {}
for aml in self.browse(cr, uid, ids, context):
@ -155,11 +162,29 @@ email_template()
class res_partner(osv.osv):
def fields_view_get(self, cr, uid, view_id=None, view_type=None, context=None, toolbar=False, submenu=False):
res = super(res_partner, self).fields_view_get(cr, uid, view_id=view_id, view_type=view_type, context=context,
toolbar=toolbar, submenu=submenu)
if context:
for l in context:
print l, context[l]
if view_type == 'form' and context and 'search_default_todo' in context.keys():
doc = etree.XML(res['arch'], parser=None, base_url=None)
first_node = doc.xpath("//page[@string='Payments Follow-up']")
first_node[0].set("position", "left")
first_node[0].getparent().append(first_node[0])
root = first_node[0].getparent()
root[0]= root[-1]
res['arch'] = etree.tostring(doc)
return res
def _get_latest_followup_date(self, cr, uid, ids, name, arg, context=None):
res = {}
for partner in self.browse(cr, uid, ids, context):
amls = partner.accountmoveline_ids
res[partner.id] = max([x.followup_date for x in amls]) if len(amls) else False
res[partner.id] = max([x.followup_date for x in amls]) if len(amls) else False
return res
@ -167,6 +192,8 @@ class res_partner(osv.osv):
res = {}
for partner in self.browse(cr, uid, ids, context):
amls = partner.accountmoveline_ids
level_id = 0
level_days = False
latest_level = False
@ -188,16 +215,14 @@ class res_partner(osv.osv):
latest_date = False
latest_level = False
latest_level_without_lit = False
latest_days_without_lit = False
for aml in amls:
if latest_date == False:
latest_date = aml.followup_date
latest_level = aml.followup_line_id.id
latest_days = aml.followup_line_id.delay
if not aml.blocked:
latest_level_without_lit = latest_level
latest_days_without_lit = latest_days
if latest_date and latest_level:
if aml.followup_date > latest_date:
latest_date = aml.followup_date
@ -206,7 +231,6 @@ class res_partner(osv.osv):
latest_level = aml.followup_line_id.id
if not aml.blocked:
latest_level_without_lit = latest_level
latest_days_without_lit = latest_days
res[partner.id] = {'latest_followup_date': latest_date,
'latest_followup_level_id': latest_level,
'latest_followup_level_id_without_lit': latest_level_without_lit}
@ -369,6 +393,14 @@ class res_partner(osv.osv):
partnerlist.append(aml.partner_id.id)
return partnerlist
def _get_aml_storeids2(self, cr, uid, ids, context=None):
partnerlist = []
for aml in self.pool.get("account.move.line").browse(cr, uid, ids, context):
if aml.partner_id not in partnerlist:
partnerlist.append(aml.partner_id.id)
return partnerlist
def _search_amount(self, cr, uid, obj, name, args, context):
ids = set()
@ -421,9 +453,10 @@ class res_partner(osv.osv):
string="Next Level", help="The next follow-up level to come when the customer still refuses to pay",
store={'account.move.line': (_get_aml_storeids, ['followup_line_id', 'followup_date'], 10)}),
'payment_amount_overdue':fields.function(_get_amount_overdue, method=True, type='float', string="Amount Overdue",
help="Amount Overdue: The amount the customer should already have paid",
store={'account.move.line': (_get_aml_storeids, ['debit', 'credit'], 10)},
help="Amount Overdue: The amount the customer owns us",
store={'account.move.line': (_get_aml_storeids2, ['followup_line_id', 'followup_date', 'debit', 'credit', 'invoice'], 10)},
),
}
res_partner()

View File

@ -4,67 +4,9 @@
<!-- followup of customers views
-->
<!-- Was specific view, not used anymore -->
<record id="customer_followup_formgone" model="ir.ui.view">
<field name="name">eee</field>
<field name="model">res.partner</field>
<field name="type">form</field>
<field name="priority" eval="20"/>
<field name="arch" type="xml">
<form string="Customer FollowUp form" version="7.0">
<group>
<field name="name"/>
<field name="phone" />
<!--<field name="sales" readonly="True"/>-->
</group>
<separator string="Detail of accounts" />
<group>
<field name="accountmoveline_ids" nolabel="1" > <!--domain="[('reconcile_id', '=', False)]" not necessary-->
<tree string="Account Move line" editable="bottom">
<field name="date" readonly="True"/>
<!--<field name="move_id" readonly="True"/>-->
<field name="ref" readonly="True"/>
<field name="debit" readonly="True"/>
<field name="credit" readonly="True"/>
<field name="followup_date" readonly="True"/>
<field name="followup_line_id" readonly="True"/>
<field name="blocked" string="Litigation"/>
<field name="payment_commitment"/>
<field name="payment_date"/>
<!--<field name="reconcile_id" invisible="True"/>-->
<field name="reconcile_partial_id" readonly="True"/>
<field name="invoice"/>
</tree>
</field>
</group>
<newline/>
<group>
<separator string="Actions to be taken"/>
<newline/>
<group>
<field name="payment_next_action" help="Describes agreement with the client"/>
<button name="action_done" type="object" string="Follow-up Action Done" class="oe_highlight" help="This button will clear the action and the action date. "/>
</group>
<group>
<field name="payment_responsible_id" help="The user who takes responsibility to follow it up. "/>
<field name="payment_next_action_date"/>
</group>
</group>
<separator string="Payment Followup Remarks"/>
<newline/>
<group>
<field name="payment_note"/>
<!--<field name="payment_followup_level_id"/>-->
<field name="latest_followup_level_id"/>
<field name="latest_followup_date"/>
<field name="next_followup_level_id"/>
</group>
</form>
</field>
</record>
<record id="customer_followup_tree" model="ir.ui.view">
<field name="name">ddd</field>
<field name="model">res.partner</field>
@ -98,7 +40,7 @@
<field name="name">Search</field>
<field name="model">res.partner</field>
<field name="type">search</field>
<field name="inherit_id" ref="base.view_res_partner_filter"/>
<field name="inherits_id" ref="base.view_res_partner_filter"/>
<field name="arch" type="xml">
<search string="Search Partner" position="inside">
@ -115,7 +57,7 @@
<filter string="No Responsible" domain="[('payment_responsible_id', '=', False)]"/>
<filter string="My Follow-ups" domain="[('payment_responsible_id','=', uid)]"/>
</group>
<group expand="1" string="Group by">
<group expand="1" string="Group By...">
<filter string="Responsible" context="{'group_by':'payment_responsible_id'}"/>
</group>
</search>
@ -172,33 +114,41 @@
<field name="name">res.partner.followup.form.inherit</field>
<field name="inherit_id" ref="base.view_partner_form"/>
<field name="model">res.partner</field>
<field eval="[(4, ref('account.group_account_user'))]" name="groups_id"/><!-- or user? -->
<!--<field eval="[(4, ref('account.group_account_user'))]" name="groups_id"/>--><!-- or user? -->
<field name="arch" type="xml" >
<div name="buttons" position="inside">
<button name="do_button_print" type="object" string="Print Overdue Payments Report" help="Print overdue payments report independent of follow-up line" attrs="{'invisible':[('payment_amount_overdue', '&lt;=', 0.0)]}" eval="[(4, ref('account.group_account_user'))]"/>
<button name="do_button_mail" type="object" string="Send Overdue Email" help="If not specified by the latest follow-up level, it will send from the default follow-up of overdue invoices template" attrs="{'invisible':[('payment_amount_overdue', '&lt;=', 0.0)]}" eval="[(4, ref('account.group_account_user'))]"/>
<button name="do_button_print" type="object" string="Print Overdue Payments" groups="account.group_account_user" help="Print overdue payments report independent of follow-up line" attrs="{'invisible':[('payment_amount_overdue', '&lt;=', 0.0)]}" />
<button name="do_button_mail" type="object" string="Send Overdue Email" groups="account.group_account_user" help="If not specified by the latest follow-up level, it will send from the default follow-up of overdue invoices template" attrs="{'invisible':[('payment_amount_overdue', '&lt;=', 0.0)]}"/>
</div>
<page string="Accounting" position="before" version="7.0">
<page string="Payments Follow-up" position="inside" groups="account.group_account_user">
<div class = "oe_inline">
<p attrs="{'invisible':[('latest_followup_date','=', False)]}" class="oe_inline">The <field name="latest_followup_date" />, the latest level that was executed, was <field name="latest_followup_level_id" class="oe_inline"/>.
He still owns us a total amount of <field name="payment_amount_overdue"/>
</p>
<p class="oe_inline" attrs="{'invisible':[('payment_amount_overdue', '&lt;=', 0.0)]}">The partner owns us <field name="payment_amount_overdue" class="oe_inline"/>
</p>
<p attrs="{'invisible':[('payment_next_action', '=', False)]}">This is the action required now:</p>
<!--<p attrs="{'invisible':[('payment_next_action', '=', False)]}">This is the action required now:</p>-->
</div>
<p class="oe_inline">
<label for="payment_next_action" string="Next Follow-up Action"/>
<field name="payment_next_action_date" nolabel="1"/> <label string="-" attrs="{'invisible': ['|', ('payment_next_action_date', '=', False), ('payment_next_action', '=', False)]}"/>
<field name="payment_next_action" class="oe_inline" nolabel="1" placeholder="e.g. Give a phonecall, Check if he paid, ..."/>
<field name="payment_responsible_id" help="The user who takes responsibility to follow it up. " class="oe_inline"/>
<button name="action_done" type="object" string="Follow-up Action Done" help="This button will clear the action and the action date. "/>
<field name="payment_next_action" class="oe_inline" nolabel="1" string="Next Follow-up action" placeholder="e.g. Give a phonecall, Check if he paid, ..."/>
<span attrs="{'invisible':[('payment_responsible_id', '=', False)]}"> to be done by: </span> <field name="payment_responsible_id" placeholder="The user responsible for taking this action e.g. sales" class="oe_inline"/>
<span attrs="{'invisible':['|', ('payment_next_action_date', '!=', False), '|', ('payment_responsible_id', '!=', False), ('payment_next_action', '!=', False)]}">No action defined right now. </span>
<br/>
<button name="action_done" type="object" string="&#8627; Mark as Done"
help="This button will clear the action, the action date and the responsible. " class="oe_link"
attrs="{'invisible':['&amp;',('payment_next_action_date','=', False), '&amp;', ('payment_responsible_id','=', False), ('payment_next_action', '=', False)]}" />
</p>
<!--attrs="{'invisible':['&amp;',('payment_next_action_date','=', False), '&amp;', ('payment_responsible_id','=', False), ('payment_next_action', '=', False)]}"-->
<group>
<field name="payment_note" string="The customer promised:"/>
</group>
<p class="oe_grey"> <!--maybe only when accountmovelines empty-->
By clicking on BLUBS, you can put an invoice as litigation. This means you are still in discussion about it
By clicking on the light bulb, you can put an invoice as litigation. This means you are still in discussion about it and it
won't be taken into account for going to the next follow-up level.
</p>
<group>
<field name="accountmoveline_ids" nolabel="1" context="{'default_partner_id': active_id}" mode="kanban">
<!--<tree string="Account Move line" editable="bottom" colors="red:date_maturity and date_maturity&lt;current_date or date&lt;current_date">
@ -209,39 +159,34 @@
<field name="reconcile_partial_id" readonly="True"/>
<field name="result" readonly="True"/>
</tree>-->
<kanban default_group_by="followup_line_id">
<kanban default_group_by="followup_line_id" create="false">
<field name="followup_line_id"/>
<field name="result"/>
<field name="date_maturity"/>
<field name="blocked"/>
<field name="partner_id"/>
<field name="ref"/>
<field name="invoice"/>
<templates>
<t t-name="kanban-box">
<div t-attf-class="oe_kanban_card oe_kanban_project oe_kanban_global_click">
<div class="oe_dropdown_toggle oe_dropdown_kanban">
<span class="oe_e">í</span>
<ul class="oe_dropdown_menu">
<t t-if="widget.view.is_action_enabled('edit')"><li><a type="edit">Account move line d</a></li></t>
<t t-if="widget.view.is_action_enabled('delete')"><li><a type="delete">Delete</a></li></t>
</ul>
</div>
<div class="oe_kanban_content">
<h4><field name="ref"/></h4><field name="followup_line_id"/>
<div class="oe_kanban_footer_left">
<span t-if="record.date_maturity.raw_value">
<span class="oe_e">N</span>
<field name="date_maturity"/>
<field name="followup_date"/>
</span>
</div>
</div>
</div>
<!--<a t-if="! read_only_mode" type="delete" style="position: absolute; right: 0; padding: 4px; diplay: inline-block">X</a>-->
<div class="oe_module_vignette oe_semantic_html_override">
<h4><a type="open"><field name="ref"/></a></h4>
<a type="open"><field name="invoice"/></a>
<i><div t-if="record.result.raw_value">
<field name="result"/></div></i>
<div><a t-if="record.date_maturity.raw_value" title="Date">
<field name="date_maturity"/>
</a></div>
<a t-if="record.blocked.raw_value === true" type="object" string="Lit." name="set_kanban_state_litigation" class="oe_kanban_status oe_kanban_status_red"> </a>
<a t-if="record.blocked.raw_value === false" type="object" string="Lit." name="set_kanban_state_litigation" class="oe_kanban_status oe_kanban_status_green"> </a>
</div>
</t>
</templates>
</kanban>
</field>
<field name="payment_note"/>
</group>
</page>
</page>
@ -252,12 +197,15 @@
<!-- <record id="action_view_customer_followup_form" model="ir.actions.act_window.view">
<record id="action_view_customer_followup_form" model="ir.actions.act_window.view">
<field name="sequence" eval="2"/>
<field name="view_mode">form</field>
<field name="view_id" ref="customer_followup_form"/>
<field name="view_id" ref="view_partner_inherit_followup_form"/>
<field name="context">{'Followupfirst':True} </field>
<field name="act_window_id" ref="action_customer_followup"/>
</record>-->
</record>
<record id="action_view_customer_followup_tree" model="ir.actions.act_window.view">
<field name="sequence" eval="1"/>
@ -267,7 +215,7 @@
</record>
<!-- Menus about followup of customers -->
<menuitem id="account_followup_s" action="action_customer_followup" parent="menu_finance_followup" name="Customer Follow-up"/>
<menuitem id="account_followup_s" action="action_customer_followup" parent="menu_finance_followup" name="Customers Requiring Action" sequence="3"/>
</data>
</openerp>

View File

@ -42,7 +42,6 @@ ${user.name}
<td>Amount</td>
<td>Lit.</td>
</tr>
<%
amls = object.accountmoveline_ids
mel = {}
@ -267,7 +266,6 @@ ${mel[aml.id]}
appropriate measures in order to carry out this payment in the next 8 days.
Would your payment have been carried out after this mail was sent, please ignore this message. Do not hesitate to
contact our accounting department at (+32).10.68.94.39.
Best Regards,
</p>
<br/>
Best Regards,

View File

@ -5,14 +5,14 @@
<record id="demo_followup1" model="account_followup.followup">
<field name="name">Default Follow-up</field>
<field name="company_id" ref="base.main_company"/>
<field name="description">First letter after 15 net days, 30 net days and 45 days end of month levels.</field>
</record>
<record id="demo_followup_line1" model="account_followup.followup.line">
<field name="name">Level 0 : 15 days</field>
<field name="name">Send first reminder email</field>
<field name="sequence">0</field>
<field name="delay">15</field>
<field name="followup_id" ref="demo_followup1"/>
<field name="send-email">True</field>
<field name="description">
Dear %(partner_name)s,
@ -26,11 +26,13 @@ Best Regards,
</record>
<record id="demo_followup_line2" model="account_followup.followup.line">
<field name="name">Level 1 : 30 days</field>
<field name="name">Send reminder letter and email</field>
<field name="sequence">1</field>
<field name="delay">30</field>
<field name="followup_id" ref="demo_followup1"/>
<field name="email_template_id" ref="email_template_account_followup_level1"/>
<field name="send_email">True</field>
<field name="send_letter">True</field>
<field name="description">
Dear %(partner_name)s,
@ -46,13 +48,17 @@ Details of due payments is printed below.
Best Regards,
</field>
</record>
<record id="demo_followup_line3" model="account_followup.followup.line">
<field name="name">Level 2 : 45 days</field>
<field name="sequence">2</field>
<field name="delay">45</field>
<field name="name">Call the customer on the phone</field>
<field name="sequence">3</field>
<field name="delay">40</field>
<field name="followup_id" ref="demo_followup1"/>
<field name="email_template_id" ref="email_template_account_followup_level2"/>
<field eval="False" name="send_email"/>
<field name="manual_action">True</field>
<field name="manual_action_note">Call the customer on the phone! </field>
<field name="description">
Dear %(partner_name)s,
@ -68,5 +74,51 @@ Best Regards,
</field>
</record>
<record id="demo_followup_line4" model="account_followup.followup.line">
<field name="name">More agressive reminder email</field>
<field name="sequence">4</field>
<field name="delay">50</field>
<field name="followup_id" ref="demo_followup1"/>
<field name="send_email">True</field>
<field name="email_template_id" ref="email_template_account_followup_level2"/>
<field name="description">
Dear %(partner_name)s,
Despite several reminders, your account is still not settled.
Unless full payment is made in next 8 days, then legal action for the recovery of the debt will be taken without further notice.
I trust that this action will prove unnecessary and details of due payments is printed below.
In case of any queries concerning this matter, do not hesitate to contact our accounting department at (+32).10.68.94.39.
Best Regards,
</field>
</record>
<record id="demo_followup_line5" model="account_followup.followup.line">
<field name="name">More agressive reminder letter</field>
<field name="sequence">5</field>
<field name="delay">60</field>
<field name="followup_id" ref="demo_followup1"/>
<field eval="False" name="send_email"/>
<field name="send_letter">True</field>
<field name="email_template_id" ref="email_template_account_followup_level2"/>
<field name="description">
Dear %(partner_name)s,
Despite several reminders, your account is still not settled.
Unless full payment is made in next 8 days, then legal action for the recovery of the debt will be taken without further notice.
I trust that this action will prove unnecessary and details of due payments is printed below.
In case of any queries concerning this matter, do not hesitate to contact our accounting department at (+32).10.68.94.39.
Best Regards,
</field>
</record>
</data>
</openerp>

View File

@ -23,38 +23,48 @@
<form string="Follow-up Steps" version="7.0">
<h1><field name="name"/></h1>
<group>
<div class="oe_inline">
After <field name="delay" style="width: 15%%" nolabel="1"/> days, do the following actions:
</div>
</group>
<group>
<field name="manual_action"/>
<field name="send_letter"/>
<field name="manual_action"/>
<field name="send_email"/>
<!--<field name="start" style="width: 25%%"/>-->
</group>
<div class="oe_grey">
<label string="When the wizard for processing the follow-ups is run, for every partner the most overdue invoice (without litigation) is checked. If the amount of days overdue is greater or equal than the amount of days specified above
and the actions of the previous follow-up level were done, then the actions checked below will be executed. "/>
</div>
<p class="oe_grey">
Manual actions can be followed up in the Customers Requiring Action report for
every customer and will only be set when the previous action has been marked as done,
which can be done in the Payments Follow-up tab of the Customer Form.
</p>
<p class="oe_grey">
The format for the letters and emails can be specified. For the letters (PDF report),
the legend is specified below. For emails, we make use of an email template. Changing the text,
will change the text of the email template.
</p>
<group string="Manual Action" attrs="{'invisible': [('manual_action', '=', False)]}">
<field name="manual_action_note" attrs="{'invisible': [('manual_action', '=', False)]}" placeholder="e.g. Give a phonecall, Check if he paid, ..."/>
<field name="manual_action_note" string="Action to perform" attrs="{'invisible': [('manual_action', '=', False)]}" placeholder="e.g. Give a phonecall, Check if he paid, ..."/>
<field name="manual_action_responsible_id" attrs="{'invisible': [('manual_action', '=', False)]}"/>
</group>
<group col="2">
<group string="Send Letter" attrs="{'invisible': [('send_letter', '=', False)]}" colspan="2">
<field name="description" nolabel="1" />
<field name="description" nolabel="1" colspan="2" />
<p>
<group>
<label string="%%(partner_name)s: Partner Name"/>
<label string="%%(date)s: Current Date"/>
<label string="%%(user_signature)s: User Name"/>
<label string="%%(company_name)s: User's Company Name"/>
</group>
</p>
</group>
<group string="Email" attrs="{'invisible': [('send_email', '=', False)]}" >
<field name="email_template_id" attrs="{'invisible': [('send_email', '=', False)]}" nolabel="1" on_change="on_change_template(email_template_id)"/>
@ -76,9 +86,20 @@
<h1><field name="company_id" widget="selection" class="oe_inline"/> Follow-up </h1><!--groups="base.group_multi_company"-->
<p class="oe_grey">Here we define the different follow-up levels for the company.
Every level defines actions that need to be taken after a certain amount of days after the due date of an invoice</p>
<field name="followup_line"/>
<p class="oe_grey">
To remind our customers to pay their invoices when they are overdue,
we define different levels of severity for paying the invoices.
Every level defines actions that need to be taken after a certain amount of days after the due date of an invoice
</p>
<p class ="oe_grey">
When the wizard for processing the follow-ups is run, for every partner the most overdue invoice (without litigation) is checked.
If the amount of days overdue is greater or equal than the amount of days specified
and the actions of the previous follow-up level were done, then the actions checked
for the new follow-up level will be executed.
</p>
<field name="followup_line"/>
</form>
</field>
</record>
@ -114,24 +135,20 @@
<field name="view_type">form</field>
<field name="help" type="html">
<p class="oe_view_nocontent_create">
Click to define follow-up levels and their related messages.
Click to define follow-up levels and their related actions.
</p><p>
For each step, specify the message and the day of delay. Use
the legend to know the using code to adapt the email content to
the good context (good name, good date) and you can manage the
multi language of messages.
For each step, specify the actions to be taken and delay in days. It is
possible to use print and e-mail templates to send specific messages to
the customer.
</p>
</field>
</field>
</record>
<menuitem id="menu_finance_followup" parent="account.menu_finance" name="Follow-up"/>
<menuitem id="account.periodical_processing_reconciliation" parent="menu_finance_followup" name="Reconciliation"/>
<menuitem action="action_account_followup_definition_form" id="account_followup_menu" parent="menu_finance_followup"/>
<menuitem id="account.periodical_processing_reconciliation" parent="menu_finance_followup" name="Reconciliation" sequence="1"/>
<menuitem action="action_account_followup_definition_form" id="account_followup_menu" parent="account.menu_finance_configuration" name="Follow-up Levels"/>
<report auto="False" id="account_followup_followup_report" menu="False" model="account_followup.followup" name="account_followup.followup.print" rml="account_followup/report/account_followup_print.rml" string="Follow-up Report"/>
<record id="account_move_line_partner_tree" model="ir.ui.view">
<field name="name">account.move.line.partner.tree</field>
<field name="model">account.move.line</field>

View File

@ -64,8 +64,8 @@
<field name="context">{'search_default_followup_level':1}</field>
<field name="search_view_id" ref="view_account_followup_stat_search"/>
</record>
<menuitem action="action_followup_stat" id="menu_action_followup_stat_follow" parent="account.next_id_22" groups="account.group_account_user"/>
<menuitem id="menu_finance_followup" parent="account.menu_finance" name="Follow-up" groups="account.group_account_user"/>
<menuitem action="action_followup_stat" id="menu_action_followup_stat_follow" parent="menu_finance_followup" groups="account.group_account_user" name="Follow-ups Done Report" sequence="10"/>
</data>
</openerp>

View File

@ -208,14 +208,6 @@ class account_followup_print(osv.osv_memory):
model_data_ids = mod_obj.search(cr, uid, [('model','=','ir.ui.view'),('name','=','view_account_followup_sending_results')], context=context)
resource_id = mod_obj.read(cr, uid, model_data_ids, fields=['res_id'], context=context)[0]['res_id']
context.update({'description': self.resulttext, 'report_data': res})
# res['name'] = _('Incredibly interesting report')
# res['view_type'] = 'form'
# res['context'] = context
# res['view_mode'] = 'tree,form'
# res['res_model'] = 'account.followup.sending.results'
# res['views'] = [(resource_id,'form')]
# res['type'] = 'ir.actions.act_window'
# res['target'] = 'new'
return {
'name': _('Incredibly interesting report'),
'view_type': 'form',
@ -228,25 +220,7 @@ class account_followup_print(osv.osv_memory):
}
#This can go away afterwards
def do_second_button(self, cr, uid, ids, context=None):
mod_obj = self.pool.get('ir.model.data')
if context is None:
context = {}
data = self.browse(cr, uid, ids, context=context)[0]
model_data_ids = mod_obj.search(cr, uid, [('model','=','ir.ui.view'),('name','=','view_account_followup_sending_results')], context=context)
resource_id = mod_obj.read(cr, uid, model_data_ids, fields=['res_id'], context=context)[0]['res_id']
context.update({'description': "Let's write a very interesting report here"})
return {
'name': _('Incredibly interesting report'),
'view_type': 'form',
'context': context,
'view_mode': 'tree,form',
'res_model': 'account.followup.sending.results',
'views': [(resource_id,'form')],
'type': 'ir.actions.act_window',
'target': 'new',
}
def _get_summary(self, cr, uid, context=None):
if context is None:

View File

@ -12,10 +12,12 @@
<field name="date" groups="base.group_no_one"/>
</group>
<p class = "oe_grey">
And again some explanation why this is the greatest wizard of Oz ever.
This wizard will check the customers with overdue invoices and will execute the actions needed to
send to the customer according to the Follow-up Levels defined. By clicking on the button, the emails will be sent
a report will be generated for the letters. In the next screen you will see which actions were executed and be able to
print the letters if there are any. Also the manual actions will be set when needed.
</p>
<footer>
<footer>
<button name="do_process" string="Send emails and generate letters" type="object" class="oe_highlight"/>
or
<button string="Cancel" class="oe_link" special="cancel"/>
@ -35,7 +37,8 @@
<menuitem action="action_account_followup_print"
id="account_followup_print_menu"
parent="menu_finance_followup"
sequence="10"/>
name = "Send Letters and Emails"
sequence="2"/>
<record id="account_followup_stat_by_partner_search" model="ir.ui.view">
<field name="name">account_followup.stat.by.partner.search</field>