Skip ke Konten
Odoo Menu
  • Login
  • Uji coba gratis
  • Aplikasi
    Keuangan
    • Akuntansi
    • Faktur
    • Pengeluaran
    • Spreadsheet (BI)
    • Dokumen
    • Tanda Tangan
    Sales
    • CRM
    • Sales
    • POS Toko
    • POS Restoran
    • Langganan
    • Rental
    Website
    • Website Builder
    • eCommerce
    • Blog
    • Forum
    • Live Chat
    • eLearning
    Rantai Pasokan
    • Inventaris
    • Manufaktur
    • PLM
    • Purchase
    • Maintenance
    • Kualitas
    Sumber Daya Manusia
    • Karyawan
    • Rekrutmen
    • Cuti
    • Appraisal
    • Referensi
    • Armada
    Marketing
    • Social Marketing
    • Email Marketing
    • SMS Marketing
    • Acara
    • Otomatisasi Marketing
    • Survei
    Layanan
    • Project
    • Timesheet
    • Layanan Lapangan
    • Meja Bantuan
    • Planning
    • Appointment
    Produktivitas
    • Diskusi
    • Approval
    • IoT
    • VoIP
    • Pengetahuan
    • WhatsApp
    Aplikasi pihak ketiga Odoo Studio Platform Odoo Cloud
  • Industri-Industri
    Retail
    • Toko Buku
    • Toko Baju
    • Toko Furnitur
    • Toko Kelontong
    • Toko Hardware
    • Toko Mainan
    Makanan & Hospitality
    • Bar dan Pub
    • Restoran
    • Fast Food
    • Rumah Tamu
    • Distributor Minuman
    • Hotel
    Real Estate
    • Agensi Real Estate
    • Firma Arsitektur
    • Konstruksi
    • Estate Management
    • Perkebunan
    • Asosiasi Pemilik Properti
    Konsultansi
    • Firma Akuntansi
    • Mitra Odoo
    • Agensi Marketing
    • Firma huku
    • Talent Acquisition
    • Audit & Sertifikasi
    Manufaktur
    • Tekstil
    • Logam
    • Perabotan
    • Makanan
    • Brewery
    • Corporate Gift
    Kesehatan & Fitness
    • Sports Club
    • Toko Kacamata
    • Fitness Center
    • Wellness Practitioners
    • Farmasi
    • Salon Rambut
    Perdagangan
    • Handyman
    • IT Hardware & Support
    • Sistem-Sistem Energi Surya
    • Pembuat Sepatu
    • Cleaning Service
    • Layanan HVAC
    Lainnya
    • Organisasi Nirlaba
    • Agen Lingkungan
    • Rental Billboard
    • Fotografi
    • Penyewaan Sepeda
    • Reseller Software
    Browse semua Industri
  • Komunitas
    Belajar
    • Tutorial-tutorial
    • Dokumentasi
    • Sertifikasi
    • Pelatihan
    • Blog
    • Podcast
    Empower Education
    • Program Edukasi
    • Game Bisnis 'Scale Up!'
    • Kunjungi Odoo
    Dapatkan Softwarenya
    • Download
    • Bandingkan Edisi
    • Daftar Rilis
    Kolaborasi
    • Github
    • Forum
    • Acara
    • Terjemahan
    • Menjadi Partner
    • Layanan untuk Partner
    • Daftarkan perusahaan Akuntansi Anda.
    Dapatkan Layanan
    • Temukan Mitra
    • Temukan Akuntan
    • Temui penasihat
    • Layanan Implementasi
    • Referensi Pelanggan
    • Bantuan
    • Upgrades
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Dapatkan demo
  • Harga
  • Bantuan

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

  • CRM
  • e-Commerce
  • Akuntansi
  • Inventaris
  • PoS
  • Project
  • MRP
All apps
Anda harus terdaftar untuk dapat berinteraksi di komunitas.
Semua Post Orang Lencana-Lencana
Label (Lihat semua)
odoo accounting v14 pos v15
Mengenai forum ini
Anda harus terdaftar untuk dapat berinteraksi di komunitas.
Semua Post Orang Lencana-Lencana
Label (Lihat semua)
odoo accounting v14 pos v15
Mengenai forum ini
Help

manual invoice numbering

Langganan

Dapatkan notifikasi saat terdapat aktivitas pada post ini

Pertanyaan ini telah diberikan tanda
invoicesequence
1 Balas
12158 Tampilan
Avatar
Ayhan KIZILTAN

How do I enter Invoice Numbers manually?

1
Avatar
Buang
Avatar
patrick
Jawaban Terbai

By default the invoice number is generated. If you want to ad it manually, you have to create a new module, which extends account_invoice, and you override the methods create and/or save.

But it is dangerous to type the invoice numbers manually, because you can forget it, you can skip numbers or use numbers multiple times.

Depending on the reason you want to type the numbers manually, it can already be done, or changed easily. If you can tell us the reason(s), we might be able to help you with it.

Example script:

# -*- coding: UTF-8 -*-
import openerplib
import datetime
import psycopg2

h = "localhost"
db= 'database'
u = "admin"
p = 'password'

h_sql = h
db_sql = db
u_sql = "openerp"
p_sql = "openerp"

line = '-' *45 + '\n'
file_dbo_factuur = 'dbo_Factuur.csv'
file_dbo_factuurregel = 'dbo_Factuurregels.csv'
f_result = 'factuur_Result.txt'
f_error = 'factuur_Error.csv'
file_finance = 'factuur_finance.csv'

invoiceAdded = 0
invoiceRejected = 0

################################################################################
## VARIOUS ROUTINES
################################################################################
def printHeading():
  f_res.write(line)
  dateX = str(datetime.datetime.now())
  f_res.write('-' * 10 + dateX+'\n')

def initConnection(h, db, u, p):
  printHeading()
  f_res.write('Connecting to %s \nuser: %s\ndatabase: %s\n' %(h, u, db))
  return openerplib.get_connection(
    hostname=h, database=db, login=u, password=p)

def addValsToDB(c, m, vals):
  printHeading()
  f_res.write('Adding data to %s\n' %(m))
  print 'Adding data to', m
  model = c.get_model(m)
  result = []
  i = 0
  for v in vals:
    result.append(model.create(v))
    i += 1
    x, y = divmod(i, 100)
    if y == 0:
      f_res.write('Added already %d records to %s\n' %(x*100, m))

  f_res.write('Number of records added: %d\n' %(len(result)))
  return result

def writeData(c, m, ids, vals):
  printHeading()
  f_res.write('Modifying data of model %s with id(s) = %s\n' %(m, ids))
  print 'Modifying data of model', m, 'with id =', ids
  model = c.get_model(m)
  return model.write(ids, vals)
################################################################################
## SCRIPT SPECIFIC ROUTINE(S)
################################################################################
def addInvoice(c, factuur, lines):
  global invoiceAdded
  global invoiceRejected

  #check invoice itself
  factuur_split = factuur.split(';')
  m = 'account.invoice'
  vals = []

# do your checks

  if sjoemel: #so old order
    resOrder = order_obj.onchange_partner_id(0, partner)['value']

    origin = 'Factuur %s, van order voor 2013' %(factuur_split[2])
    currency = factuur_split[9]
    if currency == '1': # Euro
      pass
    elif currency == '6': # USD
      currency = '3'
    elif currency == '7': # GBP
      currency = '152'

    fiscal = resOrder['fiscal_position']
    reference = factuur_split[30]
    user = 1 #fixed to admin
    payment = resOrder['payment_term']
    comment = factuur_split[13]

  else: #order uit 2013
    origin = order['name']
    currency = order['currency_id'][0]
    partner = order['partner_id'][0]
    if order['fiscal_position'] == False:
      fiscal = False
    else:
      fiscal = order['fiscal_position'][0]
    reference = order['client_order_ref']
    user = order['user_id'][0]
    payment = order['payment_term'][0]
    comment = order['note']

  agent = klant_agent.get(partner, False)
  agent_code = agent_id_code.get(agent, '')

  klant = partner_obj.read(partner)
  hb_inkoop_org = klant['hb_inkoop_org']

  vals.append({
    'origin': origin,
    'date_due': factuur_split[30],
    'check_total': 0.0,
    'partner_bank_id': False,
    'supplier_invoice_number': False,
    'paypal_url': False,
    'company_id': 1,
    'currency_id': currency,
    'partner_id': partner,
    'fiscal_position': fiscal,
    'user_id': user,
    'reference': reference,
    'message_is_follower': False,
    'payment_term': payment,
    'reference_type': 'none',
    'journal_id': 11,
    'account_id': 166,
    'type': 'out_invoice',
    'internal_number': 'Q:%s' %(factuur_split[2]),
    'reconciled': False,
    'move_name': '/',
    'section_id': False,
    'date_invoice': factuur_split[3],
    'name': factuur_split[29], #? 
    'comment': comment,
    'sent': False,
    'agent_id': agent,
    'agent_code': agent_code,
    'message_unread': False,
  })

  invoiceID = addValsToDB(connection, m, vals)[0]

  # add the various lines to the invoice.
  vals = []
  m = 'account.invoice.line'

  invoice_line_tax_id = []
  if fiscal == 1: #NL
    invoice_line_tax_id = [2]
#  elif fiscal == 2: # EU
  elif fiscal == 3: # EU
    invoice_line_tax_id = [15]
#  elif fiscal == 3: # Non EU
  elif fiscal == 4: # Non EU
    invoice_line_tax_id = [12]
  else:
    invoice_line_tax_id = [2]

  for line_split in resFactLines:
    orderlineOld = line_split[13]
    if orderlineOld:
      orderlineID = old_orderline_obj.search([('orderline_id', '=', line_split[3])])
      orderline = old_orderline_obj.read(orderlineID)[0]
      product = prod_obj.read(int(orderline['product_id']))
    else:
      orderlineID = orderline_obj.search([('hb_id_q', '=', line_split[3])])
      orderLine = orderline_obj.read(orderlineID)[0]
      product = prod_obj.read(orderLine['product_id'][0])

    priceArticle = float(line_split[6])

    vals.append({
    'origin': origin,
    'uos_id': 1,
    'asset_category_id': False,
    'account_id': 458,
    'name': product['name'],
    'sequence': 5,
    'invoice_id': invoiceID,
    'price_unit': priceArticle, 
     'company_id': 1,
    'invoice_line_tax_id': [[6, 0, invoice_line_tax_id]],
    'discount': line_split[4],
    'account_analytic_id': False,
    'quantity': line_split[5],
    'partner_id': partner,
    'product_id': product['id'],
  })

  factuurLineIDs = addValsToDB(connection, m, vals)

  # Validate invoice
  context = {}
  context['active_ids'] = [invoiceID]
  x = factuur_confirm_obj.invoice_confirm([invoiceID], context)

#start of script
f_factuur = open(file_dbo_factuur, 'r')
f_fout = open(f_error, 'a')
f_res = open(f_result, 'a')
startTime = str(datetime.datetime.now())
print startTime
f_fout.write('error code;Omschrijving;factuur;factuurID;order;orderregel\n')

#finance
f_fin = open(file_finance, 'w+')
f_fin.write('Factuur Q;bedrag Q;Factuur openERP;bedrag openERP;verschil (Q - OpenERP)\n')

connection = initConnection(h, db, u, p)
f_res.write('Connecting with SQL:\nuser: %s\ndatabase: %s\n' %(u_sql, db_sql))
conn_string = "dbname='%s' user='%s' password='%s'" %(db_sql, u_sql, p_sql)
conn_sql = psycopg2.connect(conn_string)
cursor = conn_sql.cursor()

# search partners with agent
statement = "select partner_id, agent_id from res_partner_agent"
klant_agent = {}
cursor.execute(statement)
result = cursor.fetchall()
for r in result:
    klant_agent[r[0]] = r[1]

statement = "select hb_id_q, id from res_partner"
partner_Q_id = {}
cursor.execute(statement)
result = cursor.fetchall()
for r in result:
    partner_Q_id[r[0]] = r[1]

f_factuur = open(file_dbo_factuur_nw, 'r')
f_factuurline = open(file_dbo_factuurregel, 'r')
# get rid of the headings
header_f = f_factuur.readline()
header_l = f_factuurline.readline()
# get the first entry of the factuurline
line_factuur = f_factuurline.readline()
numberOfLines = 1 #because of line above

factuur_obj = connection.get_model('account.invoice')
factuurline_obj = connection.get_model('account.invoice.line')
order_obj = connection.get_model('sale.order')
orderline_obj = connection.get_model('sale.order.line')
prod_obj = connection.get_model('product.product')
old_order_obj = connection.get_model('hb.order')
old_orderline_obj = connection.get_model('hb.order.line')
partner_obj = connection.get_model('res.partner')
#nodig om facturen te bevestigen....
factuur_confirm_obj = connection.get_model('account.invoice.confirm')

partner_q_id = {}
statement = "select hb_id_q, id from res_partner where customer = True"
cursor.execute(statement)
result = cursor.fetchall()
for r in result:
  partner_q_id[r[0]] = r[1]

partner_id_obj = {}

s = ''
numberOfRecords = 0

for factuur in f_factuur:
  lines = []

  numberOfRecords += 1
  factuur_result = factuur.split(';')
  if len(factuur_result) != lengte_f:
    print 'Factuur niet goede lengte. %s' %(factuur)
    continue
  s = factuur

  while s:
      if line_factuur == '\n': # end of file
        if len(lines) > 0:
          result = addInvoice(connection, s, lines)
        print 'Einde, wegens alleen \\n'
        break

      if line_factuur == '': # end of file?!
        if len(lines) > 0:
          result = addInvoice(connection, s, lines)
        print 'Einde, wegens lege regel'
        break

      if line_factuur == '\r\n': # zou niet mogen!
        print line_factuur
        print line_result

      line_result = line_factuur.replace('\n','').split(';')

      if factuur_result[0] < line_result[2]: #order lines later than order
        if len(lines) > 0:
          result = addInvoice(connection, s, lines)
        else:
          f_fout.write('06;Factuur %s zonder regels\n' %(factuur_result[0]))
        break

      if factuur_result[0] == line_result[2]: # order line part of order
        lines.append(line_factuur)

      line_factuur = f_factuurline.readline()
      numberOfLines += 1

  s = ''

print line
print 'Records:', numberOfRecords
print 'Lines  :', numberOfLines
print 'Invoices made in openERP:', invoiceAdded
print 'Invoices rejected by openERP:', invoiceRejected
print line

f_res.write(line+'\n')
f_res.write('Invoices read: %d\n' %(numberOfRecords))
f_res.write('Invoicelines read: %d\n' %(numberOfLines))
f_res.write('Invoices made in openERP: %d\n' %(invoiceAdded))
f_res.write('Invoices rejected by openERP: %d\n' %(invoiceRejected))
f_res.write(line+'\n')

eindTime = str(datetime.datetime.now())
f_fout.write(eindTime+'\n')
f_res.write(eindTime+'\n')
f_fin.write(eindTime+'\n')

f_fin.close()
f_fout.close()
f_res.close()

print eindTime
print 'einde'
print line
1
Avatar
Buang
Ayhan KIZILTAN
Penulis

I want to enter the invoice numbers manually because I have to enter the invoices which I already created manually before I began to use OpenERP. So each invoice has its own sequences. After I complete all the previous invoice entries I will begin to use the invoice numbers generated by the software.

patrick

If needed, I can show a small script to do the import for you. Just let me know if you are interested. You want to place your own invoice number as account_invoice.internal_number. This field will be used to generate/display the invoice number

Ayhan KIZILTAN
Penulis

Yes I am interested.

AJ Schrafel Paper Corp

i agree with patrick, importing the invoices is a much better idea than manually keying data.

Nagah El-Msiry

Dear I'm facing the same problem and i want to import invoices with pregenerated numbers as beginign balances, (will that affect accounting side also or i have to make entry with total balance ?)

SYNAP SYSTEM

The first thing I tried with OpenERP was editing old invoices (and still don't know how to do it). It seems that I may not be the only one...

AJ Schrafel Paper Corp

once an invoice is out of draft state, you cannot edit it. You need to either have your customer pay the invoice short and issue a credit memo to zero out the balance OR you need to issue a credit for the entire invoice and re-invoice at the correct amount. This is a basic principle of accounting that openERP must follow otherwise it would not be taken seriously as an accounting package.

SYNAP SYSTEM

By "old invoices" I doesn't mean "paid invoices". I mean "invoices which was edited out of OpenERP". Fact is that if we had already issued paper wrote invoices with manually-attributed reference numbers, it's not possible to create the same invoice in OpenERP with the same reference number, as it's automatically generated and not editable.

AJ Schrafel Paper Corp

You can load them directly into the database using pgadmin or custom scripting to put the information into the database. But this method might lead to unforeseen issues.

SYNAP SYSTEM

Of course! We can do anything this way... But the purpose of a framework is not to make us choose between "not doing something" and "doing it the bad way". OpenERP is quite well designed. But it's very difficult to convince a customer when we are not even able to import it's own data for a demo.

Menikmati diskusi? Jangan hanya membaca, ikuti!

Buat akun sekarang untuk menikmati fitur eksklufi dan agar terlibat dengan komunitas kami!

Daftar
Post Terkait Replies Tampilan Aktivitas
How to change Invoice sequence via xml in Odoo 15 or newer?
invoice sequence
Avatar
0
Sep 24
2064
Odoo 17.1 - How to never reset invoice number
invoice sequence
Avatar
Avatar
2
Mar 24
3948
How to select manually a sequence for an invoice? Diselesaikan
invoice sequence
Avatar
Avatar
2
Feb 23
4597
Manually set invoice number Diselesaikan
invoice sequence
Avatar
Avatar
Avatar
Avatar
Avatar
6
Okt 20
39363
Error in Sequence when creating and editing invoice
invoice sequence
Avatar
Avatar
1
Sep 20
5112
Komunitas
  • Tutorial-tutorial
  • Dokumentasi
  • Forum
Open Source
  • Download
  • Github
  • Runbot
  • Terjemahan
Layanan
  • Odoo.sh Hosting
  • Bantuan
  • Peningkatan
  • Custom Development
  • Pendidikan
  • Temukan Akuntan
  • Temukan Mitra
  • Menjadi Partner
Tentang Kami
  • Perusahaan kami
  • Aset Merek
  • Hubungi kami
  • Tugas
  • Acara
  • Podcast
  • Blog
  • Pelanggan
  • Hukum • Privasi
  • Keamanan
الْعَرَبيّة 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 adalah rangkaian aplikasi bisnis open source yang mencakup semua kebutuhan perusahaan Anda: CRM, eCommerce, akuntansi, inventaris, point of sale, manajemen project, dan seterusnya.

Mudah digunakan dan terintegrasi penuh pada saat yang sama adalah value proposition unik Odoo.

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