Hi guys, not even professionals are able to solve this problem ?
Is it really impossible to do ?
How to create in Odoo a series of conditions and depending on value change the way of how will be built a string based on other fields?
in php it's simple task and it may look like this:
if ($itype ="type1"){
$prod_name = $field2 . $field4 . $field12 };
if ($itype = "type2"){
$prod_name = $field1 . $field3 . $field6};
and so forth .... simple right ?
so based on this example can ANYONE show me how to do this ?
...
field_0 = self.field_0 or ' '
field_1 = self.field_1 or ' '
field_2 = self.field_2 or ' '
-> if value of selection field = some value:
name = ustr(field_0) + ' ' + ustr(field_1) + ' ' + ustr(field_2)
-> if value of selection field = other value:
name = ustr(field_5) + ' ' + ustr(field_7) + ' ' + ustr(field_12)
...
Do I'm on a good way ?
onchange ?
def onchange_state(self, cr, uid, ids, state, context=None): if x = state: state if x == "value": return {name = ustr(field_0) + ' ' + ustr(field_1) + ' ' + ustr(field_2)}
and so forth ... ?
Is it really impossible ?