Advertisement
rht_odoo

[QW][3942972] Internal reference/barcode sequence on product.product

Jun 3rd, 2024 (edited)
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.43 KB | None | 0 0
  1. # Done by RHT on the 27/05/2024
  2. # Reviewed by SEA on the 03/06/2024
  3. # Review: https://pastebin.com/9sp9W7E7
  4. # Need: have an automatic internal reference
  5. # Task: https://www.odoo.com/odoo/project.task/3942972?cids=1
  6.  
  7. for product in records.filtered(lambda c: c.default_code is not set):
  8.     code = product.env['ir.sequence'].next_by_code('product.product.sequence')
  9.     product["default_code"] = code
  10.     product["barcode"] = code
  11.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement