mirror of
https://gitlab.com/flectra-community/l10n-switzerland-flectra.git
synced 2024-11-16 19:12:04 +00:00
🐛 partner bank not set automatically on customer invoices
->l10n_ch_account_payment_partner
This commit is contained in:
parent
5f1d86fba7
commit
681a0990eb
3
l10n_ch_account_payment_partner/__init__.py
Normal file
3
l10n_ch_account_payment_partner/__init__.py
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
|
||||||
|
|
||||||
|
from . import models
|
14
l10n_ch_account_payment_partner/__manifest__.py
Normal file
14
l10n_ch_account_payment_partner/__manifest__.py
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
{
|
||||||
|
"name": "Account Payment Partner for Switzerland",
|
||||||
|
"version": "2.0.1.0.0",
|
||||||
|
"category": "Banking addons",
|
||||||
|
"license": "AGPL-3",
|
||||||
|
"summary": "Set partner bank on outgoing invoices",
|
||||||
|
"author": "Jamotion GmbH",
|
||||||
|
"website": "https://jamotion.ch",
|
||||||
|
"depends": ["account_payment_partner", "l10n_ch"],
|
||||||
|
"data": [],
|
||||||
|
"demo": [],
|
||||||
|
"installable": True,
|
||||||
|
"auto_install": True,
|
||||||
|
}
|
1
l10n_ch_account_payment_partner/models/__init__.py
Normal file
1
l10n_ch_account_payment_partner/models/__init__.py
Normal file
@ -0,0 +1 @@
|
|||||||
|
from . import account_move
|
39
l10n_ch_account_payment_partner/models/account_move.py
Normal file
39
l10n_ch_account_payment_partner/models/account_move.py
Normal file
@ -0,0 +1,39 @@
|
|||||||
|
# Copyright 2014-16 Akretion - Alexis de Lattre <alexis.delattre@akretion.com>
|
||||||
|
# Copyright 2014 Serv. Tecnol. Avanzados - Pedro M. Baeza
|
||||||
|
# Copyright 2021 Tecnativa - Víctor Martínez
|
||||||
|
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
|
||||||
|
|
||||||
|
from flectra import api, fields, models
|
||||||
|
|
||||||
|
|
||||||
|
class AccountMove(models.Model):
|
||||||
|
_inherit = "account.move"
|
||||||
|
|
||||||
|
@api.depends("partner_id", "payment_mode_id")
|
||||||
|
def _compute_partner_bank(self):
|
||||||
|
for move in self:
|
||||||
|
# No bank account assignation is done for out_invoice as this is only
|
||||||
|
# needed for printing purposes and it can conflict with
|
||||||
|
# SEPA direct debit payments. Current report prints it.
|
||||||
|
def get_bank_id():
|
||||||
|
return move.commercial_partner_id.bank_ids.filtered(
|
||||||
|
lambda b: b.company_id == move.company_id or not b.company_id
|
||||||
|
)[:1]
|
||||||
|
|
||||||
|
bank_id = False
|
||||||
|
if move.partner_id:
|
||||||
|
pay_mode = move.payment_mode_id
|
||||||
|
if move.move_type == "in_invoice":
|
||||||
|
if (
|
||||||
|
pay_mode
|
||||||
|
and pay_mode.payment_type == "outbound"
|
||||||
|
and pay_mode.payment_method_id.bank_account_required
|
||||||
|
and move.commercial_partner_id.bank_ids
|
||||||
|
):
|
||||||
|
bank_id = get_bank_id()
|
||||||
|
elif move.move_type == 'out_invoice':
|
||||||
|
if pay_mode.bank_account_link == 'fixed':
|
||||||
|
bank_id = pay_mode.fixed_journal_id.bank_account_id
|
||||||
|
|
||||||
|
if bank_id:
|
||||||
|
move.partner_bank_id = bank_id
|
BIN
l10n_ch_account_payment_partner/static/description/icon.png
Normal file
BIN
l10n_ch_account_payment_partner/static/description/icon.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 14 KiB |
@ -0,0 +1,94 @@
|
|||||||
|
<div class="mt32" style="max-width: 1024px; margin: 0 auto;">
|
||||||
|
<section class="container bg-gray-lighter oe_screenshot">
|
||||||
|
<div class="row oe_spaced">
|
||||||
|
<div class="col-md-12">
|
||||||
|
<!-- The module's display name can differ from its technical name -->
|
||||||
|
<h2 class="oe_slogan" style="color: #FF7E00;">Set bank on customer invoices</h2>
|
||||||
|
<h3 class="oe_slogan">Set bank of payment mode or default bank</h3>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
|
||||||
|
<section class="container">
|
||||||
|
<div class="row oe_spaced">
|
||||||
|
<h2 class="oe_slogan col-12" style="color: #FF7E00;">Quick Start</h2>
|
||||||
|
<div class="col-4">
|
||||||
|
<h3 class='oe_slogan'>Installation</h3>
|
||||||
|
<div>
|
||||||
|
<p class="oe_mt32">
|
||||||
|
There are no dependencies so you can simply install the module.
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="col-4">
|
||||||
|
<h3 class='oe_slogan'>Configuration</h3>
|
||||||
|
<div>
|
||||||
|
<p class="oe_mt32">
|
||||||
|
Nothing to configure. Just use it...
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="col-4">
|
||||||
|
<h3 class='oe_slogan'>Usage</h3>
|
||||||
|
<div>
|
||||||
|
<p class="oe_mt32">
|
||||||
|
Create a customer invoice, select partner and the bank will be set automatically.
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
|
||||||
|
<section class="oe_container">
|
||||||
|
<div class="oe_mt16 oe_mb16">
|
||||||
|
<h2 class="oe_slogan col-12" style="color: #ff7e00;">Need more?</h2>
|
||||||
|
<h3 class="oe_slogan col-12">Other available modules</h3>
|
||||||
|
</div>
|
||||||
|
<div class="row oe_spaced">
|
||||||
|
<div class="col-4">
|
||||||
|
<h4>Module 1</h4>
|
||||||
|
<p class="text-justify">
|
||||||
|
Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt
|
||||||
|
ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo
|
||||||
|
dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor
|
||||||
|
sit amet. Lorem ipsum dolor sit amet.</p>
|
||||||
|
</div>
|
||||||
|
<div class="col-4 oe_screenshot">
|
||||||
|
<h4>Module 2</h4>
|
||||||
|
<p class="text-justify">
|
||||||
|
Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt
|
||||||
|
ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo
|
||||||
|
dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor
|
||||||
|
sit amet. Lorem ipsum dolor sit amet.</p>
|
||||||
|
</div>
|
||||||
|
<div class="col-4">
|
||||||
|
<h4>Module 3</h4>
|
||||||
|
<p class="text-justify">Some words about the module</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="clearfix mt16"/>
|
||||||
|
<div class="oe_mt16 oe_mb16">
|
||||||
|
<h3 class="oe_slogan">Get in Touch!</h3>
|
||||||
|
</div>
|
||||||
|
<div class="oe_slogan">
|
||||||
|
<a href="mailto:support@jamotion.ch"
|
||||||
|
class="btn btn-primary btn-lg mt8"
|
||||||
|
style="color: #FFFFFF !important;">
|
||||||
|
<i class="fa fa-envelope"></i> Email
|
||||||
|
</a>
|
||||||
|
<a href="https://www.jamotion.ch/contact-ext?name=sale_timesheet_period"
|
||||||
|
class="btn btn-primary btn-lg mt8"
|
||||||
|
style="color: #FFFFFF !important;"
|
||||||
|
target="_blank">
|
||||||
|
<i class="fa fa-phone"></i> Contact Us
|
||||||
|
</a>
|
||||||
|
<a href="https://www.jamotion.ch/request-customization?name=sale_timesheet_period"
|
||||||
|
class="btn btn-primary btn-lg mt8"
|
||||||
|
style="color: #FFFFFF !important;"
|
||||||
|
target="_blank">
|
||||||
|
<i class="fa fa-check-square"></i> Request Customization
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
</div>
|
Binary file not shown.
After Width: | Height: | Size: 160 KiB |
Binary file not shown.
After Width: | Height: | Size: 54 KiB |
Loading…
Reference in New Issue
Block a user