Merge PR #312 into 13.0

Signed-off-by guewen
This commit is contained in:
OCA-git-bot
2020-07-17 07:01:13 +00:00
10 changed files with 72 additions and 0 deletions

View File

View File

@@ -0,0 +1 @@
from . import models

View File

@@ -0,0 +1,16 @@
# Copyright 2020 Camptocamp
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
{
"name": "Bank Statement Journal Items",
"summary": "Add Journal Items button in the bank statements",
"version": "13.0.1.0.0",
"depends": ["account"],
"author": "Camptocamp, Odoo Community Association (OCA)",
"website": "http://www.github.com/OCA/account-reconcile",
"category": "Finance",
"data": ["views/bank_statement.xml"],
"license": "AGPL-3",
"auto_install": False,
"installable": True,
}

View File

@@ -0,0 +1 @@
from . import account_bank_statement

View File

@@ -0,0 +1,24 @@
# Copyright 2020 Camptocamp
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from odoo import models
from odoo.tools.translate import _
class AccountBankStatement(models.Model):
_inherit = "account.bank.statement"
def button_journal_items(self):
return {
"name": _("Journal Items"),
"view_mode": "tree,form",
"res_model": "account.move.line",
"views": [
(self.env.ref("account.view_move_line_tree").id, "tree"),
(self.env.ref("account.view_move_line_form").id, "form"),
],
"type": "ir.actions.act_window",
"domain": [("id", "in", self.mapped("move_line_ids").ids)],
"context": {"journal_id": self.journal_id.id},
}

View File

@@ -0,0 +1,3 @@
* `Camptocamp <https://www.camptocamp.com>`_:
* Anna Janiszewska

View File

@@ -0,0 +1 @@
This module adds a smart button on bank statement form view, allowing you to display its journal items.

View File

@@ -0,0 +1,19 @@
<?xml version="1.0" encoding="utf-8" ?>
<odoo>
<record id="view_bank_statement_journal_items_form" model="ir.ui.view">
<field name="name">account.bank.statement.journal.items.form</field>
<field name="model">account.bank.statement</field>
<field name="inherit_id" ref="account.view_bank_statement_form" />
<field name="arch" type="xml">
<xpath expr="//button[@name='button_journal_entries']" position="before">
<button
class="oe_stat_button"
name="button_journal_items"
string="Journal Items"
type="object"
icon="fa-bars"
/>
</xpath>
</field>
</record>
</odoo>

View File

@@ -0,0 +1 @@
../../../../bank_statement_journal_items

View File

@@ -0,0 +1,6 @@
import setuptools
setuptools.setup(
setup_requires=['setuptools-odoo'],
odoo_addon=True,
)