Closed rousseldenis closed 1 year ago
cc @shopinvader I've just created this + 12.0 main branch
@shopinvader Shouldn't 'base_url' module go to odoo-misc repository ?
Yes we can move it here
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
@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
ok for me
@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?
@simahawk No need on our side for the moment. But the migration should be very easy. Feels free to find a better name :smirk:
@lmignon ok, thanks for the feedback :smirk:
NOTE: shopinvader_algolia
is migrated :wink:
@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...
@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?
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:
Seems a good starting point :) Can you move this to a specific issue? Maybe straight on e-commerce repo.
@simahawk here it is https://github.com/OCA/e-commerce/issues/307
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.
Todo
https://github.com/OCA/maintainer-tools/wiki/Migration-to-version-12.0
Modules to migrate