Merge PR #683 into 17.0

Signed-off-by etobella
pull/704/head
OCA-git-bot 2024-09-08 14:53:50 +00:00
commit d374e8cc7a
15 changed files with 165 additions and 28 deletions

View File

@ -412,8 +412,9 @@ class AccountBankStatementLine(models.Model):
continue
new_data.append(line_data)
liquidity_amount += line_data["amount"]
for line in reconcile_model._get_write_off_move_lines_dict(
-liquidity_amount, self._retrieve_partner()
-liquidity_amount, self._retrieve_partner().id
):
new_line = line.copy()
amount = line.get("balance")

View File

@ -33,7 +33,7 @@ export class ReconcileController extends KanbanController {
});
}
get journalId() {
if (this.props.resModel === "account.bank.statement.line") {
if (this.props.context.active_model === "account.journal") {
return this.props.context.active_id;
}
return false;
@ -69,6 +69,7 @@ export class ReconcileController extends KanbanController {
this.action.doAction(action, {
onClose: async () => {
await this.model.root.load();
await this.updateJournalInfo();
this.render(true);
},
});

View File

@ -23,10 +23,12 @@ export class ReconcileFormController extends FormController {
async reloadFormController() {
var is_reconciled = this.model.root.data.is_reconciled;
await this.model.root.load();
if (!is_reconciled && this.model.root.data.is_reconciled) {
// This only happens when we press the reconcile button
if (this.env.parentController) {
// Showing rainbow man
if (this.env.parentController) {
// We will update the parent controller every time we reload the form.
await this.env.parentController.model.root.load();
await this.env.parentController.render(true);
if (!is_reconciled && this.model.root.data.is_reconciled) {
// This only happens when we press the reconcile button for showing rainbow man
const message = await this.orm.call(
"account.journal",
"get_rainbowman_message",
@ -36,8 +38,6 @@ export class ReconcileFormController extends FormController {
this.env.parentController.setRainbowMan(message);
}
// Refreshing
await this.env.parentController.model.root.load();
await this.env.parentController.render(true);
this.env.parentController.selectRecord();
}
}

View File

@ -2,9 +2,10 @@
// import {ChatterContainer} from "@mail/components/chatter_container/chatter_container";
// import {Chatter} from "@mail/core/web/chatter";
import {Chatter} from "@mail/core/web/chatter";
import {registry} from "@web/core/registry";
import {standardFieldProps} from "@web/views/fields/standard_field_props";
import {Chatter} from "@mail/core/web/chatter";
const {Component} = owl;

View File

@ -13,6 +13,7 @@
type="action"
name="%(account_reconcile_oca.action_bank_statement_line_move_view_reconcile)s"
string="Bank reconcile"
context="{'search_default_move_id': id}"
class="btn btn-primary"
icon="fa-list"
invisible="statement_line_id == False"

View File

@ -45,7 +45,7 @@
<field
name="name"
string="Journal Item"
filter_domain="[ '|', '|', '|', ('name', 'ilike', self), ('ref', 'ilike', self), ('account_id', 'ilike', self), ('partner_id', 'ilike', self)]"
filter_domain="['|','|','|','|','|',('name', 'ilike', self), ('ref', 'ilike', self), ('account_id', 'ilike', self), ('partner_id', 'ilike', self),('amount_residual', 'ilike', self),('amount_residual_currency', 'ilike', self)]"
/>
<field name="name" />
<field name="ref" />

View File

@ -58,7 +58,14 @@ Authors
Contributors
------------
- Alexis de Lattre <alexis.delattre@akretion.com>
- `Akretion <https://www.akretion.com>`__:
- Alexis de Lattre <alexis.delattre@akretion.com>
- `Tecnativa <https://www.tecnativa.com>`__:
- Carlos Dauden
- Sergio Teruel
Maintainers
-----------

View File

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

View File

@ -14,8 +14,8 @@
"website": "https://github.com/OCA/account-reconcile",
"depends": ["account"],
"data": [
"views/account_bank_statement.xml",
"views/account_bank_statement_line.xml",
"views/account_bank_statement.xml", # Keep order
],
"installable": True,
}

View File

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

View File

@ -0,0 +1,16 @@
from odoo import models
class AccountJournal(models.Model):
_inherit = "account.journal"
def create_cash_statement(self):
# Totally override this action for avoiding the standard
# message saying that you need to install the enterprise
# module. We do the equivalent thing instead.
self.ensure_one()
action = self.env["ir.actions.actions"]._for_xml_id(
"account_statement_base.account_bank_statement_line_action"
)
action["context"] = {"search_default_journal_id": self.id}
return action

View File

@ -1 +1,5 @@
- Alexis de Lattre \<<alexis.delattre@akretion.com>\>
- [Akretion](https://www.akretion.com):
- Alexis de Lattre \<<alexis.delattre@akretion.com>\>
- [Tecnativa](https://www.tecnativa.com):
- Carlos Dauden
- Sergio Teruel

View File

@ -8,10 +8,11 @@
/*
:Author: David Goodger (goodger@python.org)
:Id: $Id: html4css1.css 8954 2022-01-20 10:10:25Z milde $
:Id: $Id: html4css1.css 9511 2024-01-13 09:50:07Z milde $
:Copyright: This stylesheet has been placed in the public domain.
Default cascading style sheet for the HTML output of Docutils.
Despite the name, some widely supported CSS2 features are used.
See https://docutils.sourceforge.io/docs/howto/html-stylesheets.html for how to
customize this style sheet.
@ -274,7 +275,7 @@ pre.literal-block, pre.doctest-block, pre.math, pre.code {
margin-left: 2em ;
margin-right: 2em }
pre.code .ln { color: grey; } /* line numbers */
pre.code .ln { color: gray; } /* line numbers */
pre.code, code { background-color: #eeeeee }
pre.code .comment, code .comment { color: #5C6576 }
pre.code .keyword, code .keyword { color: #3B0D06; font-weight: bold }
@ -300,7 +301,7 @@ span.option {
span.pre {
white-space: pre }
span.problematic {
span.problematic, pre.problematic {
color: red }
span.section-subtitle {
@ -403,13 +404,23 @@ If you spotted it first, help us to smash it by providing a detailed and welcome
<div class="section" id="contributors">
<h2><a class="toc-backref" href="#toc-entry-4">Contributors</a></h2>
<ul class="simple">
<li><a class="reference external" href="https://www.akretion.com">Akretion</a>:<ul>
<li>Alexis de Lattre &lt;<a class="reference external" href="mailto:alexis.delattre&#64;akretion.com">alexis.delattre&#64;akretion.com</a>&gt;</li>
</ul>
</li>
<li><a class="reference external" href="https://www.tecnativa.com">Tecnativa</a>:<ul>
<li>Carlos Dauden</li>
<li>Sergio Teruel</li>
</ul>
</li>
</ul>
</div>
<div class="section" id="maintainers">
<h2><a class="toc-backref" href="#toc-entry-5">Maintainers</a></h2>
<p>This module is maintained by the OCA.</p>
<a class="reference external image-reference" href="https://odoo-community.org"><img alt="Odoo Community Association" src="https://odoo-community.org/logo.png" /></a>
<a class="reference external image-reference" href="https://odoo-community.org">
<img alt="Odoo Community Association" src="https://odoo-community.org/logo.png" />
</a>
<p>OCA, or the Odoo Community Association, is a nonprofit organization whose
mission is to support the collaborative development of Odoo features and
promote its widespread use.</p>

View File

@ -5,6 +5,81 @@
-->
<odoo>
<record id="view_bank_statement_form" model="ir.ui.view">
<field name="name">account.bank.statement.form</field>
<field name="model">account.bank.statement</field>
<field name="priority">1</field>
<field name="arch" type="xml">
<form string="Bank Statement">
<div
class="alert alert-warning"
role="alert"
invisible="not problem_description"
>
<field name="problem_description" />
</div>
<sheet>
<div name="button_box" position="inside">
<button
class="oe_stat_button"
type="action"
name="%(account_bank_statement_line_action)d"
icon="fa-bars"
context="{'search_default_statement_id': id}"
string="Transactions"
/>
</div>
<div class="oe_title oe_inline">
<label for="name" />
<h1><field
name="name"
placeholder="e.g. BNK/2021/0001"
/></h1>
</div>
<group>
<group>
<field name="date" />
<field
name='company_id'
options="{'no_create': True}"
groups="base.group_multi_company"
/>
<field name="currency_id" invisible="1" />
<field name="journal_id" invisible="1" />
</group>
<group>
<label for="balance_start" />
<div>
<field name="balance_start" class="oe_inline" />
</div>
<label for="balance_end_real" />
<div>
<field name="balance_end_real" class="oe_inline" />
</div>
</group>
</group>
<field
name="line_ids"
context="{'default_journal_id': journal_id}"
/>
<group
class="oe_subtotal_footer oe_right"
name="sale_total"
col="1"
>
<field
name="balance_end"
class="oe_subtotal_footer_separator"
/>
</group>
<field name="attachment_ids" widget="many2many_binary" />
<div class="oe_clear" />
</sheet>
</form>
</field>
</record>
<!-- Add form to view mode. -->
<record id="account.action_bank_statement_tree" model="ir.actions.act_window">
<field name="res_model">account.bank.statement</field>

View File

@ -15,7 +15,7 @@
<field name="company_id" invisible="1" />
<field name="currency_id" invisible="1" />
<field name="country_code" invisible="1" />
<field name="state" invisible="1" />
<field5c1485a3 name="state" invisible="1" />
<field name="suitable_journal_ids" invisible="1" />
<field name="date" />
<field name="payment_ref" required="1" />
@ -60,21 +60,36 @@
<record id="account_bank_statement_line_tree" model="ir.ui.view">
<field name="model">account.bank.statement.line</field>
<field name="arch" type="xml">
<tree decoration-muted="is_reconciled">
<field name="sequence" widget="handle" />
<field name="date" />
<field name="payment_ref" />
<field name="ref" optional="hide" />
<field name="partner_id" />
<field name="amount" />
<tree editable="top" multi_edit="1" decoration-muted="is_reconciled">
<field name="sequence" />
<field name="date" readonly="is_reconciled" />
<field name="payment_ref" readonly="is_reconciled" />
<field name="ref" optional="hide" readonly="is_reconciled" />
<field name="transaction_type" optional="hide" />
<field name="account_number" optional="hide" />
<field name="partner_id" readonly="is_reconciled" />
<field name="amount" readonly="is_reconciled" />
<field
name="foreign_currency_id"
optional="hide"
groups="base.group_multi_currency"
readonly="is_reconciled"
/>
<field
name="amount_currency"
optional="hide"
groups="base.group_multi_currency"
readonly="is_reconciled"
/>
<field name="narration" optional="hide" string="Notes" />
<field name="journal_id" optional="hide" />
<field name="partner_bank_id" optional="hide" />
<field name="running_balance" />
<field
name="narration"
optional="hide"
string="Notes"
readonly="is_reconciled"
/>
<field name="journal_id" optional="hide" readonly="is_reconciled" />
<field name="partner_bank_id" optional="hide" readonly="is_reconciled" />
<button
name="action_undo_reconciliation"
type="object"
@ -88,6 +103,8 @@
<field name="foreign_currency_id" column_invisible="True" />
<field name="country_code" column_invisible="True" />
<field name="state" column_invisible="True" />
<field name="suitable_journal_ids" column_invisible="True" />
</tree>
</field>
</record>
@ -103,6 +120,7 @@
/>
<field name="partner_id" />
<field name="date" />
<field name="statement_id" />
<field name="journal_id" domain="[('type', 'in', ('bank', 'cash'))]" />
<field name="amount" />
<separator />