[FIX] l10n_fr_pos_cert: disable qrcode for pos french users

Currently, when the company has a french localization and activates the qr code option on the pos bill, if a customer scans the qr code, he will 'inevitably' meet an error:
> According to the french law, you cannot modify a point of sale order. Forbidden fields: date_order, user_id, lines, payment_ids, ...

Steps to reproduce:
-------------------
* Install **France - Accounting**
* Switch to `FR Company`
* Go to the app **Point of Sale**
* Select **Configuration** > **Settings**
* Enable `Use QR code on ticket`
* Open a shop session
* Add anything
* Select/or not a customer
* Select **Payment**
* Select any payment method then validate
* Scan the qr code on the ticket
* Try filling the form and saving
> Observation: Error

Why the fix:
------------
We understand the confusion for french localization users to be presented with a feature which they are not able to use as intended. The Qr code feature was implemented to make it easier and quicker at the cashier but will always end up in an error, unless a client was selected and the invoice was created when validating the payment at the register. But then, it doesn't save time.

Since they are not able to use the feature as intended, we decided to make it unavailable for companies with a french localization.

There has been a lot of discussion about how to solve this issue. However, a lot of the ideas discussed were not doable instable versions and this is the only solution we agreed on.

opw-3704767

closes odoo/odoo#160884

X-original-commit: 6c64c30edbcc660738e66baa46646a3909a93c09
Signed-off-by: Adrien Guilliams (adgu) <adgu@odoo.com>
This commit is contained in:
Sarah Bellefroid
2024-04-11 15:02:48 +00:00
parent 4a434f1282
commit f60d404f20
3 changed files with 20 additions and 0 deletions
+1
View File
@@ -29,6 +29,7 @@ The module adds following features:
'views/pos_views.xml',
'views/account_sale_closure.xml',
'views/pos_inalterability_menuitem.xml',
'views/res_config_settings_views.xml',
'report/pos_hash_integrity.xml',
'data/account_sale_closure_cron.xml',
'security/ir.model.access.csv',
@@ -39,6 +39,9 @@ patch(Order.prototype, {
export_for_printing() {
var result = super.export_for_printing(...arguments);
result.l10n_fr_hash = this.get_l10n_fr_hash();
if (this.pos.is_french_country()){
result.pos_qr_code = false;
}
return result;
},
set_l10n_fr_hash(l10n_fr_hash) {
@@ -0,0 +1,16 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<record id="res_config_settings_view_form" model="ir.ui.view">
<field name="name">res.config.settings.view.form.inherit.l10n_fr_pos_cert</field>
<field name="model">res.config.settings</field>
<field name="inherit_id" ref="point_of_sale.res_config_settings_view_form" />
<field name="arch" type="xml">
<form position="inside">
<field name="country_code" invisible="1"/>
</form>
<xpath expr="//field[@name='point_of_sale_use_ticket_qr_code']/.." position="attributes">
<attribute name="invisible">country_code in ['FR', 'MF', 'MQ', 'NC', 'PF', 'RE', 'GF', 'GP', 'TF']</attribute>
</xpath>
</field>
</record>
</odoo>