Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ

I am trying to create a custom localization for a mexican company ('samplex' is going to be tha name), an that localization I must add a different chart of account but using the same taxes of the mexican localization, so i used the following code:

class AccountChartTemplate(models.AbstractModel):
    _inherit = "account.chart.template"

    @template("mx_samplex")
    def _get_mx_samplex_template_data(self):
        return {
            "name": _("samplex"),
            'parent': 'mx',
            "code_digits": "16",
            "display_invoice_amount_total_words": True,
            "property_account_receivable_id": "samplex_1000000000000000",
            "property_account_payable_id": "samplex_1000000100000000",
            "property_account_expense_categ_id": "samplex_1010000000000000",
            "property_account_income_categ_id": "samplex_1010000100000000",
            "property_stock_account_input_categ_id": "samplex_1010000100010000",
            "property_stock_account_output_categ_id": "samplex_1020000100000000",
            "property_stock_valuation_account_id": "samplex_1020000100030000",
            "property_cash_basis_base_account_id": "samplex_1020000100060000",
        }

    @template("mx_samplex", "res.company")
    def _get_mx_samplex_res_company(self):
        return {
            self.env.company.id: {
                "anglo_saxon_accounting": True,
                "account_fiscal_country_id": "base.mx",
                #"bank_account_code_prefix": "1010",
                #"cash_account_code_prefix": "1020",
                #"transfer_account_code_prefix": "1010.1",
                "account_default_pos_receivable_account_id": "samplex_1050000100000000",
                "income_currency_exchange_account_id": "samplex_1000000000000000",
                "expense_currency_exchange_account_id": "samplex_1010000100000000",
                "account_journal_early_pay_discount_loss_account_id": "samplex_1700000000000000",
                "account_journal_early_pay_discount_gain_account_id": "samplex_4030000000000000",
                # nuevas
                "account_journal_suspense_account_id": "samplex_1070000100010003",
                "account_journal_payment_debit_account_id": "samplex_1070000100010001",
                "account_journal_payment_credit_account_id": "samplex_1070000100010002",
                "default_cash_difference_income_account_id": "samplex_4030000100000000",
                "default_cash_difference_expense_account_id": "samplex_1700000200010000",
                "transfer_account_id": "samplex_2030000100000000",
                # 'tax_cash_basis_journal_id': 'cbmx',
                # 'account_sale_tax_id': 'tax12',
                # 'account_purchase_tax_id': 'tax14',
            },
        }

We assume that the chart of account is defined in the account.account-mx_samplex.csv file

So, when I install the module I am getting an error

raise ValueError('External ID not found in the system: %s' % xmlid)
ValueError: External ID not found in the system: account.1_tax12

So, the question here is how to create a custom localization based on the mexican localization. Also I want to load only the chart of account of the samplex company and not of the mexican localization. But I do wanted to use the taxes defined in the mexican localization. I am working with Odoo 17

Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
1
thg 12 24
1375
1
thg 11 24
1899
1
thg 11 24
1541
1
thg 10 24
2184
1
thg 7 24
2999