oca / maintenance Goto Github PK
View Code? Open in Web Editor NEWOdoo modules for businesses that implies maintenance tasks
License: GNU Affero General Public License v3.0
Odoo modules for businesses that implies maintenance tasks
License: GNU Affero General Public License v3.0
https://github.com/OCA/maintainer-tools/wiki/Migration-to-version-13.0
Missing module? Check https://github.com/OCA/maintainer-tools/wiki/%5BFAQ%5D-Missing-modules-in-migration-issue-list
Hi,
I tried this module https://github.com/OCA/maintenance/tree/13.0/maintenance_equipment_tags on runbot and read its description "Adds category tags to equipment".
I still don't understand what this module does.
I noticed a menu called "Equipment tags" where it's possible to create different tags, but I don't see how to put a tag on an equipment and how it would be useful. Also, the module says "category tags", but it looks like it's more "Equipment tags".
Could anybody help here? I will then propose a more detailed description of the module once I understand its use.
Thanks for your great work!
Error on the Odoo App store:
maintenance_equipment_status: The license LGPL-3 conflicts with one of its dependencies. Please make sure that you comply with the licenses compatibility. See our FAQ at https://apps.odoo.com/apps/faq#maintainer_faq_04 .
https://github.com/OCA/maintainer-tools/wiki/Migration-to-version-12.0
Hi,
im trying to make a new field in the maintenance.kind model named "notes", to be able to have a detail of tasks of a specific maintenance kind.
there is a way to related this field with another field in the maintenance.request in order to autofill those notes when the preventive maintenance is generated? in the same way like the maintenance_kind_id.
thanks.
Reviewing odoo code and OCA code I found that fields code
and serial_no
should fulfill the same logic.
Serial number is a field that should be used to add our internal serial number, as it is unique in our database. On the other side, partner_ref should be used to write the serial number of the vendor/manufacturer. Both fields are searchable using name
:
https://github.com/odoo/odoo/blob/master/addons/maintenance/views/maintenance_views.xml#L507-L509
So, code and serial_no are internal identifier. I think the sequence should fulfill serial_no. The biggest problem is how to manage the migration, as it could be complicated to manage (Maybe on the migration from 14 to 15?)
WDYT?
Hi,
I tried the following module : https://github.com/OCA/maintenance/tree/13.0/maintenance_equipment_status
I can manage to create statuses in Maintenance>Configuration>Equipment Statuses and can decide which equipment categories will have those statuses.
Then, at the top right corner of the Equipment form view, I can see a ribbon that displays the different statuses that an equipment from a category can have.
Problem : the buttons in the ribbon are not clickable (I guess they are supposed to be clickable just as they usually are elsewhere in Odoo). I can’t select a status from that upper ribbon. And I can’t seem to find anywhere a button or a field that allows me to set a status.
Is it me or this is a bug?
Thank you for your great work! I'm eager to try that module once I figure that out!
Hi team,
The module documentation states that a cron job is used to create maintenance request from the maintenance plan. I've tried to create a maintenance plan but no maintenance request was created. So I saw the source code, and found out that the cron job here is a method and it isn't called anywhere.
To solve the problem, I've tried to add some code snippet to call the cron job method when creating an equipment like this:
@api.model
def create(self, vals):
new_equipment = super(MaintenanceEquipment, self).create(vals)
self._cron_generate_requests()
return new_equipment
Is it a bug or I did something wrong so it didn't work fine?
Thank you.
When we use maintenance, we only find two groups:
base.group_user
maintenance.group_equipment_manager
This is obviously not enough. What I would recommend:
base.group_user
maintenance.group_equipment_manager
There is a module for something similar on OCA, but it is breaking maintenance logic for several reasons:
This is not fitted for a big company with several teams on different areas. For example, I have two teams, one for Building Maintenance and another for IT. We don't want to mix issues between them, but users might be able to create issues on both teams.
I can see two options:
WDYT?
@astirpe @MiquelRForgeFlow [I add you because you were involved at some point with this module]
Hello,
Not withstanding the effort put into this module, which I applaud, I would kindly suggest changing the Label string of the maintenance_ok field to either:
"Can be Maintained"
or
"Can have Maintenance"
PS. I have a pt.po file that you might like to have attached to the i18n directory. To whom should I send this?
https://github.com/OCA/maintainer-tools/wiki/Migration-to-version-17.0
Missing module? Check https://github.com/OCA/maintainer-tools/wiki/%5BFAQ%5D-Missing-modules-in-migration-issue-list
Hi, I'm doing some work around maintenance and I have the necessity to hinerit the 'get_relativedelta' function.
I need to use the original one (as with super()) or doing something else (eg based on the value of step).
But because it is a function and not a method of a class, I think that it is not possible.
So, if I'm right, what do you think to move get_relativedelta inside the MaintenancePlan class?
PS. I did what I need with another way but if it is possible I would prefer to hinerit the get_relativedelta function.
git clone of this repo gives:
warning: remote HEAD refers to non-existent ref, unable to checkout.
Seems something is wrong with the default branch.
Whereas it is still possible to do a git checkout 10.0
afterward this error makes trouble with submodules.
@pedrobaeza Could you try to set again the default branch? (maybe creating a dummy branch set it as default and then set 10.0 as the default again)
When attempting to run the scheduled action to generate planned maintenance requests this error appears in the Odoo server error box and no planned requests are generated. Can you advise what I can do to fix?
ValueError: <class 'TypeError'>: "'<=' not supported between instances of 'NoneType' and 'datetime.date'" while evaluating
'model._cron_generate_requests()'
Odoo 12.0-20210920
Error:
Odoo Server Error
Traceback (most recent call last):
File "F:\Program Files (x86)\Odoo 12.0\server\odoo\tools\safe_eval.py", line 352, in safe_eval
return unsafe_eval(c, globals_dict, locals_dict)
File "", line 1, in
File "f:\program files (x86)\odoo 12.0\server\odoo\addons\maintenance_plan\models\maintenance_equipment.py", line 110, in _cron_generate_requests
equipment._create_new_request(plan)
File "f:\program files (x86)\odoo 12.0\server\odoo\addons\maintenance_plan_activity\models\maintenance.py", line 21, in _create_new_request
new_requests = super()._create_new_request(maintenance_plan)
File "f:\program files (x86)\odoo 12.0\server\odoo\addons\maintenance_plan\models\maintenance_equipment.py", line 88, in _create_new_request
while next_maintenance_date <= horizon_date:
TypeError: '<=' not supported between instances of 'NoneType' and 'datetime.date'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "F:\Program Files (x86)\Odoo 12.0\server\odoo\http.py", line 656, in _handle_exception
return super(JsonRequest, self)._handle_exception(exception)
File "F:\Program Files (x86)\Odoo 12.0\server\odoo\http.py", line 314, in _handle_exception
raise pycompat.reraise(type(exception), exception, sys.exc_info()[2])
File "F:\Program Files (x86)\Odoo 12.0\server\odoo\tools\pycompat.py", line 87, in reraise
raise value
File "F:\Program Files (x86)\Odoo 12.0\server\odoo\http.py", line 698, in dispatch
result = self._call_function(**self.params)
File "F:\Program Files (x86)\Odoo 12.0\server\odoo\http.py", line 346, in _call_function
return checked_call(self.db, *args, **kwargs)
File "F:\Program Files (x86)\Odoo 12.0\server\odoo\service\model.py", line 98, in wrapper
return f(dbname, *args, **kwargs)
File "F:\Program Files (x86)\Odoo 12.0\server\odoo\http.py", line 339, in checked_call
result = self.endpoint(*a, **kw)
File "F:\Program Files (x86)\Odoo 12.0\server\odoo\http.py", line 941, in call
return self.method(*args, **kw)
File "F:\Program Files (x86)\Odoo 12.0\server\odoo\http.py", line 519, in response_wrap
response = f(*args, **kw)
File "f:\program files (x86)\odoo 12.0\server\odoo\addons\web\controllers\main.py", line 967, in call_button
action = self._call_kw(model, method, args, {})
File "f:\program files (x86)\odoo 12.0\server\odoo\addons\web\controllers\main.py", line 955, in _call_kw
return call_kw(request.env[model], method, args, kwargs)
File "F:\Program Files (x86)\Odoo 12.0\server\odoo\api.py", line 759, in call_kw
return _call_kw_multi(method, model, args, kwargs)
File "F:\Program Files (x86)\Odoo 12.0\server\odoo\api.py", line 746, in _call_kw_multi
result = method(recs, *args, **kwargs)
File "f:\program files (x86)\odoo 12.0\server\odoo\addons\base\models\ir_cron.py", line 83, in method_direct_trigger
self.sudo(user=cron.user_id.id).ir_actions_server_id.run()
File "f:\program files (x86)\odoo 12.0\server\odoo\addons\base\models\ir_actions.py", line 546, in run
res = func(action, eval_context=eval_context)
File "f:\program files (x86)\odoo 12.0\server\odoo\addons\base\models\ir_actions.py", line 437, in run_action_code_multi
safe_eval(action.sudo().code.strip(), eval_context, mode="exec", nocopy=True) # nocopy allows to return 'action'
File "F:\Program Files (x86)\Odoo 12.0\server\odoo\tools\safe_eval.py", line 375, in safe_eval
pycompat.reraise(ValueError, ValueError('%s: "%s" while evaluating\n%r' % (ustr(type(e)), ustr(e), expr)), exc_info[2])
File "F:\Program Files (x86)\Odoo 12.0\server\odoo\tools\pycompat.py", line 86, in reraise
raise value.with_traceback(tb)
File "F:\Program Files (x86)\Odoo 12.0\server\odoo\tools\safe_eval.py", line 352, in safe_eval
return unsafe_eval(c, globals_dict, locals_dict)
File "", line 1, in
File "f:\program files (x86)\odoo 12.0\server\odoo\addons\maintenance_plan\models\maintenance_equipment.py", line 110, in _cron_generate_requests
equipment._create_new_request(plan)
File "f:\program files (x86)\odoo 12.0\server\odoo\addons\maintenance_plan_activity\models\maintenance.py", line 21, in _create_new_request
new_requests = super()._create_new_request(maintenance_plan)
File "f:\program files (x86)\odoo 12.0\server\odoo\addons\maintenance_plan\models\maintenance_equipment.py", line 88, in _create_new_request
while next_maintenance_date <= horizon_date:
ValueError: <class 'TypeError'>: "'<=' not supported between instances of 'NoneType' and 'datetime.date'" while evaluating
'model._cron_generate_requests()'
Hello,
I've got a v12 installation of maintenance_plan
prior to 12.0.2.3.0
. This version adds some new features for plans, like a specific view and menu, which shows plans together.
Plans still haven't company_id
field, so in this view you can see plans linked to equipments of other companies, and a permission error is raised when accessing to it. And equipment is not a required field for plans.
For this situation, which is the more suitable solution, adding a domain filter for thar view in order to prevent accessing to "forbidden" plans, or directly adding company_id
field for plans?
Dear all, I'm beginner, are there button/action that generate all future maintenance requests from maintenance plans with their frequencies and orizon?
tks
regards
module: maintenance_plan
version: 13.0
Is there an Odoo V16 version available any time soon for this module "maintenance_plan"?
"equipment.request.form.inherit"
https://github.com/OCA/maintainer-tools/wiki/Migration-to-version-15.0
Missing module? Check https://github.com/OCA/maintainer-tools/wiki/%5BFAQ%5D-Missing-modules-in-migration-issue-list
Just for who as me that can have some doubts, I think it is better to add dependencies from maintenance_equipment_category_kanban to this module, otherwise it hasn't effect right? Until you don't create your own kanban view.
Hi,
Maintenance_location is currentry AGPL.
I am currently working on an enterprise module and I would like to introduce the notion of maintenance.location in this one.
More precisely, I work on the link between mrp and maintenance (module: mrp_maintenance).
A module with a "enterprise" or "other proprietary" license can't depend on a module with a AGPL License.
Would you agree to change its license to LGPL?
As authors and contributors, do you have any objection to that @etobella @kluna1998 @olgamarcocb @IT-Ideas ?
Is your feature request related to a problem?
It is not causing an error now, but I consider as a bug and may need improvement,
The current behavior is creating the same equipment category when validating vendor bills for "can be maintained item" when the item is tracked by serial and the purchase qty more than 1, in combination with creating the assets (an asset profile is selected)
Step to reproduce:
0. Install The OCA asset management module, and create an asset profile
Expected behavior --> only 1 equipment category should be created (Laptop) and all the 10 units of laptop items in the same equipment category.
Hi I'm looking to know if there is a timeline on when the maintenance plan app will be updated to v16.
Allowing for multiple preventative maintenance tasks.
Is your feature request related to a problem?
No
Describe the solution you'd like
Can we add maintenance_spare_parts functionality to link the maintenance request and equipment with spare parts using. I assume a scenario like this:
I'm working in several modules where it would be nice to have a button box in maintenance.request
's form.
The thing is that I dont want to add it in one of this modules since then all modules that want to use the button box will depend on it, which doesn't make sense.
The other solution is to create a module that adds the button box to it, but creating a module just for that... Which would be the best solution? Maybe creating a base_maintenance
module and include this kind of things there.
Hi,
the current next_maintenance_date
is defined as a computed, non-stored field. The compute method (_compute_next_maintenance
) has an api.depends
decorator, but compute method is always executed, because the field hasn't the store attribute set to True
. I think it's incorrect.
One consequence of this issue is a very slow performance in request generations via cron (method _cron_generate_requests
), since next_maintenance_date
value is needed when creating the requests. I've tested that method with more than 1,000 requests to be created: with the current definition it takes more than half an hour (actually I stopped execution); with store=True
it took only about two minutes.
If my analysis is correct, I can make a PR to change this.
https://github.com/OCA/maintainer-tools/wiki/Migration-to-version-16.0
Missing module? Check https://github.com/OCA/maintainer-tools/wiki/%5BFAQ%5D-Missing-modules-in-migration-issue-list
This affect all versions of this module but I will use v13 to show the problem.
Imagine you have a maintenance plan, say annually, and the next maintenance date is 2021-10-01 and you have already the maintenance request in place to be completed. At this point the next maintenance date showed in the plan is 2021-10-01, which is correct. However if you finish the maintenance request some days before the deadline, for instance on 2021-09-29, the next maintenance date will continue to be 2021-10-01 which is not correct anymore.
This is the problematic method:
@api.depends(
"interval",
"interval_step",
"maintenance_kind_id",
"equipment_id.maintenance_ids.request_date",
"equipment_id.maintenance_ids.close_date",
"equipment_id.maintenance_ids.maintenance_kind_id",
)
def _compute_next_maintenance(self):
for plan in self.filtered(lambda x: x.interval > 0):
interval_timedelta = get_relativedelta(plan.interval, plan.interval_step)
next_maintenance_todo = self.env["maintenance.request"].search(
[
("equipment_id", "=", plan.equipment_id.id),
("maintenance_type", "=", "preventive"),
("maintenance_kind_id", "=", plan.maintenance_kind_id.id),
("maintenance_plan_id", "=", plan.id),
("stage_id.done", "!=", True),
("close_date", "=", False),
],
order="request_date asc",
limit=1,
)
if next_maintenance_todo:
plan.next_maintenance_date = next_maintenance_todo.request_date
else:
next_date = plan.start_maintenance_date
while next_date < fields.Date.today():
next_date = next_date + interval_timedelta
plan.next_maintenance_date = next_date
We have 2 options here, consider the next date as:
A) 2022-10-01, this respects the maintenance plan.
B) 2022-09-29, this is one year from the last maintenance request completion.
What do you think would be the best option to fix this bug?
Hello,
if I try to install maintenance_plan, I get the following error:
View name: equipment.request.form.inherit
Error context:
view: ir.ui.view(1596,)
xmlid: hr_equipment_request_view_form
view.model: maintenance.request
view.parent: ir.ui.view(407,)
file: /home/odoodev/git/maintenance/maintenance_plan/views/maintenance_equipment_views.xml
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/home/odoodev/git/odoo/odoo/service/server.py", line 1198, in preload_registries
registry = Registry.new(dbname, update_module=update_module)
File "/home/odoodev/git/odoo/odoo/modules/registry.py", line 89, in new
odoo.modules.load_modules(registry._db, force_demo, status, update_module)
File "/home/odoodev/git/odoo/odoo/modules/loading.py", line 455, in load_modules
loaded_modules, update_module, models_to_check)
File "/home/odoodev/git/odoo/odoo/modules/loading.py", line 348, in load_marked_modules
perform_checks=perform_checks, models_to_check=models_to_check
File "/home/odoodev/git/odoo/odoo/modules/loading.py", line 221, in load_module_graph
load_data(cr, idref, mode, kind='data', package=package)
File "/home/odoodev/git/odoo/odoo/modules/loading.py", line 69, in load_data
tools.convert_file(cr, package.name, filename, idref, mode, noupdate, kind)
File "/home/odoodev/git/odoo/odoo/tools/convert.py", line 733, in convert_file
convert_xml_import(cr, module, fp, idref, mode, noupdate)
File "/home/odoodev/git/odoo/odoo/tools/convert.py", line 799, in convert_xml_import
obj.parse(doc.getroot())
File "/home/odoodev/git/odoo/odoo/tools/convert.py", line 719, in parse
self._tag_root(de)
File "/home/odoodev/git/odoo/odoo/tools/convert.py", line 685, in _tag_root
)) from e
odoo.tools.convert.ParseError: while parsing /home/odoodev/git/maintenance/maintenance_plan/views/maintenance_equipment_views.xml:59, near
<record id="hr_equipment_request_view_form" model="ir.ui.view">
<field name="name">equipment.request.form.inherit</field>
<field name="model">maintenance.request</field>
<field name="inherit_id" ref="maintenance.hr_equipment_request_view_form"/>
<field name="arch" type="xml">
<data><field name="maintenance_type" position="after">
<field name="maintenance_kind_id"/>
</field>
<field name="description" position="replace">
<notebook>
<page string="Instructions">
<field name="note" placeholder="Describe the maintenance to do..."/>
</page>
<page string="Notes">
<field name="description" placeholder="Internal notes..."/>
</page>
</notebook>
</field>
</data></field>
</record>
As it says that the notebook element is not allowed in a tree, the <field name="description" position="replace">
is not specific enough as there might be two fields description in the same view?
This line should be:
self.partner_id = first_seller.partner_id
instead of self.partner_id = first_seller.name
Hi,
Currently working on maintenance_timesheet migration and once I inherit the button_box from base_maintenance the following error is thrown:
Also the timesheet colspan seems wrong set (is taking more room than needed):
The PR to fix it: #351
And if you want to check the actual error it can be done on this PR runbot: #352
Regards
https://github.com/OCA/maintainer-tools/wiki/Migration-to-version-14.0
Missing module? Check https://github.com/OCA/maintainer-tools/wiki/%5BFAQ%5D-Missing-modules-in-migration-issue-list
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.