2018-01-16 06:58:15 +01:00
|
|
|
# -*- coding: utf-8 -*-
|
2018-01-16 11:34:37 +01:00
|
|
|
# Part of Odoo, Flectra. See LICENSE file for full copyright and licensing details.
|
2018-01-16 06:58:15 +01:00
|
|
|
|
2018-01-16 11:34:37 +01:00
|
|
|
from flectra import fields, models
|
2018-01-16 06:58:15 +01:00
|
|
|
|
|
|
|
|
|
|
|
class ResCompany(models.Model):
|
|
|
|
_inherit = 'res.company'
|
|
|
|
|
|
|
|
siret = fields.Char(related='partner_id.siret', string='SIRET', size=14)
|
|
|
|
ape = fields.Char(string='APE')
|
|
|
|
|
|
|
|
class ResPartner(models.Model):
|
|
|
|
_inherit = 'res.partner'
|
|
|
|
|
|
|
|
siret = fields.Char(string='SIRET', size=14)
|
|
|
|
|
|
|
|
class ChartTemplate(models.Model):
|
|
|
|
_inherit = 'account.chart.template'
|
|
|
|
|
|
|
|
def _prepare_all_journals(self, acc_template_ref, company, journals_dict=None):
|
|
|
|
journals = super(ChartTemplate, self)._prepare_all_journals(acc_template_ref, company, journals_dict)
|
|
|
|
if company.country_id == self.env.ref('base.fr'):
|
|
|
|
#For France, sale/purchase journals must have a dedicated sequence for refunds
|
|
|
|
for journal in journals:
|
|
|
|
if journal['type'] in ['sale', 'purchase']:
|
|
|
|
journal['refund_sequence'] = True
|
|
|
|
return journals
|