añadido product_secuence y product_code_unique para crear secuencias de productos por categoría
related 6
This commit is contained in:
parent
46d66821ec
commit
4fe2e3d368
73 changed files with 5643 additions and 0 deletions
18
product_sequence/hooks.py
Normal file
18
product_sequence/hooks.py
Normal file
|
@ -0,0 +1,18 @@
|
|||
# Copyright 2004 Tiny SPRL
|
||||
# Copyright 2016 Sodexis
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
|
||||
|
||||
def pre_init_hook(cr):
|
||||
"""
|
||||
Updates existing codes matching the default '/' or
|
||||
empty. Primarily this ensures installation does not
|
||||
fail for demo data.
|
||||
:param cr: database cursor
|
||||
:return: void
|
||||
"""
|
||||
cr.execute(
|
||||
"UPDATE product_product "
|
||||
"SET default_code = '!!mig!!' || id "
|
||||
"WHERE default_code IS NULL OR default_code = '/';"
|
||||
)
|
Loading…
Add table
Add a link
Reference in a new issue