콘텐츠로 건너뛰기
Odoo 메뉴
  • 로그인
  • 무료 체험하기
  • 앱
    재무 관리
    • 회계
    • 청구서 관리
    • 비용 관리
    • 스프레드시트 (BI)
    • 문서
    • 전자 서명
    판매
    • CRM
    • 판매
    • POS 스토어
    • POS 레스토랑
    • 구독
    • 렌탈
    웹사이트
    • 웹사이트 빌더
    • 이커머스
    • 블로그
    • 포럼
    • 실시간 채팅
    • 온라인 학습 관리
    공급망
    • 재고 관리
    • 제조 관리
    • 제품 수명주기 관리 (PLM)
    • 매입
    • 유지관리
    • 품질
    인적자원 관리
    • 직원
    • 채용
    • 휴가 관리
    • 인사 평가
    • 인재 추천
    • 차량 관리
    마케팅
    • 소셜 마케팅
    • 이메일 마케팅
    • SMS 마케팅
    • 행사
    • 마케팅 자동화
    • 설문 조사
    서비스
    • 프로젝트
    • 작업 기록
    • 현장 서비스
    • 헬프데스크
    • 일정 관리
    • 일정 예약
    생산성
    • 메일 및 채팅
    • 전자 결재
    • IoT
    • VoIP
    • 지식 센터
    • WhatsApp
    타사 앱 Odoo 스튜디오 Odoo 클라우드 플랫폼
  • 인더스트리
    리테일
    • 서점
    • 의류 매장
    • 가구점
    • 식료품점
    • 철물점
    • 장난감 가게
    식음료 & 숙박업
    • 바 & 펍
    • 레스토랑
    • 패스트푸드
    • 게스트 하우스
    • 음료 유통업체
    • 호텔
    부동산
    • 부동산 중개업체
    • 건축 회사
    • 건설
    • 부동산 관리
    • 가드닝
    • 부동산 소유자 협회
    컨설팅
    • 회계 법인
    • Odoo 파트너
    • 마케팅 대행사
    • 법률 사무소
    • 인재 영입
    • 감사 및 인증
    제조 관리
    • 텍스타일
    • 메탈
    • 가구
    • 푸드
    • 양조장
    • 기업용 선물
    건강 & 피트니스
    • 스포츠 클럽
    • 안경점
    • 피트니스 센터
    • 웰니스 전문가
    • 약국
    • 미용실
    사업
    • 핸디맨
    • IT 하드웨어 및 지원 서비스
    • 태양 에너지 시스템
    • 제화업체
    • 클리닝 서비스
    • HVAC 서비스
    기타
    • 비영리 단체
    • 환경 에이전시
    • 광고판 임대
    • 사진
    • 자전거 임대
    • 소프트웨어 리셀러
    전체 인더스트리 찾아보기
  • 커뮤니티
    학습
    • 튜토리얼
    • 문서
    • 인증
    • 훈련
    • 블로그
    • 팟캐스트
    교육 역량 강화
    • 교육 프로그램
    • Scale-Up! 경영관리 게임
    • Odoo에 방문해보세요
    소프트웨어 신청
    • 다운로드
    • 버전 살펴보기
    • 릴리즈 내역
    협업
    • Github
    • 포럼
    • 행사
    • 번역
    • 파트너 등록
    • 파트너 대상 서비스
    • 회계 법인 정보 등록
    서비스 신청
    • 파트너 검색
    • 회계사 검색
    • 전문 상담 예약
    • 구현 서비스
    • 고객 정보
    • 고객 지원
    • 업그레이드
    Github 유튜브 트위터 링크드인 인스타그램 페이스북 스포티파이
    +1 (650) 691-3277
    데모 예약하기
  • 요금제
  • 고객 지원

Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:

  • CRM
  • e-Commerce
  • 회계
  • 재고 관리
  • PoS
  • 프로젝트
  • MRP
All apps
커뮤니티에 참여하려면 회원 가입을 하시기 바랍니다.
모든 게시물 사용자 배지
태그 (모두 보기)
odoo accounting v14 pos v15
게시판 정보
커뮤니티에 참여하려면 회원 가입을 하시기 바랍니다.
모든 게시물 사용자 배지
태그 (모두 보기)
odoo accounting v14 pos v15
게시판 정보
도움말

TypeError: 'int' object is not iterable RML

구독

이 게시물에 활동이 있으면 알림 받기

신고된 질문입니다
rmlopenerp7
18 답글
9649 화면
아바타
Rihene

Hi my friends!!

I am working with RML in OpenER

In fact, i am creating two loop functions.

The first is to know the size of my array and divide it by 6 as bellow:

def get_employee_taille(self, company_id, date_start, date_end, context=None):

res_list=[]

res_list2=[]

i = 0

obj2 = company_id.id

payslip_line = self.pool.get('hr.payslip')

obj_ids = payslip_line.search(self.cr, self.uid, [('date_from', '=', date_start), ('date_to', '=', date_end), ('company_id', '=', obj2)])

for res in payslip_line.read(self.cr, self.uid, obj_ids, ['id', 'employee_id'], context=False):

print res['employee_id'][1]

obj = {}

obj['name'] = res['employee_id'][1]

res_list.append(obj)

taille = len (res_list) / 6

print taille

return taille

And the second is to give the array a position start and the number of columns that it have to contain.

def get_employee_lines(self, company_id, date_start, date_end, start_position, number_of_columns, context=None):
print ('--------------------MOMO----------------------')
i = 0
res_list=[]
print ('--------------------test me----------------------')
print company_id
obj2 = company_id.id
payslip_line = self.pool.get('hr.payslip')
print payslip_line
obj_ids = payslip_line.search(self.cr, self.uid, [('date_from', '=', date_start), ('date_to', '=', date_end), ('company_id', '=', obj2)])
print obj_ids
for res in payslip_line.read(self.cr, self.uid, obj_ids, ['id', 'employee_id','seetek_worked_day','hours_overtime_100','seetek_absence_day','total_brut','retenue_source','net_payer'], context=False):
print res['employee_id'][1]
obj = {}
obj['name'] = res['employee_id'][1]
obj['matricule'] = str (res['employee_id'][0])
obj['presence'] = str (res['seetek_worked_day'])
obj['heures_sup'] = str (res['hours_overtime_100'])
obj['absence'] = str (res['seetek_absence_day'])
obj['total_brut'] = str (res['total_brut'])
obj['retenue_source'] = str ( - res['retenue_source'])
obj['net_payer'] = str (res['net_payer'])
obj['cnss_sal'] = str (res['total_brut'] * 9.18)
obj['cnss_pat'] = str (res['total_brut'] * 16.57)
obj['salaire_imposable'] = str ( -res['total_brut'] * (1-9.18))
res_list.append(obj)
print res_list
print res_list[0:2]
end_position = start_position + number_of_columns
return res_list[start_position:end_position]

Now, in my rml, i want to create a report which will give me the list of employees but with 6 employees per page.

<section>

<blockTable colwidths="150,100,100,100,100,100" style="Table1">

<section>

<para style="P7">[[ repeatIn(get_employee_taille(example.company_id,example.date_start,example.date_end), 'o') ]]</para>

<tr>

<td>

<para style="P8">NOM EMPLOYÉ</para>

</td>

<td>

<para style="P7">[[ repeatIn(get_employee_lines(example.company_id,example.date_start,example.date_end, 0, 6), 'o', 'td') ]]</para>

<para style="P7">[[ o['name'] ]]</para>

</td>

</tr>

</section>

I have tried this but it doesnt work and give me this error:

TypeError: 'int' object is not iterable

Help please help help help help

0
아바타
취소
Pawan

Drees,
Are you returning the list well from py file??
if no, please check it by printing list what u r returning before return statement. and please provide that print data if possible

Rihene
작성자

pawan which function are you talking about the first one or the second

Rihene
작성자

i have changed in the first function return taille to return [taille] and when i print it i got [1]

Rihene
작성자

Pawan what i want to do is to print the list of employees but with two nested loop where the first one is to print 6 columns per page :/

Pawan

Why are u calling that function(first one), i can't see its any use in rml/py file...
please print second function result too

Rihene
작성자

I have print or you this print res_list[0:6] so i have got this [{'total_brut': '1000.0', 'name': u'ABDELWAHED RIHENE', 'presence': '0', 'salaire_imposable': '8180.0', 'net_payer': '442.558', 'absence': '0', 'retenue_source': '465.642', 'cnss_sal': '9180.0', 'cnss_pat': '16570.0', 'matricule': '2', 'heures_sup': '0'}, {'total_brut': '1000.0', 'name': u'ADNANE BEN YOUSSEF', 'presence': '0', 'salaire_imposable': '8180.0', 'net_payer': '442.558', 'absence': '0', 'retenue_source': '465.642', 'cnss_sal': '9180.0', 'cnss_pat': '16570.0', 'matricule': '4', 'heures_sup': '0'}, {'total_brut': '1000.0', 'name': u'AMINE MSAKNI ', 'presence': '0', 'salaire_imposable': '8180.0', 'net_payer': '442.558', 'absence': '0', 'retenue_source': '465.642', 'cnss_sal': '9180.0', 'cnss_pat': '16570.0', 'matricule': '5', 'heures_sup': '0'}, {'total_brut': '1000.0', 'name': u'AYMEN HAMROUNI', 'presence': '0', 'salaire_imposable': '8180.0', 'net_payer': '442.558', 'absence': '0', 'retenue_source': '465.642', 'cnss_sal': '9180.0', 'cnss_pat': '16570.0', 'matricule': '6', 'heures_sup': '0'}, {'total_brut': '1000.0', 'name': u'JINENE HEDFI', 'presence': '0', 'salaire_imposable': '8180.0', 'net_payer': '442.558', 'absence': '0', 'retenue_source': '465.642', 'cnss_sal': '9180.0', 'cnss_pat': '16570.0', 'matricule': '7', 'heures_sup': '0'}, {'total_brut': '1000.0', 'name': u'MOHAMED JRIBI', 'presence': '0', 'salaire_imposable': '8180.0', 'net_payer': '442.558', 'absence': '0', 'retenue_source': '465.642', 'cnss_sal': '9180.0', 'cnss_pat': '16570.0', 'matricule': '3', 'heures_sup': '0'}]

Pawan

Drees, please change the variable, 'o' with 'p' or something else in :
[[ repeatIn(get_employee_lines(example.company_id,example.date_start,example.date_end, 0, 6), 'o', 'td') ]]
and,
[[ o['name'] ]]
in rml file....

Rihene
작성자

i have changed it but nothing happens

Rihene
작성자

pawan in my list i have 7 employees and i want to display 3 employees per page :/

Pawan

Drees, Are you using the 'o' from first function ([[ repeatIn(get_employee_taille(example.company_id,example.date_start,example.date_end), 'o') ]]), anywhere in your code??
since i can't see its use anywhere..... and everything else is seeming fine only for the error u said is raising(TypeError: 'int' object is not iterable)

Rihene
작성자

Here is my RML:

[[ repeatIn(get_employee_taille(example.company_id,example.date_start,example.date_end), 'p') ]] NOM EMPLOYÉ [[ repeatIn(get_employee_lines(example.company_id,example.date_start,example.date_end, 0, 6), 'p', 'td') ]] [[ p['name'] ]]
Now i have got this:2015-09-08 11:53:42,969 6510 ERROR openerp openerp.service.web_services: Exception: <LongTable@0x7FDDE6488F38 0 rows x unknown cols>... must have at least a row and column

Rihene
작성자

The problem here is that in repeatIn(get_employee_lines(example.company_id,example.date_start,example.date_end, 0, 6), 'p', 'td') ]] i dont want to pass the start_position and number of columns. its static i want him give me in each page 6 employees :/

Pawan

In , you have given widths for 5 cols(colwidths="150,100,100,100,100,100"), but inside that

you are having 2 only.
Second , for your error, after second "" tag([[ repeatIn(get_employee_lines(example.company_id,example.date_start,example.date_end, 0, 6), 'o', 'td') ]]) you are not having any which is expected by rml parser.
These are reasons... i think...
Rihene
작성자

So what shall i do please :/ help me pawan

Pawan

Drees, it would be very nice if i can help you, but we have to go through your code, if u want then you can drop ur skype id at my email, i will contact u there asap. :)

Rihene
작성자

here is my mail pawan : abdelwahed_rihene@yahoo.fr

Rihene
작성자

i want to display x columns per page but i dont know how please try to help me my friend

아바타
Rihene
작성자 베스트 답변

Hello!!!!

Finally i have got the answer :)

Here is the RML code:

<blockTable colwidths="150,100,100,100,100,100" style="Table1">

<tr>

<td>

<para style="P8">NOM EMPLOYÉ</para>

</td>

<td>

<para style="P8">MATRICULE</para>

</td>

<td>

<para style="P7">[[ repeatIn(repeatIn(get_employee_lines(example.company_id,example.date_start,example.date_end), 'p', 'td'),'o') ]]</para>

<para style="P7">[[ repeatIn(o['p'], 'line', 'td') ]]</para>

<para style="P7">[[ line['name'] ]]</para>

<para style="P7">[[ line['matricule'] ]]</para>

</td>

</tr>

</blockTable>

Best Regards.

0
아바타
취소
토론이 재미있으신가요? 직접 참여해보세요!

지금 바로 가입하여 독점 서비스를 이용해보고 특별한 커뮤니티와 소통하세요!

가입
관련 게시물 답글 화면 활동
Spliting rml intotwo halves
rml openerp7
아바타
0
4월 18
3316
How to add condation in rml
rml openerp7
아바타
0
2월 18
4366
How to realise a page break or specify number of columns in rml for openerp 해결 완료
rml openerp7
아바타
1
9월 15
4419
How to realise Nested RepeatIn in RML 해결 완료
rml openerp7
아바타
1
9월 15
4049
How to display x number of columns per page in rml
rml openerp7
아바타
0
9월 15
3680
커뮤니티
  • 튜토리얼
  • 문서
  • 포럼
오픈 소스
  • 다운로드
  • Github
  • Runbot
  • 번역
서비스
  • Odoo.sh 호스팅
  • 고객 지원
  • 업그레이드
  • 맞춤 개발
  • 학습
  • 회계사 검색
  • 파트너 검색
  • 파트너 등록
회사 소개
  • 회사 소개
  • 브랜드 자산
  • 상담 문의
  • 인재 채용
  • 행사
  • 팟캐스트
  • 블로그
  • 고객 사례
  • 법적고지 • 개인정보
  • 보안
الْعَرَبيّة Català 简体中文 繁體中文 (台灣) Čeština Dansk Nederlands English Suomi Français Deutsch हिंदी Bahasa Indonesia Italiano 日本語 한국어 (KR) Lietuvių kalba Język polski Português (BR) română русский язык Slovenský jazyk slovenščina Español (América Latina) Español ภาษาไทย Türkçe українська Tiếng Việt

Odoo는 CRM, 이커머스, 회계, 재고, POS, 프로젝트 관리 등 기업의 모든 요구 사항을 충족하도록 설계된 오픈 소스 기반의 통합 비즈니스 앱 제품군입니다.

Odoo의 간편한 UI와 완벽하게 통합된 기능을 직접 확인해 보세요.

Website made with

Odoo Experience on YouTube

1. Use the live chat to ask your questions.
2. The operator answers within a few minutes.

Live support on Youtube
Watch now