Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ManyToMany Relation delete entry error #373

Open
Martin78 opened this issue May 22, 2018 · 0 comments
Open

ManyToMany Relation delete entry error #373

Martin78 opened this issue May 22, 2018 · 0 comments

Comments

@Martin78
Copy link

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);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant