Odoo-mobile / framework

Odoo Mobile Framework
https://play.google.com/store/apps/dev?id=8607973775002477408
Other
327 stars 374 forks source link

ManyToMany Relation delete entry error #373

Open Martin78 opened 6 years ago

Martin78 commented 6 years ago

I have a Many To Many Relation between 2 tables. Inserting a relation is reflected correctly in the SQLite database but when i remove a Relation between the 2 tables its not updated on my Android device in the database. On the Odoo server the database is updated correctly. Anyone has the same issue?

My Odoo ORM:

class HtsProductOptions(models.Model):
    _name = 'product.options'
    _inherits = {'product.product': 'product_id'}
    _rec_name = 'name'

    product_id = fields.Many2one('product.product', 'Product',
                                 ondelete="cascade", delegate=True, required=True)
    price = fields.Float(related='product_id.lst_price', string="Price")
class HtsProductOptionsGroups(models.Model):
    _name = 'product.options_groups'

    name = fields.Char('Name', required=True)
    set_product_option_id = fields.Many2many('product.options',
                                             relation='product_options_product_options_groups_rel',
                                             column1='product_option_group_id',
                                             column2='product_option_id',
                                             string='Products Options')

On Odoo mobile framework:

public class ProductOptionsGroups extends OModel {
    public static final String AUTHORITY =
            "com.odoo.core.provider.content.sync.product_options_groups";

    OColumn name = new OColumn("Name", OVarchar.class).setSize(100).setRequired();
    OColumn set_product_option_id = new OColumn("Products Options", ProductOptions.class, OColumn.RelationType.ManyToMany)
            .setRelBaseColumn("product_option_group_id")
            .setRelRelationColumn("product_option_id")
            .setRelTableName("product_options_product_options_groups_rel");
public class ProductOptions extends OModel {
    public static final String AUTHORITY =
            "com.odoo.core.provider.content.sync.product_options";

    OColumn htspos_id = new OColumn("htspos_id", OInteger.class).setDefaultValue(0);
    OColumn name = new OColumn("Name", OVarchar.class).setSize(100).setRequired();OBoolean.class).setDefaultValue(true);
    OColumn list_price = new OColumn("list_price", OFloat.class);