콘텐츠로 건너뛰기
메뉴
커뮤니티에 참여하려면 회원 가입을 하시기 바랍니다.
신고된 질문입니다
2 답글
803 화면

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

아바타
취소
베스트 답변

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)

아바타
취소
베스트 답변

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.

아바타
취소
관련 게시물 답글 화면 활동
3
7월 25
2186
1
4월 25
1637
0
10월 24
1307
4
5월 24
12917
2
5월 24
4171