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

Customizing Sequence Code Generation and Delivery Slip Behavior in stock.picking Module

Langganan

Dapatkan notifikasi saat terdapat aktivitas pada post ini

Pertanyaan ini telah diberikan tanda
communitystock_pickingv15
3 Replies
5007 Tampilan
Avatar
Kabir Khan

"I'm looking for guidance on customizing the behavior of the stock.picking module in my ERP system. Currently, when confirming a quotation, it creates a sale order along with a delivery slip, which generates a sequence code immediately. However, I want to delay the generation of the delivery slip number until the stock.picking state is 'done'. Essentially, The behavior of the sale invoice process where the sequence code isn't generated until the invoice is done. Additionally, I want the stock.picking state to remain as 'draft' until the delivery is done. Can anyone provide insights or steps on how to achieve this customization effectively? Any advice, code snippets, or pointers to relevant documentation would be highly appreciated. Thank you!"

0
Avatar
Buang
Avatar
Jaideep
Jawaban Terbai

Why not create a new field "Delivery Challan" with sequence number that is updated when the picking state is done?

Update the required reports with the new field and make the current field invisible in the views.

1
Avatar
Buang
Kabir Khan
Penulis

yes you are also right brother.

Avatar
Cybrosys Techno Solutions Pvt.Ltd
Jawaban Terbai

Hi,

You can modify the sequence of stock.picking from the UI itself, for that go toInventory -> Configuration -> Operation Types


Open any operation type, You can see the sequence prefix from it


 Go to the internal link of the Reference sequences to make changes for more


Hope it helps

0
Avatar
Buang
Kabir Khan
Penulis

dear brother i just wanted to dont want create delivery challan number untill the ​

if stock_picking.state == 'done':

when i click quotation confirm it will create sale order and also create stock picking transfer with challan number but i wish its creating challan or delivery on state == done when i click to validate the stock picking transfer challan generate
otherwise stock pick transfer is dont want to such he creating delivery challan number

hope you understand :)

i just wanted to not forced to create delivery challan on creating sale order i inherit the method but didnt get it will creating automatically delivery challan number

Avatar
Dương Nguyễn
Jawaban Terbai

I check the code , if you do like this , you will need to do 2 think

1. Remove the sql constrain for unique name


2. Add these code

@api.model

def create(self, vals):

​res = super().create(vals)

​for r in res:

​ ​if r.name != '/' and r.state != 'done':

​ ​ ​r.name = '/'

​return res


 

def write(self, vals):

​res = super().write(vals)

​for r in self:

​ ​if r.name == '/' and r.state == 'done':

​ ​ ​picking_type = r.picking_type_id

​ ​ ​if picking_type.sequence_id.number_next_actual > 0:

​ ​ ​ ​picking_type.sequence_id.number_next_actual -= 1

​ ​ ​r.name = picking_type.sequence_id.next_by_id()

return res
overall, i suggest that you shouldn't do this because this is quite strange behavior unless you have something specific thing why you doing like this

0
Avatar
Buang
Kabir Khan
Penulis

dear brother i just wanted to dont want create delivery challan number untill the ​
if r.state == 'done':

when i click quotation confirm it will create sale order and also create stock picking transfer with challan number but i wish its creating challan or delivery on state == done when i click to validate the stock picking transfer challan generate
otherwise stock pick transfer is dont want to such he creating delivery challan number

hope you understand :)

i just wanted to not forced to create delivery challan on creating sale order i inherit the method but didnt get it will creating automatically delivery challan number

Dương Nguyễn

Hi Sir, i have modified the answer please check

Kabir Khan
Penulis

ok ill check and reply

Kabir Khan
Penulis

@Dương Nguyễn beacause the delivery challan was not in sequence the delivery order is not proper date wise with seqence code like

deliverychallan001 this is delivery expected time 20 March
deliverychallan002 this is delivery expected time 02 March

in delivery chllan the sequence not maintain
deliverychallan002
deliverychallan001
is show like this will export this and send data to GOVT TAX india then the entry delivery challan number not sync proper sequence wise.

Kabir Khan
Penulis

code is not working

Dương Nguyễn

really, i test i work fine, is this the flow that you want
Confirm Sale Order -> The system will create a delivery picking and the picking name will stay '/' until you validate it right

Kabir Khan
Penulis

can you share me full code of file? how many module you inherit i added this in new custom file but it will generate
automatically

class CustomStockPicking(models.Model):
_inherit = 'stock.picking'

@api.model
def create(self, vals):
res = super(CustomStockPicking, self).create(vals)
for r in res:
if r.name != '/' and r.state != 'done':
r.name = '/'
return res

def write(self, vals):
res = super(CustomStockPicking, self).write(vals)
for r in self:
if r.name == '/' and r.state == 'done':
picking_type = r.picking_type_id
r.name = picking_type.sequence_id.next_by_id()
return res

Kabir Khan
Penulis

name = fields.Char('Reference', default='/', copy=False, readonly=True)

i update this and also upgrade module but still is show

Reference must be unique per company!

Kabir Khan
Penulis

its working but when add more then one...
Reference must be unique per company!

i update the code and remove index but not working should i change too in pgadmin ?

Kabir Khan
Penulis

Done thank you

Kabir Khan
Penulis

sequence number not prefect its mismatch

Dương Nguyễn

I don't understand, how you want it to match ? The logic behind it is like if you have picking 001, 002 already the next one will always be 003 you can't change that

Kabir Khan
Penulis

this is +1 number in when we confirm sale order and then after we validate it another +1 so 1 number is mismatching

Dương Nguyễn

Can you share me a video , i might be able to troubleshot for you ?

Kabir Khan
Penulis

when i confirm the quotation in ir.sequence module where we to fetch next number its add automatically so sequence did not maintain its a gape 1 in every delivery challan

Kabir Khan
Penulis

when we click confirm sale order it will create sequence in backend we want to fixed this then this functionality will work perfectly

Kabir Khan
Penulis

my question only is this we don't want to also create sequence number if delivery challan not generated.

your answer is work but sequence is not maintain its increment 2 times ir.sequence table next number...

hope you understand

Dương Nguyễn

Oh i found the bug, because in the original create method, odoo already increase it so in the ovveride i give i increase it to. So here is the modify code
def write(self, vals):
res = super().write(vals)
for r in self:
if r.name == '/' and r.state == 'done':
picking_type = r.picking_type_id
if picking_type.sequence_id.number_next_actual > 0:
picking_type.sequence_id.number_next_actual -= 1
r.name = picking_type.sequence_id.next_by_id()
return res

Kabir Khan
Penulis

are you sure you changes in write method ? what about create method ?

Dương Nguyễn

i test and it work but i am not sure whether this create more bug or not because your use case is strange you know,
Good Luck sir

Kabir Khan
Penulis

not working mismatch sequence number

whole code
--------------------

from odoo import api, fields, models

class CustomStockPicking(models.Model):
_inherit = 'stock.picking'

name = fields.Char('Reference', default='/', copy=False, readonly=True)
_sql_constraints = [
('name_uniq', 'unique(company_id)', 'Reference must be unique per company!'),
]

@api.model
def create(self, vals):
res = super(CustomStockPicking, self).create(vals)
for r in res:
if r.name != '/' and r.state != 'done':
r.name = '/'
return res

def write(self, vals):
res = super(CustomStockPicking, self).write(vals)
for r in self:
picking_type = None # Initialize picking_type with a default value
if r.name == '/' and r.state == 'done':
picking_type = r.picking_type_id
if picking_type.sequence_id.number_next_actual > 0:
picking_type.sequence_id.number_next_actual -= 1
r.name = picking_type.sequence_id.next_by_id()
return res

Dương Nguyễn

Ok at least i try, thank you anyway

Kabir Khan
Penulis

still gape 1 to 2 you can check both side via confirming order and direct create transfer still issue in sequence number :(

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
inherit stock.picking
community stock_picking sale.order v15
Avatar
Avatar
1
Mar 24
3797
How to call another models onchange function in my custom model, when we call that , i want to work the fucntion
community v15
Avatar
Avatar
Avatar
2
Agu 23
3287
500: Internal Server Error in odoo Community 15 Diselesaikan
community v15
Avatar
Avatar
Avatar
2
Mei 23
3431
Can i call another models onchange function from my custom model?
community v15
Avatar
Avatar
1
Apr 23
3638
odoo ocr
community v15
Avatar
0
Jun 22
2466
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