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

I want to create an opportunity number with auto sequence.

I already created a new field x_opp_num. How can I create a new sequence code ? Thanks.

아바타
취소
베스트 답변

In xml file write :

<record id="seq_type_1" model="ir.sequence.type"> <field name="name">Test Type</field> <field name="code">test</field> </record> <record id="seq_1" model="ir.sequence"> <field name="name">Test</field> <field name="code">test</field> <field name="prefix">test</field> <field name="padding">3</field> </record>

In .py file all default in object where you want to add sequence :

_defaults = { 'x_opp_num': lambda obj, cr, uid, context: obj.pool.get('ir.sequence').get(cr, uid, 'test'), }

In default 'test' is same name as code in xml.

아바타
취소

Want to create a sequence for an existing field - Payment Ref (under Customer Invoices). Copied above code to account_voucher_sequence.xml, however, cant see new entry under Settings>Configuration>Sequence&Identifiers>Sequences

Also tried renaming 'name' and 'code' of Purchase Entry in the same XML file, however, unable to see any changes under Settings>Configuration>Sequence&Identifiers>Sequences

Please let me know where m i going wrong. thanks!

Have you updated the database with changed module?

i m afraid i dont know how to update db with changed module, could you please help me. thanks.

관련 게시물 답글 화면 활동
0
2월 23
5080
0
1월 23
94
1
10월 22
4343
0
4월 22
2884
2
3월 25
2965