mirror of
https://github.com/bringout/oca-ocb-l10n_americas.git
synced 2026-04-26 20:52:03 +02:00
19.0 vanilla
This commit is contained in:
parent
89c6e82fe7
commit
1b82c20a58
572 changed files with 43570 additions and 53303 deletions
|
|
@ -1,5 +1,3 @@
|
|||
# coding: utf-8
|
||||
# Part of Odoo. See LICENSE file for full copyright and licensing details.
|
||||
|
||||
from . import template_co
|
||||
from . import l10n_latam_identification_type
|
||||
from . import res_partner
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
from odoo import models, fields
|
||||
|
||||
|
||||
class L10nCoDocumentType(models.Model):
|
||||
class L10n_LatamIdentificationType(models.Model):
|
||||
_inherit = "l10n_latam.identification.type"
|
||||
|
||||
l10n_co_document_code = fields.Char("Document Code")
|
||||
|
|
|
|||
|
|
@ -1,20 +0,0 @@
|
|||
# coding: utf-8
|
||||
# Part of Odoo. See LICENSE file for full copyright and licensing details.
|
||||
from odoo import models, api
|
||||
|
||||
|
||||
class ResPartner(models.Model):
|
||||
_inherit = 'res.partner'
|
||||
|
||||
@api.constrains('vat', 'country_id', 'l10n_latam_identification_type_id')
|
||||
def check_vat(self):
|
||||
# check_vat is implemented by base_vat which this localization
|
||||
# doesn't directly depend on. It is however automatically
|
||||
# installed for Colombia.
|
||||
if self.sudo().env.ref('base.module_base_vat').state == 'installed':
|
||||
# don't check Colombian partners unless they have RUT (= Colombian VAT) set as document type
|
||||
self = self.filtered(lambda partner: partner.country_id.code != "CO" or\
|
||||
partner.l10n_latam_identification_type_id.l10n_co_document_code == 'rut')
|
||||
return super(ResPartner, self).check_vat()
|
||||
else:
|
||||
return True
|
||||
48
odoo-bringout-oca-ocb-l10n_co/l10n_co/models/template_co.py
Normal file
48
odoo-bringout-oca-ocb-l10n_co/l10n_co/models/template_co.py
Normal file
|
|
@ -0,0 +1,48 @@
|
|||
# Part of Odoo. See LICENSE file for full copyright and licensing details.
|
||||
from odoo import models
|
||||
from odoo.addons.account.models.chart_template import template
|
||||
|
||||
|
||||
class AccountChartTemplate(models.AbstractModel):
|
||||
_inherit = 'account.chart.template'
|
||||
|
||||
@template('co')
|
||||
def _get_co_template_data(self):
|
||||
return {
|
||||
'property_account_receivable_id': 'co_puc_130500',
|
||||
'property_account_payable_id': 'co_puc_220500',
|
||||
}
|
||||
|
||||
@template('co', 'res.company')
|
||||
def _get_co_res_company(self):
|
||||
return {
|
||||
self.env.company.id: {
|
||||
'anglo_saxon_accounting': True,
|
||||
'account_fiscal_country_id': 'base.co',
|
||||
'bank_account_code_prefix': '1110',
|
||||
'cash_account_code_prefix': '1105',
|
||||
'transfer_account_code_prefix': '1115',
|
||||
'account_default_pos_receivable_account_id': 'co_puc_130507',
|
||||
'income_currency_exchange_account_id': 'co_puc_421005',
|
||||
'expense_currency_exchange_account_id': 'co_puc_530505',
|
||||
'account_journal_early_pay_discount_loss_account_id': 'co_puc_530535',
|
||||
'account_journal_early_pay_discount_gain_account_id': 'co_puc_421040',
|
||||
'account_sale_tax_id': 'l10n_co_tax_8',
|
||||
'account_purchase_tax_id': 'l10n_co_tax_1',
|
||||
'default_cash_difference_income_account_id': 'co_puc_428000',
|
||||
'default_cash_difference_expense_account_id': 'co_puc_532000',
|
||||
'expense_account_id': 'co_puc_610000',
|
||||
'income_account_id': 'co_puc_417500',
|
||||
'account_stock_journal_id': 'inventory_valuation',
|
||||
'account_stock_valuation_id': 'co_puc_140500',
|
||||
},
|
||||
}
|
||||
|
||||
@template('co', 'account.account')
|
||||
def _get_co_account_account(self):
|
||||
return {
|
||||
'co_puc_140500': {
|
||||
'account_stock_expense_id': 'co_puc_621000',
|
||||
'account_stock_variation_id': 'co_puc_146501',
|
||||
},
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue