Issue
-----
The module lunch generate ir.cron and thus server action when
lunch.supplier and lunch.alert are created.
Those server action are counted as customization by cloc and thus
customer should pays maintenance fee just for the installation of
data_merge module
Cron are deleted when supplier and alert are deleted but the server
action remains.
Solution
--------
Avoid to count server action generated by lunch by adding
a xml_id from lunch module to those SA
Delete server actions as well
closesodoo/odoo#82576
X-original-commit: cafd96dde8df79e7158b156b961657941b0265cb
Signed-off-by: Julien Castiaux <juc@odoo.com>
Signed-off-by: Thibault Francois <tfr@odoo.com>
There is a default Available Today filter on products view but it is not
enough to prevent a very hungry employee to order a product from a vendor
not available today if he removes the filter.
closesodoo/odoo#81866
X-original-commit: 7ec9ab0e9efd87c9e49f72f5f9fc5e43108ed591
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
Signed-off-by: Alex Thuyls (alt) <alt@odoo.com>
It was no longer possible to favorite a product and the already
favorited products were not showing.
closesodoo/odoo#81692
Taskid: 2704569
X-original-commit: 328e0384cc2cff34fc5c4131014d94efb5747cb5
Signed-off-by: Kevin Baptiste <kba@odoo.com>
There was no way for the lunch manager to notify users that their meal
had arrived prior to this commit besides manually sending a message to
the concerned users.
There now is a dedicated button after the order has been confirmed by
the lunch manager to send notifications.
TaskId-2587476
closesodoo/odoo#78649
Signed-off-by: Kevin Baptiste <kba@odoo.com>
Steps:
- Set a supplier's 'Timezone' at a different timezone from utc.
- Set 'Send Order By: Email' and set any 'Order Time'.
Result:
E-mail will be sent at wrong time.
Explanation:
According to pytz, using tzinfo arg in the standard datetime constructor "does not work" in combination with pytz. Yet lunch_supplier.float_to_time() calls time.replace() which calls this constructor.
Solution:
Don't allow lunch_supplier.float_to_time() to modify tzinfo and use pytz.localize() in _auto_email_send() to specify the right tzinfo.
opw-2541132
closesodoo/odoo#78091
X-original-commit: 6b92fd80c4fc3471a4419369f0c6843fe18bad51
Signed-off-by: Audric Onockx <auon-odoo@users.noreply.github.com>
Signed-off-by: Kevin Baptiste <kba@odoo.com>
In case a vendor needs to deliver to more than one location site, we should
add the location name and address in the email sent to him.
closesodoo/odoo#75423
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
When a vendor is (un)archived, we should (un)archive all related products
as well to avoid displaying archived vendors and products in the search
panel of the Order lunch and Products list views.
closesodoo/odoo#73007
X-original-commit: 259d2f36cc73892ef295a6cfdc7e72340bfd9afd
Signed-off-by: Alex Tuyls <alt-odoo@users.noreply.github.com>
When a lunch manager tries to archive a vendor, we automatically update its
related cron. This is triggering an access rights error if the user does not
have access to ir.cron model. We should allow him to archive the vendor
without error.
closesodoo/odoo#72750
X-original-commit: 5b8eff9d771a9071327473d2185624f69e1057c1
Signed-off-by: Julien Castiaux <Julien00859@users.noreply.github.com>
Signed-off-by: Alex Tuyls <alt-odoo@users.noreply.github.com>
Co-authored-by: Julien Castiaux <juc@odoo.com>
Replace text fields to html fields as we have our own 'OdooEditor'.
Indeed, it gives more options to users in the way they format their
content without weighting too much on the UI
(tools appear on demand and not by default).
Models -> Fields
1) fleet.vehicle -> description
2) fleet.vehicle.log.contract -> notes
3) hr.job -> description
4) hr.contract -> note
5) hr.leave.allocation -> notes
6) hr.applicant -> description
7) lunch.product -> description
8) lunch.order -> product_description
9) lunch.product.report -> description
Task Id: 2499504
X-original-commit: afe52b050a7667f3f20696cd48cd922f635a941c
with this commit we changes field names for week days like su, mo, tu etc. to
sun, mon, tue and so on in calendar module, this is going to be used in
task 2317795 where we developed recurrency module for recurrency mixin.
Also with this commit we change field names of weekdays in lunch module to have
same name as we have in calendar and project module so that we can easily use
custom widget "web_weekly_recurrence" instead of defining boolean field in xml
for each day.
task-2335399
Co-authored-by: Mohammed Shekha <msh@odoo.com>
The Lunch module can automatically send an email to a supplier with the
daily orders at a configured time. It can also remind the users via chat
so they don't forget to order their sanddwish.
Before, two high frequency cron jobs were responsible to check every 20
and 5 minutes if we reached the moment when to send the email to the
suppliers or the notification to the users. Together the two crons were
executed 360 times a day.
The new model uses a dedicated daily cron per supplier record and per
alert record, the dedicated cron is created on the fly and its moment of
execution automatically updated to reflect the supplier/alert record.
See also #41858 for prior work.
closesodoo/odoo#63749
Task: 2416741
Related: odoo/upgrade#2044
Signed-off-by: Julien Castiaux <Julien00859@users.noreply.github.com>
1) Extra Items
Issue: Adding an extra to one menu item, automatically adds it to the other food items in the same order.
Expected Behavior: When adding an extra, it should only be associated to
the food item for which it was selected, and NOT applied to the other ordered items.
For example, if I select a "Ranch" dressing for the "Chef Salad",
the ranch should not appear as an extra for the "Cheeseburger" or "Cookie of the Day".
2) Unable to Submit Certain Orders
Issue: Odoo prevents the user from submitting an order in the following case
(better illustrated through an example). If you select a "Chef Salad", you will be prompted to select a "Dressing Choice",
because the configuration is set to select one and only one extra.
You cannot add the salad to the cart without selecting a dressing,
nor can you proceed if you have more than one dressing selected;
this is functioning as expected. The problem, however, comes when you
select a dressing and add the salad to the cart, and now you try to add a
dressing as its own order item (separate from any salad). Even though the
salad has its own dressing selected, and the separate dressing is its own item,
the error message: "You have to order one and only one Dressing choice" appears and
prevents the order from being submitted. This issue may be a consequence of the behavior observed in the first issue.
Expected Behavior: The user should be able to submit the order in
this case because the salad had only one dressing associated with it,
and the extra dressing is supposed to be its own item.
This should not create a conflict with the "only one" extra logic.
Step to reproduce (edv)
Reproducible on runbot.
1) Extra Items
https://drive.google.com/file/d/1yos9coFqd55pq8qNbNs1OqGNMNSdgxDX/view
2) Unable to Submit Certain Orders
https://drive.google.com/file/d/1M0ZEElu-hYwU9bmCwEx_tqEZRAPG_UEt/view
opw-2391070
closesodoo/odoo#63435
X-original-commit: a8467765b97e429712b79d41f88492993f8620ea
Signed-off-by: Achraf <abz-odoo@users.noreply.github.com>
Purpose
=======
Improve the lunch categories and mutli-company environment.
Specifications
============
- Able to archive a product category and this should archive/unarchive
all the products in that category also added the filter for same.
when unrchive the product if category is archived then raise the
Validation to change the category OR unarchive the category.
- add a default image for lunch categories
- Adapt the size of the default image, currently it's too big,
- On lunch order form view if product images is not set then display
the category image same as kanban image.
- Add a company field on the Product categories (it's already there
but it should be visible on the view form). Added the multi company
rule for the product category and if company is not set on category
then it will be sharable by all the company. so default company on
product category null.
also on lunch product and report check the multi company and display
the product accroding to company.
closes odoo/odoo#45797
Taskid: 2200002
Closes: #45797
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
For performance reasons, the company_id of a lunch supplier is now
stored.
In a multi-company environment, the multi-company ir.rule was loading
*all* the suppliers in order to check their related company_id.
closesodoo/odoo#42631
Taskid: 2152319
X-original-commit: 0a73eeb0d3163c2c47fb2d25da024ed4a16824ff
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
Now we can translate name and description field in lunch.product object
and we want that translation in kanban view of 'lunch.product.report'.
So we set related field in 'lunch.product.report' and remove those fields
from init().
Due to related field it will affect on performace of lunch.product.report
kanban view loading.
Task-2068989
closesodoo/odoo#41206
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
The default image for the lunch product should be the one from the
category (added an image on the categories).
In case there is no image either on the product either on the category,
in the kanban view there should be a specific image (fork and knife
image)
Added some data in order to always have something displayed in the
kanban view
Fixed the layout of the dashboard
Bug fix, in `_check_wallet` there was a flush missing
Bug fix, `product_id` should be a many2one, not an integer field and the
orm should be used in order to avoid problems when favoriting products
This is a back2basics task
Task 2048246
closesodoo/odoo#35632
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
The following models are already using big images, or they might need big images
in the future:
- partner
- hr employee
- shop category
- lunch product
- gamification badge and karma rank
PR: #34925
image_original => image_1920 (now resized to 1920)
image_big => image_1024
image_large => image_256
image_medium => image_128
image_small => image_64
image replaced by image_1920 (when writing) or by image_1024 (when displaying
what was previously the big size)
+ add new intermediate format:
image_512
PR: #34925
The default value for a many2one on res.currency should be a
res.currency object not a res.company one
closesodoo/odoo#35004
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
- Add a related on the lunch.supplier to the company id of the linked res.partner
- Add related on the product: to the company id of the linked lunch.supplier
- add multi company Record rules
closesodoo/odoo#34859
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
Multi is the default api for methods, it is not necessary to explicitly
decorate methods with it, adds clutter and most people use it because
they see that the rest of the code uses it.
Done with `find . -type f -name '*.py' | xargs sed -i '/@api.multi/d'`
- Reorganize configure your order screen
- Alert users through chat: Alerts can now be configured to
send a chat message to the employees.
- Replace toppings by extras
closesodoo/odoo#34470
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
Since previous commit moved decimal_precision module's feature into base,
use the new syntax for fields declaration
Remove the imports to the removed module
Remove the module from dependency in manifest
sed -i "s|digits=dp.get_precision('\([A-Z a-z]*\)')|digits='\1'|" **.py
sed -i "/from odoo.tools import decimal_precision as dp/d" **py
The goal is to be coherent with the user property.
Actually, company_id and company_ids on the environment are no fields.
Calling env.company_id returns a browse record, not an id.
lunch.cashmove.report only take into account orders that are ordered or
confirmed.
That means that in action_order we have to set the state to ordered
before checking the wallet content.
This will then raise the error and rollback the value
closesodoo/odoo#33583
Signed-off-by: Toufik Benjaa (tbe) <tbe@odoo.com>
- Since the performance commit @c42ccf2ca7f0a600a0dd7e3b4dd8bacd7a5c6513
the lunch products are displayed only if you have already ordered it.
- Added indexes on `lunch.order` to speed up the SQL request.
closesodoo/odoo#33336
Signed-off-by: Toufik Benjaa (tbe) <tbe@odoo.com>
The lunch application works fine, but some usability points need to be
improved in order to have a smoother onboarding.
These include:
Making lunch location tree view editable, instead of having to use the form view
Auto filling partner details from vendor form
Fixing typos in various labels
Add a name field on lunch.alert instead of using the message as _rec_name
Adding a stat button on lunch category to see the associated products
Task 1942776
closesodoo/odoo#33091
Signed-off-by: Romain Libert (rli) <rli@odoo.com>
Purpose
=======
Allow the user to select the allowed companies for which he wants to see records
on top of selecting his current company.
It is confusing for users to see the records from the company he is connected to
and the records of the children companies.
Instead of using the hierarchy of companies to access records across companies,
the user can now select (from his set of allowed companies) the companies for
which he wants to access records.
/!\ This means that the user will interact with records from company A when in
company B.
Example: a SO has been created and confirmed in A. When in B, I create the
invoice from it.
Specifications
==============
1/ Deprecate the parent/children hierarchy on the res.company model. The fields are
kept on the res.company model to ensure the retro-compatibility, but won't be used
accross the standard code anymore. The only functional usage for this mechanism
was to allow to see records from several companies by creating a virtual parent
company, which will be possible with the new mechanism.
2/ By default, a user will only see the records of the company he is connected
to (or records without a company). (It is still editable by the user if needed).
For that, put this information in the user context, to allow having different
configurations on different browser tabs. Instead of having domains like
['|',
('company_id', '=', False),
('company_id', 'child_of', user.company_id.id)]
you'll have something like
['|',
('company_id', '=', False),
('company_id', 'in', company_ids)]
Note that the 'company_ids' is a value that is passed in the evaluation
context on the record rule, as we already have user, or time.
company_ids is a list of the ids of all the enabled companies in the
user's context.
3/ Out of the generic improvements brought by this task, this will illustrate
issues that could exist since several versions. For example, it should not be
possible to create a scrap order for the company A with a package of the company
B, or it should not be possible to create an invoice on the company A with
payment terms from the company B. Before the version 12.0, it was easy to
encounter this kind of issues as the admin was the SUPERUSER_ID. A positive side
effect of the fact that the SUPERUSER_ID has become an inactive user was to
make it more difficult to introduce mismatch on the records, but haven't solved
the issue, as it was still possible to do it with parent companies
configuration. Some of these issues have been fixed in this commit, but all the
business flows should be re-tested to check if an ir.rule should be introduced
(eg: a multi company rule for stock.quand.package), if the company of a record
is correctly transfered to another record created from the first record (eg:
From a SO, create an invoice and a payment, the company of the sales order
should be transfered on the invoice and the payment, even if the company of the
sales order is A and I'm logged into the company B with the company A enabled.
4/ Currently, if I click on a button on a notification email (example 'View
Task'), I face a traceback if I'm not logged into the company of the record.
Now, if you click on a button and if you have access to the record, the correct
company will be automatically set.
5/ If I display a kanban view with several records from several companies (and
an image), all the images should be displayed.
6/ Currently if you copy paste an url, this will crash if you're not in the
correct company. This won't be fixed because it's quite impossible to do it in
a clean way. This task brings a workaround. Copy/Paste -> Traceback -> Log into
the correct company, re-copy/paste -> Ok.
7/ 2 property methods have been added on the environment to retrieve the company
on which the user is logged in and the companies the user enabled, on a specific
tab.
That way, when creating a record, instead of doing
default=lambda self: self.env.user.company_id
do
default=lambda self: self.env.company_id
On the other hand, to retrieve the enabled companies, do
companies = self.env.company_ids
8/ Modify the Company Switcher widget to allow to log into another company
WITHOUT writing on the res.users (and thus bringing cache invalidation issues
and so on). Also allow to enable several companies and see records from several
companies, and independantly of the other browser's tabs.
9/ When focusing on a tab, save the current company configuration on the local
storage. That way, when doing 'CTRL+T' or a middle click, the context is
propagated to the new tab.
10/ Improve the error message in case of multi company access errors. Now, when
the user is in debug mode, display the related names of the records and the name
of the user who brings the issue.
11/ Remove the context erasing when writing on a res.users
This is probably coming from the migration to new API of the base module.
The context was not propagated at this moment, which was a common mistake at
that time. When migrating the module, probably by using the 'black box' method,
as the context was not propagated, it was erased on the new version. This is
now an issue because the context (i.e. the enabled companies) was erased when
writing on a res.users, leading to tracebacks.
See: https://github.com/odoo/odoo/commit/7eab8e26d3d46c53f4be924d6a34e80a66e74960#diff-4c2e738ee8f64f11806c889ea097b5e7R624
12/ Fix the crash manager on redirect warnings. The issue is the following
- Create an invoice on a company without a configured CoA.
- Set a partner
- On the onchange_partner_id, a redirect warning is raised to propose you
to configure a CoA
- Click on 'Go to the configuration panel'
- A generic warning says something like 'Do you want to discard your changes?'
- Click on yes, the page refreshes, but not on the redirect action.
Now, set correctly the action on the hash, and reload instead. The breadcrumb is
lost for example, but you reach the correct action at least.
13/ Introduce a res.group to enable/disable the multi company per tab
feature.
14/ To help the users to know which tab is in which company, add the
possibility to have a favicon per company. When creating a company,
the classical 'O' icon is colored by default in a random color.
15/ Remove the company switcher on the frontend. This was mainly there
to allow a user to swicth to the company linked to the website.
This behavior is now transparent to the user. If the website A is
activated, then the company set on the context is the company of the
website.
16/ Deprecated the _company_default_get method on the res.company
model. Remove the method _get_company on the res.users model.
17/ Add 'allowed_company_ids' and 'current_company_id' on the pyeval
context. You can now use those variables on domains in the views to
access directly to the activated company.ies on the current tab.
TaskID: 1960971
closesodoo/odoo#32341
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
Purpose of this commit is to prepare addition of gamification in slides /
eLearning platform. In order to be able to use karma and the badges in other
modules we move those models in gamification.
Partial commit linked to eLearning project. Main specifications related
to gamification and user profile can be found on task 1922159 (PR #30514).
Main specifications related to eLearning can be found on task 1902304
(PR #29876).
We would like to automatize lunch as currently all orders are manually ordered and validated,
and a cash move has to be manually created each time you want to credit the wallet of some user.
1/ In this commit we add a new widget that comes with the kanban view
and will allow to take orders in a friendly manner.
2/ We also add a lunch.supplier model this also allows you to configure an
automatic ordering via email.
3/ Introduces new lunch.location model to replace res.partner on suppliers
4/ New mail template for automatic ordering
5/ Add the concept of new products (mark a product as new until some date)
6/ The toppings are now defined by product category
7/ Lunch.order removed, lunch.order.line renamed into lunch.order
8/ New SQL report to get the wallet content (aggregate of lunch.cashmove and lunch.order)
9/ New setting to allow negative wallet (aka overdraft)
10/ Application now remembers what notes and toppings you last ordered with your product
11/ You can change your location using the widget on the kanban view
12/ Edition of the order can be done until the order is arrived
TaskID: 1856876
TaskID: 1916105
closesodoo/odoo#30028