[IMP] first changes after usabiliity review

bzr revid: jco@openerp.com-20121115081634-qz70ofb1cgftmn1e
This commit is contained in:
Josse Colpaert
2012-11-15 09:16:34 +01:00
parent 2d7495b447
commit 863b991fb4
8 changed files with 300 additions and 131 deletions
+2 -2
View File
@@ -293,7 +293,7 @@ class account_account(osv.osv):
null_result = dict((fn, 0.0) for fn in field_names)
if children_and_consolidated:
aml_query = self.pool.get('account.move.line')._query_get(cr, uid, context=context)
wheres = [""]
if query.strip():
wheres.append(query.strip())
@@ -1277,7 +1277,7 @@ class account_move(osv.osv):
if cond[1] in ['=like', 'like', 'not like', 'ilike', 'not ilike', 'in', 'not in', 'child_of']:
continue
cr.execute("select move_id from account_move_line group by move_id having sum(debit) %s %%s" % (cond[1]),(amount,))
cr.execute("select partner_id from account_move_line group by partner_id having sum(balance) %s %%s" % (cond[1]),(amount,))
res_ids = set(id[0] for id in cr.fetchall())
ids = ids and (ids & res_ids) or res_ids
if ids:
+3 -3
View File
@@ -518,11 +518,11 @@ class account_invoice(osv.osv):
return result
def onchange_payment_term_date_invoice(self, cr, uid, ids, payment_term_id, date_invoice):
res = {}
if not payment_term_id:
return res
res = {}
if not date_invoice:
date_invoice = time.strftime('%Y-%m-%d')
if not payment_term_id:
return {'value':{'date_due': date_invoice}} #To make sure the invoice has a due date when no payment term
pterm_list = self.pool.get('account.payment.term').compute(cr, uid, payment_term_id, value=1, date_ref=date_invoice)
if pterm_list:
pterm_list = [line[0] for line in pterm_list]
+1 -1
View File
@@ -51,12 +51,12 @@ Note that if you want to check the follow-up level for a given partner/account e
'data': [
'security/account_followup_security.xml',
'security/ir.model.access.csv',
'wizard/account_followup_print_view.xml',
'report/account_followup_report.xml',
'account_followup_data.xml',
'account_followup_demo.xml', # Defined by default
'account_followup_view.xml',
'account_followup_customers.xml',
'wizard/account_followup_print_view.xml',
],
'demo': [],
'test': [
+31 -14
View File
@@ -30,13 +30,13 @@ from tools.translate import _
class followup(osv.osv):
_name = 'account_followup.followup'
_description = 'Account Follow-up'
#_rec_name = 'company_id'
_rec_name = 'name'
_columns = {
'name': fields.char('Name', size=64, required=True),
'description': fields.text('Description'),
#'name': fields.char('Name', size=64, required=True),
#'description': fields.text('Description'),
'followup_line': fields.one2many('account_followup.followup.line', 'followup_id', 'Follow-up'),
'company_id': fields.many2one('res.company', 'Company', required=True),
'name': fields.related('company_id', 'name', string = "Name"),
}
_defaults = {
'company_id': lambda s, cr, uid, c: s.pool.get('res.company')._company_default_get(cr, uid, 'account_followup.followup', context=c),
@@ -297,8 +297,8 @@ class res_partner(osv.osv):
for partner in self.browse(cr, uid, ids, context):
res[partner.id] = 0.0
for aml in partner.accountmoveline_ids:
if ((not aml.date_maturity) and (aml.date <= fields.date.context_today(cr, uid, context))) or (aml.date_maturity <= fields.date.context_today(cr, uid, context)):
res[partner.id] = res[partner.id] + aml.debit - aml.credit #or by using function field
#if ((not aml.date_maturity) and (aml.date <= fields.date.context_today(cr, uid, context))) or (aml.date_maturity <= fields.date.context_today(cr, uid, context)):
res[partner.id] = res[partner.id] + aml.debit - aml.credit #or by using function field
return res
@@ -333,7 +333,6 @@ class res_partner(osv.osv):
# If not defined by latest level, it will the default template if it can find it
mtp = self.pool.get('email.template')
for partner in self.browse(cr, uid, partner_ids, context):
if partner.latest_followup_level_id_without_lit and partner.latest_followup_level_id_without_lit.send_email and partner.latest_followup_level_id_without_lit.email_template_id.id != False :
mtp.send_mail(cr, uid, partner.latest_followup_level_id_without_lit.email_template_id.id, partner.id, context=context)
else :
@@ -370,12 +369,28 @@ class res_partner(osv.osv):
partnerlist.append(aml.partner_id.id)
return partnerlist
def _get_other_aml_storeids(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()
for cond in args:
amount = cond[2]
if isinstance(cond[2],(list,tuple)):
if cond[1] in ['in','not in']:
amount = tuple(cond[2])
else:
continue
else:
if cond[1] in ['=like', 'like', 'not like', 'ilike', 'not ilike', 'in', 'not in', 'child_of']:
continue
cr.execute("select move_id from account_move_line group by move_id having sum(debit) %s %%s" % (cond[1]),(amount,))
res_ids = set(id[0] for id in cr.fetchall())
ids = ids and (ids & res_ids) or res_ids
if ids:
return [('id', 'in', tuple(ids))]
return [('id', '=', '0')]
_inherit = "res.partner"
_columns = {
@@ -406,7 +421,9 @@ 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"),
help="Amount Overdue: The amount the customer should already have paid",
store={'account.move.line': (_get_aml_storeids, ['debit', 'credit'], 10)},
),
}
res_partner()
@@ -77,19 +77,53 @@
<field name="latest_followup_date"/>-->
<field name="payment_next_action_date"/>
<field name="payment_next_action"/>
<!--Fields needed by inherited search view-->
<field name="user_id" invisible="1"/>
<field name="parent_id" invisible="1"/>
<!--<field name="payment_note"/>
<field name="phone"/>-->
<field name="payment_amount_overdue"/>
<field name="payment_responsible_id"/>
<!--<field name="email"/>-->
<field name="next_followup_level_id"/>
<!-- <field name="latest_followup_date"/>-->
<field name="latest_followup_level_id"/>
<field name="latest_followup_date"/>
</tree>
</field>
</record>
<record id="customer_followup_search_view" model="ir.ui.view">
<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="arch" type="xml">
<search string="Search Partner" position="inside">
<field name="payment_next_action"/>
<!--<filter string="Actions to be taken with overdue amount" domain="['&amp;', ('payment_amount_outstanding', '>', 0.0), ('payment_next_action_date', '&lt;=', time.strftime('%%Y-%%m-%%d'))]"/>
<separator/>-->
<group string="Follow-up">
<filter string="Partners with Credits" domain="[('payment_amount_overdue', '>', 0.0)]" name="credits"/>
<separator/>
<filter string="Follow-ups to do" domain="[('payment_next_action_date', '&lt;=', time.strftime('%%Y-%%m-%%d'))]" name="todo"/>
<separator/>
<!--<filter string="Future follow-ups" domain="['&', ('payment_next_action', '!=', ''), ('payment_next_action_date', '>', time.strftime('%%Y-%%m-%%d'))]"/>-->
<separator/>
<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">
<filter string="Responsible" context="{'group_by':'payment_responsible_id'}"/>
</group>
</search>
</field>
</record>
<record id="customer_followup_search_view2" model="ir.ui.view">
<field name="name">Search</field>
<field name="model">res.partner</field>
<field name="type">search</field>
@@ -104,10 +138,9 @@
<separator/>-->
<filter string="Overdue amount" domain="[('payment_amount_overdue', '>', 0.0)]"/>
<separator/>
<filter string="Action to be taken now" domain="[('payment_next_action_date', '&lt;=', time.strftime('%%Y-%%m-%%d'))]"/>
<filter string="Follow-ups to do" domain="[('payment_next_action_date', '&lt;=', time.strftime('%%Y-%%m-%%d'))]"/>
<separator/>
<filter string="Action to be taken" domain="[('payment_next_action', '!=', '')]"/>
<filter string="Follow-up sent" domain="[('latest_followup_level_id', '!=', False)]"/>
<!--filter string="Future follow-ups" domain="['&', ('payment_next_action', '!=', ''), ('payment_next_action_date', '>', time.strftime('%%Y-%%m-%%d'))]"/>-->
<separator/>
<filter string="Without responsible" domain="[('payment_responsible_id', '=', False)]"/>
<filter string="I am responsible" domain="[('payment_responsible_id','=', uid)]"/>
@@ -124,12 +157,12 @@
<field name="res_model">res.partner</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
<field name="domain">[]</field> <!--('customer', '=', True), ('latest_followup_date','!=', False)-->
<!--<field name="domain">[('payment_amount_overdue', '>', 0)]</field>--> <!--('customer', '=', True), ('latest_followup_date','!=', False)-->
<field name="context">{'search_default_todo': True, 'search_default_credits': True} </field>
<field name="search_view_id" ref="customer_followup_search_view"/>
</record>
@@ -139,65 +172,86 @@
<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 name="groups_id" eval="[(4, ref('account.group_account_manager'))]"/><!-- or user? -->
<field name="arch" type="xml" eval="[(4, ref('account.group_account_manager'))]">
<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)]}"/>
<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)]}"/>
<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'))]"/>
</div>
<page string="Accounting" position="before" version="7.0">
<page string="Payments Follow-up" position="inside">
<group>
<group>
<field name="payment_amount_overdue"/>
</group>
<group>
<label for="payment_next_action"/>
<div>
<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 attrs="{'invisible':[('payment_next_action', '=', False)]}">This is the action required now:</p>
</div>
<p class="oe_inline">
<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, ..."/>
</div>
</group>
<group>
<field name="latest_followup_level_id"/>
<field name="latest_followup_date"/>
<field name="next_followup_level_id"/>
<!-- test field
<field name="latest_fol"/>
<field name="latest_num"/>-->
</group>
<group>
<!--<field name="payment_next_action_date" help="This is when further follow-up is needed. The date will have been set to the current date when processing the follow-ups asks for a phone call"/>-->
<field name="payment_responsible_id" help="The user who takes responsibility to follow it up. "/>
<button name="action_done" type="object" string="Follow-up Action Done" help="This button will clear the action and the action date. "/>
</group>
<group>
<field name="payment_note"/>
</group>
</group>
<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. "/>
</p>
<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
</p>
<group>
<field name="accountmoveline_ids" nolabel="1" >
<tree string="Account Move line" editable="bottom" colors="red:date_maturity and date_maturity&lt;current_date or date&lt;current_date">
<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">
<field name="date" readonly="True"/>
<field name="move_id" readonly="True"/>
<field name="result" readonly="True"/>
<field name="move_id" readonly="True"/>
<field name="blocked" string="Litigation"/>
<field name="date_maturity" readonly="True"/>
<field name="reconcile_partial_id" readonly="True"/>
</tree>
<field name="result" readonly="True"/>
</tree>-->
<kanban default_group_by="followup_line_id">
<field name="followup_line_id"/>
<field name="result"/>
<field name="date_maturity"/>
<field name="blocked"/>
<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>
</t>
</templates>
</kanban>
</field>
<field name="payment_note"/>
</group>
</page>
</page>
</field>
</record>
<!-- <record id="action_view_customer_followup_form" model="ir.actions.act_window.view">
<field name="sequence" eval="2"/>
<field name="view_mode">form</field>
@@ -213,7 +267,7 @@
</record>
<!-- Menus about followup of customers -->
<menuitem id="account_followup_s" action="action_customer_followup" parent="account.menu_finance_periodical_processing_billing" name="Customer Follow-up"/>
<menuitem id="account_followup_s" action="action_customer_followup" parent="menu_finance_followup" name="Customer Follow-up"/>
</data>
</openerp>
@@ -8,8 +8,10 @@
<tree string="Follow-up Steps" >
<field name="name"/>
<field name="delay"/>
<field name="send_email"/>
<field name="send_letter"/>
<field name="manual_action"/>
<!--<field name="start"/>-->
</tree>
</field>
</record>
@@ -20,45 +22,45 @@
<field name="arch" type="xml">
<form string="Follow-up Steps" version="7.0">
<field name="name"/>
<group>
<label for="delay"/>
<h1><field name="name"/></h1>
<group>
<div class="oe_inline">
<field name="delay" style="width: 25%%"/>
After <field name="delay" style="width: 15%%" nolabel="1"/> days, do the following actions:
</div>
</group>
<group>
<field name="send_letter"/>
<field name="manual_action"/>
<field name="send_email"/>
<!--<field name="start" style="width: 25%%"/>-->
</div>
</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>
<separator string="Processing actions"/>
<group>
<group>
<field name="send_letter"/>
<field name="manual_action"/>
<field name="manual_action_note" attrs="{'invisible': [('manual_action', '=', False)]}"/>
<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_responsible_id" attrs="{'invisible': [('manual_action', '=', False)]}"/>
</group>
<group>
<field name="send_email"/>
</group>
</group>
<separator string="Message"/>
<group col="4">
<field name="description" attrs="{'invisible': [('send_letter', '=', False)]}" colspan="2"/>
<group>
<field name="email_template_id" attrs="{'invisible': [('send_email', '=', False)]}" on_change="on_change_template(email_template_id)"/>
<field name="email_body" attrs="{'invisible': [('send_email', '=', False)]}" colspan="2"/>
</group>
</group>
<separator string="Legend"/>
<group attrs="{'invisible': [('send_letter', '=', False)]}">
<label string="%%(partner_name)s: Partner Name"/>
<group col="2">
<group string="Send Letter" attrs="{'invisible': [('send_letter', '=', False)]}" colspan="2">
<field name="description" nolabel="1" />
<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>
</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)"/>
<field name="email_body" attrs="{'invisible': [('send_email', '=', False)]}" colspan="2" nolabel="1"/>
</group>
</group>
</form>
</field>
</record>
@@ -66,15 +68,17 @@
<record id="view_account_followup_followup_form" model="ir.ui.view">
<field name="name">account_followup.followup.form</field>
<field name="model">account_followup.followup</field>
<!-- <field name="group_ids" groups="base.group_multi_company"/>-->
<field name="arch" type="xml">
<form string="Follow-up" version="7.0">
<group col="4">
<field name="name"/>
<field name="company_id" widget="selection" groups="base.group_multi_company"/>
</group>
<group>
<field name="followup_line"/>
</group>
<form string="Follow-up" version="7.0">
<!-- <field name="name"/> -->
<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"/>
</form>
</field>
</record>
@@ -84,8 +88,8 @@
<field name="model">account_followup.followup</field>
<field name="arch" type="xml">
<tree string="Follow-up">
<field name="name"/>
<field name="company_id" groups="base.group_multi_company"/>
<!--<field name="name"/>-->
<field name="company_id" /> <!--groups="base.group_multi_company"-->
</tree>
</field>
</record>
@@ -95,8 +99,9 @@
<field name="model">account_followup.followup</field>
<field name="arch" type="xml">
<search string="Search Follow-up">
<field name="name" string="Follow-up"/>
<!-- <field name="name" string="Follow-up"/> -->
<field name="company_id" groups="base.group_multi_company"/>
</search>
</field>
</record>
@@ -118,7 +123,12 @@
</p>
</field>
</record>
<menuitem action="action_account_followup_definition_form" id="account_followup_menu" parent="account.menu_configuration_misc"/>
<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"/>
<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"/>
@@ -74,6 +74,35 @@ class account_followup_stat_by_partner(osv.osv):
)""") #Blocked is to take into account litigation
account_followup_stat_by_partner()
class account_followup_sending_results(osv.osv_memory):
def do_report(self, cr, uid, ids, context=None):
res = {}
#print "context:", self.report_data
return context['report_data']
def _get_description(self, cr, uid, context=None):
res = ""
if context!=None:
res = context['description']
self.report_data = context['report_data']
return res
_name = 'account.followup.sending.results'
_description = 'Results from the sending of the different letters and emails'
_columns = {
'description':fields.text("Description", required=False),
}
_defaults = {
'description':_get_description
}
account_followup_sending_results()
class account_followup_print(osv.osv_memory):
_name = 'account.followup.print'
_description = 'Print Follow-up & Send Mail to Customers'
@@ -87,7 +116,7 @@ class account_followup_print(osv.osv_memory):
'partner_lang': fields.boolean('Send Email in Partner Language', help='Do not change message text, if you want to send email in partner language, or configure from company'),
'email_body': fields.text('Email Body'),
'summary': fields.text('Summary', readonly=True),
'test_print': fields.boolean('Test Print', help='Check if you want to print follow-ups without changing follow-ups level.'),
'test_print': fields.boolean('Test Print', help='Check if you want to print follow-ups without changing follow-ups level.'),
}
def _get_followup(self, cr, uid, context=None):
@@ -126,14 +155,27 @@ class account_followup_print(osv.osv_memory):
def process_partners(self, cr, uid, partner_ids, data, context=None):
partner_obj = self.pool.get('res.partner')
partner_ids_to_print = []
self.resulttext = "Report"
nbmanuals = 0
manuals = {}
nbmails = 0
nbprints = 0
for partner in self.pool.get('account_followup.stat.by.partner').browse(cr, uid, partner_ids, context=context):
if partner.max_followup_id.manual_action:
partner_obj.do_partner_manual_action(cr, uid, [partner.partner_id.id], context)
nbmanuals = nbmanuals + 1
key = partner.partner_id.payment_responsible_id.name or "Empty"
manuals[key]= "Y"
if partner.max_followup_id.send_email:
partner_obj.do_partner_mail(cr, uid, [partner.partner_id.id], context)
nbmails = nbmails + 1
if partner.max_followup_id.send_letter:
partner_ids_to_print.append(partner.id)
nbprints = nbprints+ 1
partner_obj.message_post(cr, uid, [partner.partner_id.id], body=_("Follow-up letter will be sent"), context=context)
self.resulttext = self.resulttext + str(nbmanuals) + "Changed \n" + str(nbmails) + " Emailed \n " + str(nbprints) + "Printed \n"
for item in manuals:
self.resulttext = self.resulttext + item + ":" + manuals[item] + "\n"
action = partner_obj.do_partner_print(cr, uid, partner_ids_to_print, data, context)
return action or {}
@@ -159,7 +201,52 @@ class account_followup_print(osv.osv_memory):
data['followup_id'] = data['followup_id'][0]
self.do_update_followup_level(cr, uid, to_update, partner_list, date, context=context)
res = self.process_partners(cr, uid, partner_list, data, context=context)
return res
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': 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',
'context': context,
'view_mode': 'tree,form',
'res_model': 'account.followup.sending.results',
'views': [(resource_id,'form')],
'type': 'ir.actions.act_window',
'target': 'new',
}
#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:
@@ -8,16 +8,20 @@
<field name="arch" type="xml">
<form string="Send follow-ups" version="7.0">
<group col="4">
<field name="followup_id"/>
<field name="date"/>
<field name="followup_id" groups="base.group_multi_company"/>
<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.
</p>
<footer>
<button name="do_process" string="Process" type="object" class="oe_highlight"/>
<button name="do_process" string="Send emails and generate letters" type="object" class="oe_highlight"/>
or
<button string="Cancel" class="oe_link" special="cancel"/>
</footer>
</form>
</field>
</field>
</record>
<record id="action_account_followup_print" model="ir.actions.act_window">
@@ -30,7 +34,7 @@
<menuitem action="action_account_followup_print"
id="account_followup_print_menu"
parent="account.menu_finance_periodical_processing_billing"
parent="menu_finance_followup"
sequence="10"/>
<record id="account_followup_stat_by_partner_search" model="ir.ui.view">
@@ -63,25 +67,22 @@
</field>
</record>
<!--<record id="view_account_followup_print_all" model="ir.ui.view">
<field name="name">account.followup.print.all.form</field>
<field name="model">account.followup.print.all</field>
<record id="view_account_followup_sending_results" model="ir.ui.view">
<field name="name">account.followup.sending.results.form</field>
<field name="model">account.followup.sending.results</field>
<field name="arch" type="xml">
<form string="Send Follow-Ups" version="7.0">
<form string="Results of the sending committee" version="7.0">
<header>
<button name="do_mail" string="Send Mails" type="object" class="oe_highlight"/>
<button name="do_print" string="Print Follow Ups" type="object" class="oe_highlight"/>
<button name="do_process" string="Process" type="object" class="oe_highlight"/>
or
<button string="Cancel" class="oe_link" special="cancel"/>
<field name="description"/>
</header>
<field name="partner_ids" context="{'search_default_balance_positive': 1}" domain="[('company_id','=',context.get('company_id',False))]"/>
<footer>
<button name="do_report" string="Download report here" type="object" class="oe_highlight"/>
</footer>
</form>
</field>
</record>
<record id="view_account_followup_print_all_msg" model="ir.ui.view">
<!--<record id="view_account_followup_print_all_msg" model="ir.ui.view">
<field name="name">account.followup.print.all.msg.form</field>
<field name="model">account.followup.print.all</field>
<field name="arch" type="xml">