Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
2 ตอบกลับ
4891 มุมมอง

Hello,

In the accounting->under the invoices i want to edit the invoice sequence format. After lot of effort i figured that the sequencing happens in account.py file under the account add on. I think sequencing happens in the function _get_sequence_prefix but the problem is that i have played around with this method but there was no change in the invoice format.

Existing code

def _get_sequence_prefix(self, code, refund=False):
prefix = code.upper()
if refund:
prefix = 'R' + prefix
return prefix + '/%(range_year)s/'

Edited code

def _get_sequence_prefix(self, code, refund=False):
prefix = code.upper()
if refund:
prefix = 'R' + prefix
return prefix + '/TEST/%(range_year)s/'

after this edit in the code i was expecting the upcoming invoice numbers to contain test in them but that didn't happen. why ? If i'm wrong in where the invoice number is being generated, please do point me out at the right direction. Thank you

P.S: I did upgrade the invoicing module.

อวตาร
ละทิ้ง
ผู้เขียน

I know I can do this using UI but i'm interested in code level changes of the invoice sequence format

ผู้เขียน คำตอบที่ดีที่สุด

I have changed the sequence from back-end using an update command in postgresql, still have to figure out where and how to change this using python/xml code.

อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

You can change it using a function in  XML  and  define  that  function  in  python,  and  add  a  update  query  to  make  no  update  =  false.

อวตาร
ละทิ้ง
Related Posts ตอบกลับ มุมมอง กิจกรรม
1
ก.ค. 23
3892
2
ก.ย. 24
4758
2
ธ.ค. 18
5162
2
ก.พ. 23
6037
1
มี.ค. 15
6268