CRM | e-Commerce | Accounting | Inventory | PoS | Project management | MRP | etc.
I have a module called archive the user can select and create new storage type like- DVD, Tape, LTO etc from selection field. Now I want my storage accession number to be a sequence and prfix of the squence will change depanding on selection filed. e.g: if user select LTO, Accession number will be like LTO-001, LTO-002 like wise if user select DVD accession will be DVD-001, DVD002. How can I do this?
The question here is do you want separate sequences for each prefix, or one sequence with diufferent prefixes depending on selection.
For case with separate sequences, first define sequece for each prefix / selection, then in method that takes sequence number refer to selected sequence.
Or, if you need only one sequence and use it with any of selected prefixes, you create a sigle sequence without prefix, and in method that creates sequence simple add selected prefix once you got the sequence number...
1) Create Sequence Type and Sequence in the xml Fle based on the selection ex: (LTO, DVD).
2) Pass the context value in the selection field in the xml file.
3) Python override the create method and check the context selection value based on that call the sequence value.
Refer the below link:-
About This Community
Odoo Training Center
|Asked: 7/22/14, 2:28 AM|
|Seen: 1238 times|
|Last updated: 3/16/15, 8:10 AM|