test_website: Add multi-company test
=============================
Purpose
------------
This commit tests some behaviors with multi company
mode after changes brought by f847a46.
Specification
-------------------
The website company should be automatically set in the
context as 'allowed_company_ids'.
That way, we can remove the switch company menu on the
website, which doesn't make a lot of sense.
This test enforce this behavior.
web: Add QUnit tests for the SwitchCompanyMenu
=========================================
Purpose
------------
This commit tests some behaviors with multi company
mode after changes brought by f847a46.
Specification
------------------
Ensure the robustness of the switch company menu for
multiple cases like:
- Bar rendering
- Switch to another company in mono/multi environment
- Toggle another company in mono/multi environment
- Remove a company in mono/multi environment
The widget itself has been slighty modified to make
it more testable:
- Reading from session is now in the `willStart` function
instead of `init` to allow mocking the session (in tests,
`init` is executed before the mock is applied).
- In the event handlers, don't use `bbq` to retrieve
current allowed company ids. `bbq` is not easily nor
cleanly patched.
- When reading allowed company ids from session, cast
ids from string to integer. They are everywhere casted
except there.
and some linting
hr: Add multi company tests
======================
Purpose
-------------
This commit tests some behaviors with multi company
mode after changes brought by f847a46.
Specification
------------------
Check that a report printing for several records on
different companies:
- Works if the context is correctly set, i.e. both
companies are in the allowed_company_ids
- Doesn't work if the context is not correctly set
Purpose
=======
This commit tests some behaviors with multi company
mode after changes brought by f847a46.
Specification
=============
Check that a report printing for several records on
different companies:
- Works if the context is correctly set, i.e. both
companies are in the allowed_company_ids
- Doesn't work if the context is not correctly set
Purpose
=======
This commit tests some behaviors with multi company
mode after changes brought by f847a46.
Specification
=============
Ensure the robustness of the switch company menu for
multiple cases like:
- Bar rendering
- Switch to another company in mono/multi environment
- Toggle another company in mono/multi environment
- Remove a company in mono/multi environment
The widget itself has been slighty modified to make
it more testable:
- Reading from session is now in the `willStart` function
instead of `init` to allow mocking the session (in tests,
`init` is executed before the mock is applied).
- In the event handlers, don't use `bbq` to retrieve
current allowed company ids. `bbq` is not easily nor
cleanly patched.
- When reading allowed company ids from session, cast
ids from string to integer. They are everywhere casted
except there.
and some linting
Purpose
=======
This commit tests some behaviors with multi company
mode after changes brought by f847a46.
Specification
=============
The website company should be automatically set in the
context as 'allowed_company_ids'.
That way, we can remove the switch company menu on the
website, which doesn't make a lot of sense.
This test enforce this behavior.
Before this commit, when an user would visit a subcategory in the ecommerce, he
would see a slugified URL, containing all the category hierarchy, which is good
for SEO purpose.
For example, if `Wheel` is a child of `Car` which is a child of `Vehicule`,
then the URL would be `/shop/category/vehicule-car-wheel-3`.
But on the sitemap, the parents would not be prefixed to the URL, thus the
sitemap would simply show `<loc>/shop/category/wheel-3</loc>`.
This commit ensure the category parents are added to the final URL of the
sitemap, as in the ecommerce.
task-1889972
closesodoo/odoo#34073
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
Add a boolean field in res config settings to install hr_expense_payroll.
Add demo data to allow expense validation easily without having to create
a journal
closesodoo/odoo#32988
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
Add `categ_id` field (related of `product_id`) in `stock.inventory.line`
model to able user to filter and group by product category.
Task #2026952closesodoo/odoo#34349
Signed-off-by: Simon Lejeune (sle) <sle@openerp.com>
Add an Inventory Adjustment field `prefill_counted_quantity`.
True by default, when it's disabled, the inventory will generate when
inventory lines with 0 as value for `product_qty` field when started.
The purpose is to make simpler the use of barcode scanner to do the
inventory adjustment.
Task #2026952
When we open any x2m record (in a FormViewDialog), there is a "Remove"
button to delete/unlink the opened record from parent.
This button is placed besides "Discard" button and it creates little
confusion in some cases. For example, in list view, there's already a
bin / 'x' icon depending on the field type using which people are used
to delete/unlink the record. And when they open a record, they might
accidentally click "Remove" button instead of "Discard".
To avoid this, now we won't show "Remove" button when we open record from
x2many list view. However, we have to keep this button in case x2many of
kanban as there's no other way to remove the record.
task-1886913
closesodoo/odoo#34333
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Purpose
=======
As the employee picture on a form view is often too small,
it should be possible to zoom on it like for products in eCommerce.
Specification
=============
Added new bool options on FieldBinaryImage: `zoom` and `background`.
`zoom` will call zoomOdoo.js and display a popup with the zoomed out
image.
`background` is used to either display the image as a div element with
a background-url (to be used e.g. in a kanban view) or as a standard
img element.
closesodoo/odoo#33839
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
There is no such state as "confirmed" in 'mrp.workorder'. Hence changed
it to be 'done' instead as we don't want to scrap a done WO.
Task-2003916
closesodoo/odoo#33789
Signed-off-by: Simon Lejeune (sle) <sle@openerp.com>
Two different problems on the box and resulted in the crash of the Odoo
instance running on the IoT Box:
When `usblp` had troubles communicating with a printer, a NoDeviceError
was raised. The `printer` variable was still set from the last time the
loop was processed, so we tried to close it, resulting in an error.
The code handling generic execptions was broken.
closesodoo/odoo#34300
Signed-off-by: Quentin Lejeune (qle) <qle@odoo.com>
Now that the multi company mode is much more easier to
activate, it is needed to display this information on the
tree views, to help people to know on which company is
set some records in list view.
task-1997637
Closes: #3397closesodoo/odoo#33976
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
ESNext is now supported in master so the max version number has been raised.
Note that es-check is still used but not for the original purpose ; it is
still useful for JS syntax checking.
closesodoo/odoo#34362
Signed-off-by: Christophe Monniez (moc) <moc@odoo.com>
Purpose
======
When an empoyee wants to check out, he does not know the number of hours he worked today.
Specification
==========
In the check out view, display how many hours the employee was checked in today.
closesodoo/odoo#33974
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
This commit adds the automatic selection of the salesteam
for sale.order and account.invoice objects so that changing
the salesperson will automatically changes the team if the new
salesperson has one. If they are not part of a team, the current
value is left unchanged.
This will avoid having the manually correct the salesteam
every time the salesperson is modified.
task-1984950 closes-#33618
closesodoo/odoo#33618
Signed-off-by: Damien Bouvy (dbo) <dbo@odoo.com>
* website, mass_mailing, web_editor
This commit adds various improvements in newsletter snippets as follow:
- Improves UI for newsletter popup.
- We only had one popup for all websites. Now, we can have a different
popup for each website.
- The popup was not appearing on mobile/tablet devices. Now, in
mobile/tablet devices, the popup appears automatically after 5secs.
- Added the ability to customize the whole editor popup like any
editable area (background colors, etc).
- User needed to enable popup snippet from the settings. We removed that
setting so now popup snippet will always be available.
- Added new snippet "Newsletter block".
- Display notification after successful subscription the same way for
all newsletter snippets.
Closes https://github.com/odoo/odoo/pull/29353
task-1903256
closesodoo/odoo#29353
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Co-authored-by: qsm-odoo <qsm@odoo.com>
Now we can display dialogs with or without header / footer / backdrop
and we can force the DOM to be put elsewhere than the body.
Part of https://github.com/odoo/odoo/pull/29353
task-1903256
Before this commit `_get_tracked_fields` was not called in batch because it took
the `updated_fields` parameter, but this parameter is not used.
By removing the parameter and calling the method in batch, creating 1000
products takes 20% less time.
Part of task-1918881
closesodoo/odoo#34347
Signed-off-by: Xavier Dollé (xdo) <xdo@odoo.com>
currently if no data given to hr_org_chart it throws traceback
because hr_org_chart template always expect that there will be
managers and children key in qweb rendering context, always pass
managers and children in qweb context if _getOrgData method returns
nothing still hr_org_chart should be rendered and should not throw
traceback
task-2000269
closesodoo/odoo#34152
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
While creating employee and selecting a company other than the current company,
saving record shows a traceback.
Currently xml template expects managers and children key returned from
/get_org_chart controller but /get_org_chart was returning blank dict, and which
is used as qweb context to render template.
Return {'managers': [], 'children': []} if _check_employee returns False
task-2000269
Purpose
=======
When an Expense report hits the "Approved" stage, the Accountant can no
longer edit the account / tax / analytic account fields. However, this
information can still be modified from the Expense itself, impacting
directly the related Expense report anyway. In any case, it makes sense
for an accountant to be able to edit this type of information, as it is
likely that an employee or a manager will input the wrong accounts.
On the other hand, once the Journal entries are posted, the Expense
report should not be editable anymore.
Specifications
==============
For the Expense report (hr.expense.sheet model):
If the report is in the "Approved" stage AND the user has at
least the Accounting / Accountant access right level
The following fields should be editable
- Taxes (tax_ids)
- Bill reference (reference)
- Account (account_id)
- Analytic account (analytic_account_id)
If the user has a lower access right level => the fields listed above remain
in read only.
If it is in the "Posted" stage (regardless of the access right level of the user):
The following fields should be in read only:
- Taxes (tax_ids)
- Account (account_id)
- Analytic account (analytic_account_id)
The "Bill reference" (reference) field should still be editable (current behavior).
Based on the Expense report's stage and the access right level of the user,
the fields of the related Expenses should also be editable (or not).
closesodoo/odoo#32918
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
Purpose
=======
In Belgium, we need to support some partial time on 2 weeks.
For instance, a mid time, means you could work on monday, tuesday
and wednesday on week1 and monday and tuesday on week 2. Others payroll
softwares manage this.
Specification
=============
Add a checkbox on resource calendar to manage 2 weeks. --> Consider even/odd weeks.
Add sections on calendars (Like sales orders)
Modify methods in resources to apply this behavor generically.
Check that attendances aren't overlapped
Write an integration test for holidays - benefits - payslip
to check all this, + "credit temps" and wage modification.
Note
====
For the sake of simplicity, we only manage calendars over 2 weeks
to consider the odd/even weeks and keep an easy implementation.
For more complicated calendars (eg: over a months with specific targetted days),
it's better to create specific allocation requests and apply specific leaves
for those days, as it would be the case for parental leaves.
closesodoo/odoo#31674
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
In a bunch of places, a default warehouse is selected to make an operation:
- default warehouse on a sale order
- default location of an unbuild order
- default location of an inventory adjustment
Before this commit, the warehouse that was created first was always selected.
Now, we introduce a sequence field and a widget handle so that the user can
chose the default one as he wishes.
Task- 2001671
closesodoo/odoo#34085
Signed-off-by: Simon Lejeune (sle) <sle@openerp.com>
Adds a button in stock move form view to generate multiple serial number
and assigns them to stock move lines.
Through a wizard, the user enter the first SN. Then, starting with this
number, iterates to assign and increment the SN on each move line who
doesn't have already one.
Task #1832645closesodoo/odoo#33466
Signed-off-by: Arnold Moyaux <amoyaux@users.noreply.github.com>
The number of hours in time off were computed based on a mean of
number of hours in a week. It can engendre problem if an employee
doesn't work with the same number of hours every day.
Now the number of hours are computed based on employee's calendar
and so the real number of hours are used.
closesodoo/odoo#33137
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
In demo data, Marc demo was taking a sick leave during the first and
second of the month, the problem is that when the current month starts
with a saturday this leave ends up being placed only during the
week-end hence no leave should have been taken.
In order to avoid having this weird leave, Marc demo will now take three
days of sick leave
closesodoo/odoo#34318
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
Before this rev., the layout was broken when a search_panel
was used alongside the onboarding banner in a kanban view. Note
that this usecase doesn't exist in standard.
Closes#31986closesodoo/odoo#34303
Signed-off-by: VincentSchippefilt <VincentSchippefilt@users.noreply.github.com>
Purpose of the commit is when multi-company is active and company A is a parent of company B.
When a user creates an account move with a Journal of company A and adds account move lines they are created with company A. But now user changes
the journal and select journal of different company and save the record system allows having the different company in account move and account move line.
After this commit when account move and account move line have different company and user tries to save, it will show a warning.
task-1970459
closesodoo/odoo#34244
Signed-off-by: Quentin De Paoli (qdp) <qdp@openerp.com>
In vendor bill refunds they are not showing fields 'amount_untaxed' and
'amount_tax' with signed computation on views so there is inconsistency
in credit notes and vendor bill refunds.
After this commit in vendor bill refunds, fields are shown with signed
computation on views.
task-2008613
closesodoo/odoo#34086
Signed-off-by: Quentin De Paoli (qdp) <qdp@openerp.com>
Purpose of this commit is to prevent creating and
importing new variants from the variant list view
when you open it with the variant state button
becuase record not save while creating a new
variants on the fly from a product template.
task-1916037
closesodoo/odoo#33619
Signed-off-by: Damien Bouvy (dbo) <dbo@odoo.com>
previously sale_timesheet created orphans task. This commit links them to a project and adds stages to that project and it's tasks.
related task #1985386closesodoo/odoo#33208
Signed-off-by: Jérome Maes (jem) <jem@openerp.com>
When a category value is selected, we search for records matching this
category OR one of its children categories
task-1974632
closes: #33701
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Co-authored-by: Aaron Bohy <aab@odoo.com>
In employee searchpanel (left) view, In 'tag' selection, their could be a lot
of records so it seems useless. That's why it has been removed by this commit.
task-1974632
closes: #33701
* add a json_scriptsafe module, which re-exports the stdlib's json but
provides a script-safe `dumps` function, because of the way it works
the script-safe version is fine / safe to use outside script
contexts, so there's no need to provide different functions to qweb
contexts
* make the json.dumps in qweb contexts <script>-safe (should be
rendered using t-raw)
* update callsites to properly dump json:
- dump in template, not in the python code
- dump the entire structure at once, not bits and bobs inside a JSON
literal
Task 1999158
closesodoo/odoo#33682
Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
As odoo makes little difference, one would expect `(field, !=, 'foo')`
or `(field, 'not ilike', 'foo')` to have the same behaviour when field is
empty, and provide the opposite result as the "positive" operators.
However because NULL <OP> <value> returns NULL which is generally
assimilated to false, the sections above would fail to match records
whose field is null (they would match records whose field is *empty*
though).
Fix this by wrapping the operation in a coalesce falling back
to (hopefully) the correct value if the result is null.
See also: odoo/odoo#22879closesodoo/odoo#33959
Signed-off-by: Olivier Dony (odo) <odo@openerp.com>
The note and mp_skip field of pos.order.line only exist in the frontend
application, this causes errors in some task of the PoS and IoT teams.
This pr adds the fields to the database, resolving these problems.
closesodoo/odoo#34210
Signed-off-by: Quentin Lejeune (qle) <qle@odoo.com>
This commit makes the use of the kanban more intuitive by changing the view's
example background columns labels.
kanbanExamplesRegistry will have object as a value instead of array,
ghostColumns and examples will be the key where ghostColumns defines column
titles for example background on column quick create and examples will be array
of examples which will be displayed on click of See Examples link in quick
create column
If ghoseColumns are not defined then dynamically ghost columns will be generated
with titles like Column 1, Column2...
task- 1937198
closesodoo/odoo#30911
Signed-off-by: Jérome Maes (jem) <jem@openerp.com>
Co-authored-by: Mohammed Shekha <msh@odoo.com>
While confirming the quotation if there is no seller
who's matching the requirements at that time error
message was not clean.
So that, changed that message to a more meaningful
new message.
TaskID - 1948751
closesodoo/odoo#32644
Signed-off-by: Arnold Moyaux <amoyaux@users.noreply.github.com>
The test case of alipay payment is going to failed due to:
1) Now the redirect_url from the return_url is removed in commit :
https://github.com/odoo/odoo/commit/0aefe72b773a21bdd38fdc86779d3030bd5127c6
but it's still it's there in test cases so removed from test case.
2) To make the transaction done it must be in draft, pending or authorised
state but in first test case payment process the transaction state is set to
cancel and in another payment process use the same transaction again to set
it success so before use the same transaction again just set the state to draft.
task- 2005926
closes- #34132
Signed-off-by: Damien Bouvy (dbo) <dbo@odoo.com>
Impacted modules: hr_timesheet and sale_timesheet
This merge provides the customer portal part to display timesheets. Timesheets
can be seen from 3 differents points of view: list of timesheets, timesheets on
tasks, and timesheet linked to invoices (only for delivered qty policy).
When tracking time (sale_timesheet not installed), all timesheets can be displayed
to portal. When sale_timesheet is installed, if the timesheet is billed (billable_type
field), we only display the ones coming from a delivered qty policy selling. Indeed,
it makes no sense to display the 'ordered qty' timesheets, as it can reveal you sold
more time than required to your customer.
To do, we decided to remove access rules for portal user: timesheet (analytic line
model) is now technical and is given with `sudo` to portal. Admin can still restore
some of them to allow third part application with XML RPC.
See subcommits for more details
Task-1932488
closesodoo/odoo#31703
Signed-off-by: Jérome Maes (jem) <jem@openerp.com>
The old tree views don't really exist anymore, this odd pseudo-flag to
dispatch between "list" and "tree" tree views has no reason to remain.
Task 1937686
closesodoo/odoo#31243
Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>