Exemplo n.º 1
0
 def __isub__(self, records):
     if not self._from_record:
         raise error.InternalError("No parent record to update")
     try:
         list(records)
     except TypeError:
         records = [records]
     parent = self._from_record[0]
     field = self._from_record[1]
     updated_values = parent._values_to_write[field.name]
     values = []
     if updated_values.get(parent.id):
         values = updated_values[parent.id][:]  # Copy
     from odoorpc import fields
     for id_ in fields.records2ids(records):
         if (4, id_) in values:
             values.remove((4, id_))
         if (3, id_) not in values:
             values.append((3, id_))
     return values
Exemplo n.º 2
0
 def __isub__(self, records):
     if not self._from_record:
         raise error.InternalError("No parent record to update")
     try:
         list(records)
     except TypeError:
         records = [records]
     parent = self._from_record[0]
     field = self._from_record[1]
     updated_values = parent._values_to_write[field.name]
     values = []
     if updated_values.get(parent.id):
         values = updated_values[parent.id][:]  # Copy
     from odoorpc import fields
     for id_ in fields.records2ids(records):
         if (4, id_) in values:
             values.remove((4, id_))
         if (3, id_) not in values:
             values.append((3, id_))
     return values