Open odooNextev opened 4 months ago
@odooNextev can you add docs files?
@odooNextev can you add docs files?
Is it enough?
Looks good thanks!
/ocabot migration sale_commission_product
There hasn't been any activity on this pull request in the past 4 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 PR to never become stale, please ask a PSC member to apply the "no stale" label.
I don't know exactly if it can be defined as a migration itself, but I started from
sale_commission_product
module for this project, I kept commits history and mostly the goal of my module is the same as initial version8.0
.In fact this module allows users to set dedicated agents on
product.template
(unlike8.0
version which added the agent field onproduct.product
) and they will find insale.order.line
both agents on SO partner and agents on SOL product.Talking about computation, I simplified what was done in
8.0
version and I hope it can be enough. In particular I only extended_prepare_agents_vals_partner
method to add product agents to partner agents array returned from originalsale_commission
method. To trigger this method on product changing, I had to add@api.depends("product_id")
to_compute_agent_ids
ofsale.order.line
andaccount.move.line
. By the way, I followed what was done in8.0
version and I added account section even if_compute_agent_ids
method ofaccount.move.line
it's insideaccount_commission
and not insale_commission
. Alternatively we could change the module name to include "account" or create a separated module likeaccount_commission_product
, but I don't know if it's worth it. Anyway I addedaccount_commission
to depends.