Skip to content

Commit

Permalink
[MIG] customer_outstanding_statement: Migration to 10.0
Browse files Browse the repository at this point in the history
  • Loading branch information
MiquelRForgeFlow committed Jun 16, 2017
1 parent d9dfaef commit 115aea5
Show file tree
Hide file tree
Showing 8 changed files with 55 additions and 58 deletions.
2 changes: 1 addition & 1 deletion customer_outstanding_statement/README.rst
Expand Up @@ -33,7 +33,7 @@ To use this module, you need to:

.. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas
:alt: Try me on Runbot
:target: https://runbot.odoo-community.org/runbot/91/9.0
:target: https://runbot.odoo-community.org/runbot/91/10.0

Bug Tracker
===========
Expand Down
Expand Up @@ -5,7 +5,7 @@

{
'name': 'Customer Outstanding Statement',
'version': '9.0.1.0.0',
'version': '10.0.1.0.0',
'category': 'Accounting & Finance',
'summary': 'OCA Financial Reports',
'author': "Eficent, Odoo Community Association (OCA)",
Expand Down
Expand Up @@ -4,8 +4,8 @@
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).

from datetime import datetime, timedelta
from openerp.tools import DEFAULT_SERVER_DATE_FORMAT
from openerp import api, fields, models
from odoo.tools.misc import DEFAULT_SERVER_DATE_FORMAT
from odoo import api, fields, models


class CustomerOutstandingStatement(models.AbstractModel):
Expand All @@ -15,8 +15,7 @@ class CustomerOutstandingStatement(models.AbstractModel):

def _format_date_to_partner_lang(self, str_date, partner_id):
lang_code = self.env['res.partner'].browse(partner_id).lang
lang_id = self.env['res.lang']._lang_get(lang_code)
lang = self.env['res.lang'].browse(lang_id)
lang = self.env['res.lang']._lang_get(lang_code)
date = datetime.strptime(str_date, DEFAULT_SERVER_DATE_FORMAT).date()
return date.strftime(lang.date_format)

Expand Down Expand Up @@ -258,7 +257,7 @@ def _get_account_show_buckets(self, company_id, partner_ids, date_end):
return res

@api.multi
def render_html(self, data):
def render_html(self, docids, data):
company_id = data['company_id']
partner_ids = data['partner_ids']
date_end = data['date_end']
Expand Down
Expand Up @@ -8,7 +8,7 @@ <h2 class="oe_slogan">Customer Outstanding Statement</h2>
<img src="Outstanding_Statement.png">
</div>
</div>
<div class="oe_span6">
<div class="oe_span4">
<p class="oe_mt32"><div style="text-align:justify">The outstanding statement provides details of all outstanding
customer receivables up to a particular date. This includes all unpaid invoices, unclaimed
refunds and outstanding payments. The list is displayed in chronological order and is split
Expand Down
Expand Up @@ -3,7 +3,7 @@
# (http://www.eficent.com)
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).

from openerp.tests.common import TransactionCase
from odoo.tests.common import TransactionCase


class TestCustomerOutstandingStatement(TransactionCase):
Expand Down
2 changes: 1 addition & 1 deletion customer_outstanding_statement/views/statement.xml
Expand Up @@ -6,7 +6,7 @@
<div class="row">
<div class="col-xs-5 col-xs-offset-7">
<span t-field="o.name"/><br/>
<span t-raw="o._address_display(None, None)[o.id].replace('\n\n', '\n').replace('\n', '&lt;br&gt;')"/>
<span t-raw="o.contact_address.replace('\n\n', '\n').replace('\n', '&lt;br&gt;')"/>
<span t-field="o.vat"/>
</div>
<h4 style="padding-left:20em">
Expand Down
Expand Up @@ -4,7 +4,7 @@
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).

from datetime import date
from openerp import api, fields, models
from odoo import api, fields, models


class CustomerOutstandingStatementWizard(models.TransientModel):
Expand Down
@@ -1,49 +1,47 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<!-- wizard action on res.partner -->
<act_window id="customer_outstanding_statement_wizard_action"
name="Customer Outstanding Statement"
src_model="res.partner"
res_model="customer.outstanding.statement.wizard"
view_type="form" view_mode="form"
key2="client_action_multi" target="new"
groups="account.group_account_user"/>
<odoo>
<!-- wizard action on res.partner -->
<act_window id="customer_outstanding_statement_wizard_action"
name="Customer Outstanding Statement"
src_model="res.partner"
res_model="customer.outstanding.statement.wizard"
view_type="form" view_mode="form"
key2="client_action_multi" target="new"
groups="account.group_account_user"/>

<!-- wizard view -->
<record id="customer_outstanding_statement_wizard_view" model="ir.ui.view">
<field name="name">Customer Outstanding Statement Wizard</field>
<field name="model">customer.outstanding.statement.wizard</field>
<field name="arch" type="xml">
<form name="Report Options">
<div style="text-align:justify">
<label string="The outstanding statement provides details of all outstanding
customer receivables up to a particular date. This includes all unpaid invoices, unclaimed
refunds and outstanding payments. The list is displayed in chronological order and is
split by currencies."/><br/><br/>
<label string="Aging details can be shown in the report, expressed in aging
buckets (30 days due, ...), so the customer can review how much is open, due or overdue."/>
</div><hr/>
<group name="main_info">
<field name="company_id" options="{'no_create': True}" groups="base.group_multi_company"/>
</group>
<group name="dates">
<field name="date_end"/>
</group>
<group name="aging_report">
<field name="show_aging_buckets"/>
</group>
<group name="multiple_partners">
<field name="number_partner_ids" readonly="1" invisible="1"/>
<field name="filter_partners_non_due" attrs="{'invisible': [('number_partner_ids', '=', 1)]}"/>
</group>
<footer>
<button name="button_export_pdf" string="Export PDF" type="object" default_focus="1" class="oe_highlight"/>
or
<button string="Cancel" class="oe_link" special="cancel" />
</footer>
</form>
</field>
</record>
</data>
</openerp>
<!-- wizard view -->
<record id="customer_outstanding_statement_wizard_view" model="ir.ui.view">
<field name="name">Customer Outstanding Statement Wizard</field>
<field name="model">customer.outstanding.statement.wizard</field>
<field name="arch" type="xml">
<form name="Report Options">
<div style="text-align:justify">
<label string="The outstanding statement provides details of all outstanding
customer receivables up to a particular date. This includes all unpaid invoices, unclaimed
refunds and outstanding payments. The list is displayed in chronological order and is
split by currencies."/><br/><br/>
<label string="Aging details can be shown in the report, expressed in aging
buckets (30 days due, ...), so the customer can review how much is open, due or overdue."/>
</div><hr/>
<group name="main_info">
<field name="company_id" options="{'no_create': True}" groups="base.group_multi_company"/>
</group>
<group name="dates">
<field name="date_end"/>
</group>
<group name="aging_report">
<field name="show_aging_buckets"/>
</group>
<group name="multiple_partners">
<field name="number_partner_ids" readonly="1" invisible="1"/>
<field name="filter_partners_non_due" attrs="{'invisible': [('number_partner_ids', '=', 1)]}"/>
</group>
<footer>
<button name="button_export_pdf" string="Export PDF" type="object" default_focus="1" class="oe_highlight"/>
or
<button string="Cancel" class="oe_link" special="cancel" />
</footer>
</form>
</field>
</record>
</odoo>

0 comments on commit 115aea5

Please sign in to comment.