Skip to Content
Odoo เมนู
  • ลงชื่อเข้าใช้
  • ทดลองใช้ฟรี
  • แอป
    การเงิน
    • ระบบบัญชี
    • ระบบการออกใบแจ้งหนี้
    • ระบบบัญชีรายจ่าย
    • ระบบการจัดการข้อมูลผ่านสเปรดชีต (BI)
    • เอกสาร
    • ระบบลงลายเซ็น
    การขาย
    • ลูกค้าสัมพันธ์
    • การขาย
    • POS ร้านค้า
    • POS ร้านอาหาร
    • ระบบสมัครสมาชิก
    • การเช่า
    การจัดการเว็บไซต์
    • เครื่องมือสร้างเว็บไซต์
    • ระบบการขายออนไลน์
    • บล็อก
    • ฟอรั่ม
    • ไลฟ์แชท
    • ระบบการอบรมออนไลน์
    ซัพพลายเชน
    • คลังสินค้า
    • ระบบการผลิต
    • PLM
    • ระบบการจัดซื้อ
    • การซ่อมบำรุง
    • ระบบจัดการคุณภาพ
    ทรัพยากรบุคคล
    • ข้อมูลพนักงาน
    • ระบบสรรหาบุคลากร
    • ระบบการลา
    • การประเมิน
    • ระบบการแนะนำพนักงาน
    • ระบบจัดการยานพาหนะ
    การตลาด
    • โซเชียลมาร์เก็ตติ้ง
    • การตลาดผ่านอีเมล
    • ระบบการตลาดผ่าน SMS
    • ระบบการจัดงานอีเวนต์
    • การตลาดแบบอัตโนมัติ
    • ระบบแบบสำรวจ
    การบริการ
    • โปรเจกต์
    • ระบบบันทึกเวลา
    • ระบบการจัดการบริการภาคสนาม
    • ระบบดูแลช่วยเหลือ
    • การวางแผน
    • การนัดหมาย
    ประสิทธิผล
    • ระบบแสดงความคิดเห็น
    • ระบบการอนุมัติ
    • ไอโอที
    • VoIP
    • คลังข้อมูล
    • WhatsApp
    แอปพลิเคชันของบุคคลที่สาม Odoo สตูดิโอ แพลตฟอร์มคลาวด์ของ Odoo
  • อุตสาหกรรม
    การค้าปลีก
    • ร้านขายหนังสือ
    • ร้านขายเสื้อผ้า
    • ร้านขายเฟอร์นิเจอร์
    • ร้านขายของชำ
    • ร้านขายฮาร์ดแวร์
    • ร้านขายของเล่น
    Food & Hospitality
    • บาร์และผับ
    • ร้านอาหาร
    • อาหารฟาสต์ฟู้ด
    • Guest House
    • ตัวแทนจำหน่ายเครื่องดื่ม
    • Hotel
    อสังหาริมทรัพย์
    • Real Estate Agency
    • บริษัทสถาปัตยกรรม
    • บริษัทรับเหมา
    • การจัดการอสังหาริมทรัพย์
    • การจัดสวน
    • สมาคมเจ้าของอสังหาริมทรัพย์
    ปรึกษา
    • สำนักงานบัญชี
    • Odoo พาร์ทเนอร์
    • เอเจนซี่การตลาด
    • สำนักงานกฎหมาย
    • บริการสรรหาบุคลากร
    • การตรวจสอบและการรับรอง
    ระบบการผลิต
    • Textile
    • เหล็ก
    • เฟอร์นิเจอร์
    • อาหาร
    • Brewery
    • ของขวัญขององค์กร
    สุขภาพ & ฟิตเนส
    • ชมรมกีฬา
    • ร้านขายแว่นตา
    • ฟิตเนส
    • ผู้ประกอบวิชาชีพด้านสุขภาพ
    • ร้านขายยา
    • ร้านทำผม
    Trades
    • ช่างซ่อม
    • ฮาร์ดแวร์และการสนับสนุนด้านไอที
    • ระบบพลังงานแสงอาทิตย์
    • ช่างทำรองเท้า
    • บริการทำความสะอาด
    • HVAC Services
    อื่น ๆ
    • Nonprofit Organization
    • สำนักงานสิ่งแวดล้อม
    • ร้านเช่าป้ายโฆษณา
    • การถ่ายภาพ
    • ร้านเช่าจักรยาน
    • ตัวแทนจำหน่ายซอฟต์แวร์
    Browse all Industries
  • คอมมูนิตี้
    ศึกษา
    • บทเรียน
    • เอกสารกำกับโปรแกรม
    • การรับรอง
    • การฝึกอบรม
    • บล็อก
    • พอดแคสต์
    เพิ่มศักยภาพให้กับการศึกษา
    • โปรแกรมการศึกษา
    • Scale Up! Business Game
    • เยี่ยมชม Odoo
    รับซอฟต์แวร์
    • ดาวน์โหลด
    • เปรียบเทียบรุ่น
    • เผยแพร่
    ทำงานร่วมกัน
    • Github
    • ฟอรั่ม
    • ระบบการจัดงานอีเวนต์
    • การแปล
    • ร่วมเป็นพาร์ทเนอร์
    • Services for Partners
    • ลงทะเบียนเพื่อสร้างบัญชีบริษัทของคุณ
    รับบริการ
    • ค้นหาพาร์ทเนอร์
    • ค้นหานักบัญชี
    • พบกับที่ปรึกษา
    • บริการติดตั้งระบบเพื่อใช้งาน
    • ข้อมูลอ้างอิงลูกค้า
    • การสนับสนุน
    • อัปเกรด
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    รับการสาธิต
  • ราคา
  • ช่วยเหลือ

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

  • ลูกค้าสัมพันธ์
  • e-Commerce
  • ระบบบัญชี
  • สินค้าคงคลัง
  • PoS
  • โปรเจกต์
  • MRP
All apps
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
All Posts คน เหรียญรางวัล
แท็ก (View all)
odoo accounting v14 pos v15
เกี่ยวกับฟอรั่มนี้
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
All Posts คน เหรียญรางวัล
แท็ก (View all)
odoo accounting v14 pos v15
เกี่ยวกับฟอรั่มนี้
ช่วยเหลือ

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

ติดตาม

รับการแจ้งเตือนเมื่อมีกิจกรรมในโพสต์นี้

คำถามนี้ถูกตั้งค่าสถานะ
communitystock_pickingv15
3 ตอบกลับ
4996 มุมมอง
อวตาร
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
อวตาร
ละทิ้ง
อวตาร
Jaideep
คำตอบที่ดีที่สุด

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
อวตาร
ละทิ้ง
Kabir Khan
ผู้เขียน

yes you are also right brother.

อวตาร
Cybrosys Techno Solutions Pvt.Ltd
คำตอบที่ดีที่สุด

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
อวตาร
ละทิ้ง
Kabir Khan
ผู้เขียน

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

อวตาร
Dương Nguyễn
คำตอบที่ดีที่สุด

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
อวตาร
ละทิ้ง
Kabir Khan
ผู้เขียน

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
ผู้เขียน

ok ill check and reply

Kabir Khan
ผู้เขียน

@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
ผู้เขียน

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
ผู้เขียน

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
ผู้เขียน

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
ผู้เขียน

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
ผู้เขียน

Done thank you

Kabir Khan
ผู้เขียน

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
ผู้เขียน

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
ผู้เขียน

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
ผู้เขียน

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
ผู้เขียน

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
ผู้เขียน

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
ผู้เขียน

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
ผู้เขียน

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

สนุกกับการพูดคุยนี้ใช่ไหม? เข้าร่วมเลย!

สร้างบัญชีวันนี้เพื่อเพลิดเพลินไปกับฟีเจอร์พิเศษและมีส่วนร่วมกับคอมมูนิตี้ที่ยอดเยี่ยมของเรา!

ลงชื่อ
Related Posts ตอบกลับ มุมมอง กิจกรรม
inherit stock.picking
community stock_picking sale.order v15
อวตาร
อวตาร
1
มี.ค. 24
3788
How to call another models onchange function in my custom model, when we call that , i want to work the fucntion
community v15
อวตาร
อวตาร
อวตาร
2
ส.ค. 23
3278
500: Internal Server Error in odoo Community 15 แก้ไขแล้ว
community v15
อวตาร
อวตาร
อวตาร
2
พ.ค. 23
3421
Can i call another models onchange function from my custom model?
community v15
อวตาร
อวตาร
1
เม.ย. 23
3635
odoo ocr
community v15
อวตาร
0
มิ.ย. 22
2465
คอมมูนิตี้
  • บทเรียน
  • เอกสารกำกับโปรแกรม
  • ฟอรั่ม
โอเพนซอร์ส
  • ดาวน์โหลด
  • 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 eCommerce ระบบบัญชี ระบบสินค้าคงคลัง ระบบการขายหน้าร้าน โปรเจกต์ และ อีกมากมาย

ความเหนือกว่าอันเป็นเอกลักษณ์ของ 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