Skip to Content
Meniu
Trebuie să fiți înregistrat pentru a interacționa cu comunitatea.
Această întrebare a fost marcată
2 Răspunsuri
786 Vizualizări

i tried to import product , but the income and expense field is filled from primary company not the company i import

Note: the account both have a same code and name only the company is different

Imagine profil
Abandonează
Cel mai bun răspuns

Hi Arun,

I also encountered this problem and I solved it by following these steps:

1/ Step 1: Add the company_code field to the res.company model.

class ResCompany(models.Model):

    _inherit = 'res.company'

    company_code = fields.Char(string='Company Code', required=False, readonly=False, copy = False)


​_sql_constraints = [('company_code _uniq', 'unique(company_code)', 'Company Code must be unique')]


2/ Step 2: Override the name_get function of the account.account model

    def name_get(self):

        res = []

        tmp_d_name = False

        for record in self:

            tmp_d_name = '%s %s' % (record.code, record.name)

            if record.company_id :

​ tmp_d_name= '%s - %s' % (record.company_id.company_code,tmp_d_name)

            res.append((record.id, tmp_d_name))

        return res


3/ Step 3: Use the value displayed on the system of the account_id field to import through customizing the import function. You can refer to the following video:

https://www.youtube.com/watch?v=UOBxxnYDIsM&list=PLSKcWRTtEl5qzvRaI-VTGavfReiHS_EEb&index=1  (starting at 37:00 in this video)

Imagine profil
Abandonează
Cel mai bun răspuns

Hello,

In the product master, import the Income and Expense Account using the External ID or the Database ID of the COA. I think it will resolve your issue.

Imagine profil
Abandonează
Related Posts Răspunsuri Vizualizări Activitate
3
iul. 25
2183
1
apr. 25
1635
0
oct. 24
1305
4
mai 24
12911
2
mai 24
4168