account_move_line_filter_wizard: Port to v10

This commit is contained in:
Alexis de Lattre
2018-05-25 13:25:00 +02:00
parent 567e7f1f6e
commit a4a9be78bc
5 changed files with 26 additions and 60 deletions

View File

@@ -1,30 +1,12 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# Account Move Line Filter Wizard module for Odoo
# Copyright (C) 2016 Akretion (http://www.akretion.com)
# Copyright (C) 2016-2018 Akretion (http://www.akretion.com)
# @author Alexis de Lattre <alexis.delattre@akretion.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
{
'name': 'Account Move Line Filter Wizard',
'version': '0.1',
'category': 'Accounting & Finance',
'version': '10.0.1.0.0',
'category': 'Accounting',
'license': 'AGPL-3',
'summary': 'Easy and fast access to the details of an account',
'description': """
@@ -39,5 +21,5 @@ This module has been written by Alexis de Lattre from Akretion <alexis.delattre@
'website': 'http://www.akretion.com',
'depends': ['account_usability'],
'data': ['wizard/account_move_line_filter_view.xml'],
'installable': False,
'installable': True,
}

View File

@@ -1,26 +1,9 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# Account Move Line Filter Wizard module for Odoo
# Copyright (C) 2016 Akretion (http://www.akretion.com)
# Copyright 2016-2018 Akretion (http://www.akretion.com)
# @author Alexis de Lattre <alexis.delattre@akretion.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from openerp import models, fields, api
from odoo import models, fields, api
class AccountMoveLineFilterWizard(models.TransientModel):
@@ -31,12 +14,13 @@ class AccountMoveLineFilterWizard(models.TransientModel):
'res.partner', string='Partner', domain=[('parent_id', '=', False)])
account_id = fields.Many2one(
'account.account', string='Account',
domain=[('type', 'not in', ('view', 'closed'))], required=True)
account_reconcile = fields.Boolean(related='account_id.reconcile')
domain=[('deprecated', '=', False)], required=True)
account_reconcile = fields.Boolean(
related='account_id.reconcile', readonly=True)
reconcile = fields.Selection([
('unreconciled', 'Unreconciled'),
('reconciled', 'Fully Reconciled'),
('partial_reconciled', 'Partially Reconciled'),
# ('partial_reconciled', 'Partially Reconciled'),
], string='Reconciliation Filter')
@api.onchange('partner_id')
@@ -44,11 +28,11 @@ class AccountMoveLineFilterWizard(models.TransientModel):
if self.partner_id:
if self.partner_id.customer:
self.account_id =\
self.partner_id.property_account_receivable.id
self.partner_id.property_account_receivable_id.id
else:
self.account_id = self.partner_id.property_account_payable.id
self.account_id =\
self.partner_id.property_account_payable_id.id
@api.multi
def go(self):
self.ensure_one()
action = self.env['ir.actions.act_window'].for_xml_id(

View File

@@ -1,13 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (C) 2016 Akretion (http://www.akretion.com/)
Copyright (C) 2016-2018 Akretion (http://www.akretion.com/)
@author Alexis de Lattre <alexis.delattre@akretion.com>
The licence is in the file __openerp__.py
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
-->
<openerp>
<data>
<odoo>
<record id="account_move_line_filter_wizard_form" model="ir.ui.view">
<field name="name">account_move_line_filter_wizard_form</field>
@@ -22,8 +21,8 @@
attrs="{'invisible': [('account_reconcile', '!=', True)]}"/>
</group>
<footer>
<button type="object" name="go" string="Go" class="oe_highlight"/>
<button special="cancel" string="Cancel" class="oe_link"/>
<button type="object" name="go" string="Go" class="btn-primary"/>
<button special="cancel" string="Cancel" class="btn-default"/>
</footer>
</form>
</field>
@@ -42,5 +41,4 @@
sequence="-1"/>
</data>
</openerp>
</odoo>

View File

@@ -27,6 +27,7 @@ This module has been written by Alexis de Lattre from Akretion
'data': [
'sale_view.xml',
'product_view.xml',
'security/ir.model.access.csv',
],
'installable': True,
}

View File

@@ -70,6 +70,7 @@
<field name="arch" type="xml">
<filter context="{'group_by':'date_order'}" position="after">
<filter string="Order Confirmation Month" name="confirmation_date_groupby" context="{'group_by': 'confirmation_date'}"/>
<filter string="State" name="state_groupby" context="{'group_by': 'state'}"/>
</filter>
</field>
</record>