How to use multiple sequence

Dear Sir,
I start using tryton, I have a query to you. Mentioned in below:
I have create a selection field_1(this is section items A, B, C) and i want to create multiple sequence value in another field.
Suppose if we select A in field_1 then another filed value should come A1 and so on after saving data . and should be increament like A1, A2…
else if we select B in field_1 then another filed value should come B1 and so on after saving data . and should be increament like B1, B2…

can we do in tryton using python & how will do that. please help me Sir?
Thanks in Advance @Ced Sir,

Thanku Sir for reply immediately @Ced Sir,
I want to confirm with you . Can we create multiple sequence value which is based on another sequence field.
or Any other solution to do this?

Thanks in advance

This is a forum, not a support channel you can not expect people to reply immediately. Usually you will receive a reply but the timespan can vary greatly.

You should clarify what you call sequence. Is it a fields.Selection or is it an ir.sequence or maybe something else?

But you can definitively set a value of a field according to the value of some other fields. Look in the documentation about on_change: on_change of fields — Tryton server

@nicoe Sir,
This is in below field mention- XXXXX. Another field YYYYY
XXXXXX = fields.Selection(
[
(None, ‘’),
(‘aa’, ‘AA’),
(‘bb’, ‘BB’),
(‘cc’, ‘CC’),

    ], 'XXXXXXXX', sort=False,
    )

YYYY = fields.Char(‘YYYY’, ‘Address’, help=“Patient Address”)

output records shoud be in below :
I want to create sequence in YYYY against XXXX field .
If i select aa in XXXX field Then YYYY= AA0001 and after save record its value another value should be AA0002 so on.
If i select bb in XXXX field Then YYYY= BB0001 and after save record its value another value should be BB0002 so on

Well, It seems a bit weird but you can overwrite write method and check if the value of the XXXX field have changed and depending on the value of the field you should generate one sequence or another one and set it to YYYY field.

Well this looks like the numbering of invoice depending of the type.
So the easier is to have a workflow (like in the invoice) that call a method that get a sequence using the first field (like set_number from invoice).
Of course it is possible to do it at creation but it is more complex and may create issue if mistakes are made with the creation value. Also usually in such case, the first field should become readonly if the sequence has been set.