Conversation
3d92f90 to
6e4e287
Compare
|
Tests failing are not due to the changes proposed here: #111 |
6e4e287 to
3c447eb
Compare
| self.env["sale.order"].create( | ||
| { | ||
| "company_id": self.company_id.id, | ||
| "partner_id": partners.id, | ||
| "warehouse_id": picking_types.warehouse_id.id, | ||
| "repair_order_ids": [Command.link(ro.id) for ro in self], | ||
| } | ||
| ) |
There was a problem hiding this comment.
just for future usage, we could add a hook here to pass values to be used to create the SO
3c447eb to
7a02fd5
Compare
18db9bf to
a29b2a0
Compare
a29b2a0 to
8ff60e9
Compare
8ff60e9 to
e867812
Compare
e867812 to
e7fbf35
Compare
| ref_str = "\n".join(ro.name for ro in already_linked) | ||
| error_msg = ( | ||
| "You cannot create a quotation for repair orders already linked to " | ||
| f"a sale order:\n{ref_str}" |
There was a problem hiding this comment.
You can't interpolate a string before it's translated, the dynamic translation term won't ever be matched.
Please use the built-in string interpolation self.env._("This is something: %s", something)
| ) | ||
| raise UserError(self.env._(error_msg)) | ||
| picking_types = self.mapped("picking_type_id") | ||
| if not picking_types or len(picking_types) != 1: |
There was a problem hiding this comment.
| if not picking_types or len(picking_types) != 1: | |
| if len(picking_types) != 1: |
redundant
| ) | ||
|
|
||
| partners = self.mapped("partner_id") | ||
| if not partners or len(partners) != 1: |
There was a problem hiding this comment.
| if not partners or len(partners) != 1: | |
| if len(partners) != 1: |
redundant
| if move.repair_id.sale_order_id | ||
| else False, |
There was a problem hiding this comment.
| if move.repair_id.sale_order_id | |
| else False, |
redundant. move.repair_id.sale_order_id.id will be False if any recordset in the chain is empty
There was a problem hiding this comment.
Perhaps you can avoid the whole thing if the move.repair_id.sale_order_id is empty. Cause it makes no sense to do the search in this case
|
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. |
Odoo base repair module already allows to have one quotation for multiple repairs, but it is not possible for a user to do this. I am repairing several devices for the customer and the customer just want one single quotation for them all.