shopinvader / odoo-shopinvader

Odoo Modules. Sorry Magento, Shopinvader is coming
GNU Affero General Public License v3.0
119 stars 102 forks source link

Migration to version 12.0 #317

Closed rousseldenis closed 1 year ago

rousseldenis commented 5 years ago

Todo

https://github.com/OCA/maintainer-tools/wiki/Migration-to-version-12.0

Modules to migrate

rousseldenis commented 5 years ago

cc @shopinvader I've just created this + 12.0 main branch

rousseldenis commented 5 years ago

@shopinvader Shouldn't 'base_url' module go to odoo-misc repository ?

sebastienbeau commented 5 years ago

Yes we can move it here

sebastienbeau commented 5 years ago

Regarding the migration it can be great if we can split the shopinvader is smaller module see here: : https://trello.com/c/uRTCjbuD/149-split-shopinvader-base-module-should-not-depend-on-sale @bealdav maybe interested for helping on this point

rousseldenis commented 5 years ago

@sebastienbeau : I had a discussion with @lmignon and we let base_url in odoo-shopinvader for now as he wanted to keep 10.0 and 12.0 branches equals. But planning that after 12.0 migration

sebastienbeau commented 5 years ago

ok for me

simahawk commented 4 years ago

@sebastienbeau @rousseldenis time to update this list? :stuck_out_tongue_closed_eyes: Among the ones missing I've just found https://github.com/shopinvader/odoo-shopinvader/tree/10.0/shopinvader_product_template_multi_link cross/up-selling is something we need. Do you have a plan / need for this? What about the name? Shall we find a better one?

lmignon commented 4 years ago

@simahawk No need on our side for the moment. But the migration should be very easy. Feels free to find a better name :smirk:

simahawk commented 4 years ago

@lmignon ok, thanks for the feedback :smirk: NOTE: shopinvader_algolia is migrated :wink:

lmignon commented 4 years ago

@simahawk Regarding shopinvader_product_template_multi_link, IMO we should improve the implementation. Indeed actually when you create a link from product a to product b, you must also create the reverse link between b and a...

simahawk commented 4 years ago

@lmignon I'm checking the implementation: now I get why it has been called like that. It depends on https://github.com/OCA/e-commerce/tree/10.0/product_template_multi_link which too me sounds over complicated. To me we could simply have m2m fields w/ their inverses. What do you think?

lmignon commented 4 years ago

I like the idea to be able to 'type' a link between two products.

Something like

class ProductLinkType(models.Model):
    _name='product.link.type"

    name = fields.Char()
    inverse_name = fields.Char()

class ProductLink(models.Model):
    _name='product.link"

   product_tmpl_id_left = fiedls.Many2one()
   product_tmpl_id_right = fiedls.Many2one()  
   product_link_type = fields.Many2one()
   link_type_name = fields.Char(related="product_link_type.name") # left to right
   link_type_inverse_name = fields.Char(related="product_link_type.invese_name") # right to left

class ProductTemplate(models.Model):
    _inherit = "product.template"

    product_link_ids = fields.One2many(comodel_name="product.link")
        compute="_compute_product_link_ids",
    )

    @api.multi
    def _compute_product_link_ids(self):
        link_model = self.env["product.link"]
        domain = [
            "|",
            ("product_tmpl_id_left", "in", self.ids),
            ("product_tmpl_id_right", "in", self.ids),
        ]
        links = link_model.search(domain)
        links_by_product_id = defaultdict(link_model.browse)
        for link in links:
            links_by_product_id[link.product_tmpl_id_left.id] |= link
            links_by_product_id[link.product_tmpl_id_right.id] |= link
        for record in self:
            record.product_link_ids = links_by_product_id[
                record.id
            ]

With this kind of implementation:

simahawk commented 4 years ago

Seems a good starting point :) Can you move this to a specific issue? Maybe straight on e-commerce repo.

lmignon commented 4 years ago

@simahawk here it is https://github.com/OCA/e-commerce/issues/307

github-actions[bot] commented 1 year ago

There hasn't been any activity on this issue in the past 6 months, so it has been marked as stale and it will be closed automatically if no further activity occurs in the next 30 days. If you want this issue to never become stale, please ask a PSC member to apply the "no stale" label.