mirror of
https://github.com/bringout/oca-ocb-l10n_europe.git
synced 2026-04-26 23:02:07 +02:00
19.0 vanilla
This commit is contained in:
parent
ff721d030e
commit
7721452493
1826 changed files with 124775 additions and 274114 deletions
|
|
@ -1,6 +1,5 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
# Part of Odoo. See LICENSE file for full copyright and licensing details.
|
||||
|
||||
from . import l10n_fr
|
||||
from . import account_chart_template
|
||||
from . import res_company
|
||||
from . import res_partner
|
||||
|
|
|
|||
|
|
@ -1,20 +0,0 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
# Part of Odoo. See LICENSE file for full copyright and licensing details.
|
||||
|
||||
from odoo import api, models
|
||||
|
||||
|
||||
class AccountChartTemplate(models.Model):
|
||||
_inherit = 'account.chart.template'
|
||||
|
||||
@api.model
|
||||
def _prepare_all_journals(self, acc_template_ref, company, journals_dict=None):
|
||||
journal_data = super(AccountChartTemplate, self)._prepare_all_journals(
|
||||
acc_template_ref, company, journals_dict)
|
||||
if company.account_fiscal_country_id.code != 'FR':
|
||||
return journal_data
|
||||
|
||||
for journal in journal_data:
|
||||
if journal['type'] in ('sale', 'purchase'):
|
||||
journal.update({'refund_sequence': True})
|
||||
return journal_data
|
||||
|
|
@ -1,9 +0,0 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
# Part of Odoo. See LICENSE file for full copyright and licensing details.
|
||||
from odoo import fields, models, api, _
|
||||
|
||||
|
||||
class ResPartner(models.Model):
|
||||
_inherit = 'res.partner'
|
||||
|
||||
siret = fields.Char(string='SIRET', size=14)
|
||||
|
|
@ -8,7 +8,6 @@ class ResCompany(models.Model):
|
|||
_inherit = 'res.company'
|
||||
|
||||
l10n_fr_closing_sequence_id = fields.Many2one('ir.sequence', 'Sequence to use to build sale closings', readonly=True)
|
||||
siret = fields.Char(related='partner_id.siret', string='SIRET', size=14, readonly=False)
|
||||
ape = fields.Char(string='APE')
|
||||
is_france_country = fields.Boolean(
|
||||
compute="_compute_is_france_country",
|
||||
|
|
@ -26,14 +25,10 @@ class ResCompany(models.Model):
|
|||
"""
|
||||
return ['FR', 'MF', 'MQ', 'NC', 'PF', 'RE', 'GF', 'GP', 'TF', 'BL', 'PM', 'YT', 'WF'] # These codes correspond to France and DOM-TOM.
|
||||
|
||||
@api.model
|
||||
def _get_unalterable_country(self):
|
||||
return self._get_france_country_codes()
|
||||
|
||||
def _is_accounting_unalterable(self):
|
||||
if not self.vat and not self.country_id:
|
||||
return False
|
||||
return self.country_id and self.country_id.code in self._get_unalterable_country()
|
||||
return self.country_id and self.country_id.code in self._get_france_country_codes()
|
||||
|
||||
@api.model_create_multi
|
||||
def create(self, vals_list):
|
||||
|
|
@ -64,7 +59,7 @@ class ResCompany(models.Model):
|
|||
for seq_field in sequence_fields:
|
||||
if not company[seq_field]:
|
||||
vals = {
|
||||
'name': _('Securisation of %s - %s') % (seq_field, company.name),
|
||||
'name': _('Securisation of %(field)s - %(company)s', field=seq_field, company=company.name),
|
||||
'code': 'FRSECURE%s-%s' % (company.id, seq_field),
|
||||
'implementation': 'no_gap',
|
||||
'prefix': '',
|
||||
|
|
|
|||
12
odoo-bringout-oca-ocb-l10n_fr/l10n_fr/models/res_partner.py
Normal file
12
odoo-bringout-oca-ocb-l10n_fr/l10n_fr/models/res_partner.py
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
from odoo import api, fields, models
|
||||
|
||||
|
||||
class ResPartner(models.Model):
|
||||
_inherit = 'res.partner'
|
||||
|
||||
l10n_fr_is_french = fields.Boolean(compute='_compute_l10n_fr_is_french')
|
||||
|
||||
@api.depends('country_code')
|
||||
def _compute_l10n_fr_is_french(self):
|
||||
for partner in self:
|
||||
partner.l10n_fr_is_french = partner.country_code in self.env['res.company']._get_france_country_codes()
|
||||
Loading…
Add table
Add a link
Reference in a new issue