-
-
Notifications
You must be signed in to change notification settings - Fork 195
[18.0][MIG] maintenance_purchase: Migration to version 18.0 #536
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
base: 18.0
Are you sure you want to change the base?
[18.0][MIG] maintenance_purchase: Migration to version 18.0 #536
Conversation
Currently translated at 100.0% (12 of 12 strings) Translation: maintenance-14.0/maintenance-14.0-maintenance_purchase Translate-URL: https://translation.odoo-community.org/projects/maintenance-14-0/maintenance-14-0-maintenance_purchase/it/
Currently translated at 100.0% (12 of 12 strings) Translation: maintenance-14.0/maintenance-14.0-maintenance_purchase Translate-URL: https://translation.odoo-community.org/projects/maintenance-14-0/maintenance-14-0-maintenance_purchase/it/
…tegory before creating it
…houldn't be maintained
Currently translated at 100.0% (12 of 12 strings) Translation: maintenance-14.0/maintenance-14.0-maintenance_purchase Translate-URL: https://translation.odoo-community.org/projects/maintenance-14-0/maintenance-14-0-maintenance_purchase/it/
Currently translated at 100.0% (12 of 12 strings) Translation: maintenance-14.0/maintenance-14.0-maintenance_purchase Translate-URL: https://translation.odoo-community.org/projects/maintenance-14-0/maintenance-14-0-maintenance_purchase/es/
Currently translated at 100.0% (12 of 12 strings) Translation: maintenance-14.0/maintenance-14.0-maintenance_purchase Translate-URL: https://translation.odoo-community.org/projects/maintenance-14-0/maintenance-14-0-maintenance_purchase/it/
Currently translated at 100.0% (9 of 9 strings) Translation: maintenance-16.0/maintenance-16.0-maintenance_purchase Translate-URL: https://translation.odoo-community.org/projects/maintenance-16-0/maintenance-16-0-maintenance_purchase/fr/
|
/ocabot migration maintenance_purchase |
pedrobaeza
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Several comments:
- I don't think we need the
maintenance_productdependency as well. It's not adding value. - We should remove the flag at product level, as if you put a equipment category is enough for determining that you want to create an equipment. Why would you want to set an equipment category, but not to create an equipment? I know there's an automatism for setting the equipment category according the product category, but this is inherited from the other module, and we come back to the first point.
- Prepare the creation method to be inheritable for
maintenance_product_stockfor inhibiting the equipment creation when confirming, so better to refactor this creation into a separate method.
|
I think I get what you mean, but that would be a mayor refactor on how the module works right now, as instead of everything working by default configurations at product level using |
310eaca to
cb3ee02
Compare
victoralmau
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code review OK
| type="object" | ||
| class="oe_stat_button" | ||
| icon="fa-cubes" | ||
| invisible="not equipment_count" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| invisible="not equipment_count" | |
| invisible="not equipment_count" | |
| groups="base_maintenance_group.group_maintenance_user" |
| expr="//notebook//field[@name='order_line']/list/field[@name='product_qty']" | ||
| position="before" | ||
| > | ||
| <field name="equipment_category_id" optional="hide" /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| <field name="equipment_category_id" optional="hide" /> | |
| <field name="equipment_category_id" optional="hide" groups="base_maintenance_group.group_maintenance_user" /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure about adding dependency to base_maintenance_group ngl
Right now is as well not direct, as even linking the equipment category in the product category, you need to put the check at product level, so it's very counter-intuitive (and the reason we weren't able to generate the equipment in our first tests), so I still think it's good to refactor it that way. Changing the boolean at product level to be by default True is as well counter-intuitive, as it won't work unless the equipment category is put at product category, so both options are very bad combined. You can keep the equipment category at product category level as default value for the purchase, but without depending on |
|
Instead of removing the dependency to |
123aff4 to
fb0261f
Compare
|
No more "black magic" here. Now, if the category is removed, the equipment will not be created. If the category is set, the equipment will be created even if the product does not have the maintenance check. |
| "author": "CreuBlanca,Odoo Community Association (OCA)", | ||
| "website": "https://github.com/OCA/maintenance", | ||
| "depends": [ | ||
| "maintenance_product", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why maintaining then this dependency? I want to be a stand-alone module.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To retain part of the old behavior, the equipment category is auto-filled from the product category, to avoid setting it on every purchase line.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I prefer to not have it for not dragging that module that is half baked imo
82fee59 to
3867104
Compare
|
Added the posibility of changing the quantity to a higher value and creating the remaining equipments when re-confirming the purchase |
3867104 to
f7a7f99
Compare

Replaced the dependency on
maintenance_accountwithmaintenance_product, as the module works correctly without the accounting dependencyEDIT:
Also removed
purchase_stockdependency topurchase@Tecnativa TT59851
@pedrobaeza @victoralmau