Skip to content

Commit 63e4e07

Browse files
committed
[FIX] l10n_be,point_of_sale: exclude non-trade receivable partners from POS
This commit removes the partners with non-trade receivable accounts from the POS customer's list. Additionally, 2 new VAT accounts were added in BE COA to be added on "Collection Center" partner. task-5148985 closes odoo#233360 Related: odoo/enterprise#98224 Signed-off-by: John Laterre (jol) <[email protected]>
1 parent 7f7ca3c commit 63e4e07

File tree

6 files changed

+26
-3
lines changed

6 files changed

+26
-3
lines changed

addons/l10n_be/data/template/account.account-be.csv

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,7 @@
164164
"a409","Trade Debtors - Write-Downs (-)","409","asset_current","","False","","Créances commerciales - Réductions de valeur (-)","Handelsvorderingen - Waardeverminderingen (-)","Forderungen aus Lieferungen und Leistungen - Wertminderungen (-)","","","","","",""
165165
"a411","VAT Recoverable","411","asset_current","","False","","TVA à récupérer","Terug te vorderen btw","Zurück zu erhaltende Mehrwertsteuer","","","","","",""
166166
"a4112","VAT Recoverable: VAT Current Account (C/A)","4112","asset_receivable","","True","True","TVA à récupérer : Compte courant TVA (C/C)","Terug te vorderen btw: Rekening-courant btw (RC)","Zurück zu erhaltende Mehrwertsteuer: Girokonto-MwSt","","","","","",""
167+
"a4121","Advance Tax Payment","4121","asset_receivable","","True","True","Paiement anticipé de l'impôt","Vooruitbetaling van belasting","Vorauszahlung von Steuern","","","","","",""
167168
"a4125","Other Belgian Taxes to Be Recovered","4125","asset_current","","False","","Autres impôts et taxes belges à récupérer","Terug te vorderen andere Belgische belastingen","Zurück zu erhaltende sonstige belgische Steuern","","","","","",""
168169
"a4128","Foreign Taxes to Be Recovered","4128","asset_current","","False","","Impôts et taxes étrangers à récupérer","Terug te vorderen buitenlandse belastingen","Zurück zu erhaltende ausländische Steuern","","","","","",""
169170
"a414","Income Receivable","414","asset_current","","False","","Produits à recevoir","Te innen opbrengsten","Zu erhaltende Erträge","","","","","",""
@@ -200,6 +201,7 @@
200201
"a451800","VAT Payable - Insufficient Taxation","451800","liability_current","","False","","TVA à payer - Taxation insuffisante","Te betalen btw - Ontoereikende heffing","Zu zahlende Mehrwertsteuer - Unzureichende Besteuerung","","","","","",""
201202
"a451820","VAT Payable - Deduction Revisions","451820","liability_current","","False","","TVA à payer - Révisions des déductions","Te betalen btw - Herzieningen aftrek","Zu zahlende Mehrwertsteuer - Abzugsrevisionen","","","","","",""
202203
"a451830","VAT Payable - Regularizations","451830","liability_current","","False","","TVA à payer - Régularisations","Te betalen btw - Regularisaties","Zu zahlende Mehrwertsteuer - Regularisierungen","","","","","",""
204+
"a4521","Advance Tax Payment","4521","liability_payable","","True","True","Paiement anticipé de l'impôt","Vooruitbetaling van belasting","Vorauszahlung von Steuern","","","","","",""
203205
"a4525","Other Belgian Taxes Payable","4525","liability_current","","False","","Autres impôts et taxes belges à payer","Andere te betalen Belgische belastingen en taksen","Sonstige zu zahlende belgische Steuern und Abgaben","","","","","",""
204206
"a4528","Foreign Taxes Payable","4528","liability_current","","False","","Impôts et taxes étrangers à payer","Te betalen buitenlandse belastingen en taksen","Zu zahlende ausländische Steuern und Abgaben","","","","","",""
205207
"a453","Taxes Withheld","453","liability_current","","False","","Précomptes retenus","Ingehouden voorheffingen","Einbehaltene Steuervorhabzüge","","","","","",""

addons/point_of_sale/models/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
from . import account_bank_statement
44
from . import pos_load_mixin
5+
from . import account_account
56
from . import account_cash_rounding
67
from . import account_payment
78
from . import account_journal
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
from odoo import api, models
2+
3+
4+
class AccountAccount(models.Model):
5+
_name = 'account.account'
6+
_inherit = ['account.account', 'pos.load.mixin']
7+
8+
@api.model
9+
def _load_pos_data_fields(self, config):
10+
return [
11+
'id', 'non_trade',
12+
]
13+
14+
@api.model
15+
def _load_pos_data_domain(self, data, config):
16+
property_account_receivable_ids = {partner['property_account_receivable_id'] for partner in data['res.partner']}
17+
return [('id', 'in', property_account_receivable_ids)]

addons/point_of_sale/models/pos_session.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ def _load_pos_data_models(self, config):
141141
'pos.category', 'pos.bill', 'res.company', 'account.tax', 'account.tax.group', 'product.template', 'product.product', 'product.attribute', 'product.attribute.custom.value',
142142
'product.template.attribute.line', 'product.template.attribute.value', 'product.template.attribute.exclusion', 'product.combo', 'product.combo.item', 'res.users', 'res.partner', 'product.uom',
143143
'decimal.precision', 'uom.uom', 'res.country', 'res.country.state', 'res.lang', 'product.category', 'product.pricelist', 'product.pricelist.item',
144-
'account.cash.rounding', 'account.fiscal.position', 'stock.picking.type', 'res.currency', 'pos.note', 'product.tag', 'ir.module.module', 'account.move']
144+
'account.cash.rounding', 'account.fiscal.position', 'stock.picking.type', 'res.currency', 'pos.note', 'product.tag', 'ir.module.module', 'account.move', 'account.account']
145145

146146
@api.model
147147
def _load_pos_data_domain(self, data, config):

addons/point_of_sale/models/res_partner.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ def _load_pos_data_fields(self, config):
7474
return [
7575
'id', 'name', 'street', 'street2', 'city', 'state_id', 'country_id', 'vat', 'lang', 'phone', 'zip', 'email',
7676
'barcode', 'write_date', 'property_product_pricelist', 'parent_name', 'pos_contact_address',
77-
'invoice_emails', 'fiscal_position_id', 'is_company',
77+
'invoice_emails', 'fiscal_position_id', 'is_company', 'property_account_receivable_id',
7878
]
7979

8080
def _compute_pos_order(self):

addons/point_of_sale/static/src/app/screens/partner_list/partner_list.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,10 @@ export class PartnerList extends Component {
2929
this.modalRef = useChildRef();
3030
this.modalContent = null;
3131
this.state = useState({
32-
initialPartners: this.pos.models["res.partner"].getAll(),
32+
initialPartners: this.pos.models["res.partner"].filter((p) => {
33+
const par = p.property_account_receivable_id;
34+
return !par || par.non_trade !== true;
35+
}),
3336
loadedPartners: [],
3437
query: "",
3538
loading: false,

0 commit comments

Comments
 (0)