[FIX] l10n_fr_certification: main module
Main resource document to be found at https://www.economie.gouv.fr/files/files/directions_services/dgfip/controle_fiscal/actualites_reponses/logiciels_de_caisse.pdf
This document states that only business operations with partners not being subject to VAT should be inalterable and secure.
We adpat the module by differentiating between b2c and b2b journals and apply hashing on the former's moves
Protection against account_cancel is not necessary anymore
By default, this module considers a sales journal being a b2c, thus activating hashing on its move.
Since we can't afford to lose information, when a b2c journal contains hashed moves, its b2c characteristic cannot be changed
[ADD] l10n_fr_pos_cert: module to adapt the POS to the recent French regulation CGI art. 286, I. 3° bis.
The module adds following features:
- Inalterability: deactivation of all the ways to cancel or modify key data of POS orders, invoices and journal entries
- Security: chaining algorithm to verify the inalterability
- Access to download the mandatory Certificate of Conformity delivered by Odoo SA (only for Odoo Enterprise users)
[ADD] l10n_fr_sale_closing: module to store automatically the total of daily/monthly/annualy sales.
(both of the period and cumulative).
This fulfills another requirement brought by the recent French regulation CGI art. 286, I. 3° bis related to the storage of data
Adaptation of #20581 for version 11.0.
22 lines
864 B
Python
22 lines
864 B
Python
# -*- coding: utf-8 -*-
|
|
# Part of Odoo. See LICENSE file for full copyright and licensing details.
|
|
|
|
from . import models
|
|
from odoo import api, SUPERUSER_ID
|
|
from .models.res_company import UNALTERABLE_COUNTRIES
|
|
|
|
|
|
def _setup_inalterability(cr, registry):
|
|
env = api.Environment(cr, SUPERUSER_ID, {})
|
|
# enable ping for this module
|
|
env['publisher_warranty.contract'].update_notification(cron_mode=True)
|
|
|
|
fr_companies = env['res.company'].search([('partner_id.country_id.code', 'in', UNALTERABLE_COUNTRIES)])
|
|
if fr_companies:
|
|
# create the securisation sequence per company
|
|
fr_companies._create_secure_sequence(['l10n_fr_secure_sequence_id'])
|
|
|
|
#reset the update_posted field on journals
|
|
journals = env['account.journal'].search([('company_id', 'in', fr_companies.ids)])
|
|
journals.write({'update_posted': False})
|