Bank accounts

This commit is contained in:
2026-04-23 10:59:44 +02:00
parent a1486175f2
commit d8a56637c9
5 changed files with 10 additions and 31 deletions

View File

@@ -397,16 +397,17 @@ Owner technique: `a completer`
- Sur `sale.sale` et `purchase.purchase`, `bank_account` represente le compte
bancaire propre a la `party` du contrat.
- Sur `sale.sale` et `purchase.purchase`, `our_bank_account` represente le
compte bancaire propre a `company.party`.
- Les deux champs sont limites aux comptes bancaires disponibles sur leur
party respective.
compte bancaire utilise par la compagnie courante pour encaisser ou payer.
- `bank_account` est limite aux comptes bancaires de la party du contrat.
- `our_bank_account` reste librement selectionnable parmi les comptes
bancaires disponibles.
- Resultat attendu:
- si plusieurs comptes existent, le compte dont la devise correspond a la
devise du contrat est propose en priorite
- si aucun compte ne matche la devise, le premier compte disponible est
propose
- le champ `Our Bank Account` reste modifiable par l'utilisateur dans le
domaine des comptes de la compagnie
- le champ `Our Bank Account` est pre-rempli depuis les comptes de la
compagnie quand possible, mais sa recherche n'est pas limitee a ces comptes
- Priorite:
- `importante`

View File

@@ -267,13 +267,8 @@ class Purchase(metaclass=PoolMeta):
'bank.account', "Bank Account",
domain=[('id', 'in', Eval('bank_accounts', []))],
depends=['bank_accounts'])
our_bank_accounts = fields.Function(
fields.Many2Many('bank.account', None, None, "Our Bank Accounts"),
'on_change_with_our_bank_accounts')
our_bank_account = fields.Many2One(
'bank.account', "Our Bank Account",
domain=[('id', 'in', Eval('our_bank_accounts', []))],
depends=['our_bank_accounts'])
'bank.account', "Our Bank Account")
from_location = fields.Many2One('stock.location', 'From location', required=True,domain=[('type', "!=", 'customer')])
to_location = fields.Many2One('stock.location', 'To location', required=True,domain=[('type', "!=", 'supplier')])
shipment_in = fields.Many2One('stock.shipment.in','Purchases')
@@ -348,13 +343,6 @@ class Purchase(metaclass=PoolMeta):
return [account.id for account in self.party.bank_accounts]
return []
@fields.depends('company', '_parent_company.party')
def on_change_with_our_bank_accounts(self, name=None):
if (self.company and self.company.party
and self.company.party.bank_accounts):
return [account.id for account in self.company.party.bank_accounts]
return []
@fields.depends(
'company', 'party', 'invoice_party', 'payment_term', 'lines',
'bank_account', 'our_bank_account', '_parent_party.bank_accounts',

View File

@@ -232,13 +232,8 @@ class Sale(metaclass=PoolMeta):
'bank.account', "Bank Account",
domain=[('id', 'in', Eval('bank_accounts', []))],
depends=['bank_accounts'])
our_bank_accounts = fields.Function(
fields.Many2Many('bank.account', None, None, "Our Bank Accounts"),
'on_change_with_our_bank_accounts')
our_bank_account = fields.Many2One(
'bank.account', "Our Bank Account",
domain=[('id', 'in', Eval('our_bank_accounts', []))],
depends=['our_bank_accounts'])
'bank.account', "Our Bank Account")
from_location = fields.Many2One('stock.location', 'From location', required=True,domain=[('type', "!=", 'customer')])
to_location = fields.Many2One('stock.location', 'To location', required=True,domain=[('type', "!=", 'supplier')])
shipment_out = fields.Many2One('stock.shipment.out','Sales')
@@ -312,13 +307,6 @@ class Sale(metaclass=PoolMeta):
return [account.id for account in self.party.bank_accounts]
return []
@fields.depends('company', '_parent_company.party')
def on_change_with_our_bank_accounts(self, name=None):
if (self.company and self.company.party
and self.company.party.bank_accounts):
return [account.id for account in self.company.party.bank_accounts]
return []
@fields.depends(
'company', 'party', 'invoice_party', 'shipment_party', 'warehouse',
'payment_term', 'lines', 'bank_account', 'our_bank_account',

View File

@@ -80,6 +80,7 @@ this repository contains the full copyright notices and license terms. -->
</page>
</xpath>
<xpath expr="/form/notebook/page[@id='info']/label[@name='invoice_party']" position="before">
<field name="bank_accounts" colspan="4" invisible="1"/>
<label name="bank_account"/>
<field name="bank_account"/>
<label name="our_bank_account"/>

View File

@@ -93,6 +93,7 @@ this repository contains the full copyright notices and license terms. -->
<field name="incoterm_location"/>
</xpath>
<xpath expr="/form/notebook/page[@id='other']/label[@name='company']" position="before">
<field name="bank_accounts" colspan="4" invisible="1"/>
<label name="bank_account"/>
<field name="bank_account"/>
<label name="our_bank_account"/>