- Install 3 payment providers:
P1: no countries set
P2: country set to USA
P3: country set to Canada
- Activate online payment of invoices
- Create an invoice for portal user A (country of user is USA)
- Login with A
- Pay the invoice
All 3 providers are available, while only 1 & 2 should be available.
The providers are filtered in the sale module, but not in the account
module:
https://github.com/odoo/odoo/blob/586ee04a6296c13868011b3afaca61be5c6ff3c6/addons/sale/controllers/portal.py#L190-L193
The same issue occurs with the direct link `/website_payment/pay`.
We apply the same filtering in all modules.
opw-2279710
closesodoo/odoo#53483
X-original-commit: aaac93b551e2a5f331dd14ee5aefbe4ced173691
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
This error occurs for instance when your session expires and you
reload. At this point, the hash part of the url is duplicated and
an error is raised when the webclient tries to parse 'cids' part.
The hash part of the url should not be duplicated, but whatever the
url hash, the client should not crash either.
This commit prevents the hash part from being duplicated, and the
client from crashing when there are several occurrences of 'cids'.
closesodoo/odoo#52599
Task: 2267401
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Before this commit if you have a quant that has a location linked of the type 'view' you'd get this warning
but you would not know about which location this was and figuring that out is not trivial for most people.
After this commit users get notified about which location is of the type 'view' and can directly correct it if they want to.
closesodoo/odoo#51137
Signed-off-by: Simon Lejeune (sle) <sle@openerp.com>
Here before this commit, if delivery is late for any sale order,
a warning alert is expected, but was missing on it.
commitment_date_div which contains field json_popover was replaced
by new div without json_popover, was leading the issue.
Fixes#2246833
closesodoo/odoo#50813
Signed-off-by: Simon Lejeune (sle) <sle@openerp.com>
The 'stage_id' field is now a stored-editable computed field.
The 'company_id' has been converted to a stored-editable computed field.
The modification of the 'partner_id' field in the onchange method has been
moved and merged into the _compute_partner_id method.
Remove the empty 'onchange' method from the project.task model and also remove
this method call from the sale_timesheet module, which inherits from the project.task model.
Adapt the _compute_partner_id to retrieve exactly the behaviour before the onchange
method deletion.
Update code and tests of the task/subtask partner_id management after discussion with Alexandra to clarify the behavior.
Add the 'multi_edit' attribute to tree views.
The 'timesheet_generate' and 'timesheet_task_id' fields have been set as
stored-editable computed fields.
The condition to compute the timesheet_generat field has changed to be
coherent with the _check_timesheet_generate constraint.
Keep the timesheet_generate field without its default value (True) to avoid
raising a ValidationError through the _check_timesheet_generate constraint
before the timesheet_generate field has been computed.
The fields 'project_id' and 'user_id' have been converted to
stored-editable computed fields.
Convert the 'allow_timesheets' field.
Improvement of the _compute_task_id method to check the task_id field before using it.
Update hr_timesheet tests by removing calls to onchange methods because
now, compute methods are always called.
Get back the onchange on the 'project_id' to compute the task_id field due to a complex
bug found in sale_timesheet tests.
Before that, just one pixel from the bottom of the QR-bill frame passed got out of the page, and end out creating a second, empty page.
Since this error was probably due to some rounding issue in the way A4 dimensions were compared to the layout specified by the scss file, we solve it by rounding the height of this section a little more, removing 0.25mm from it.
[FIX] l10n_ch: qr bill report: display the payment ref under "reference" and the invoice's name as additional information
closesodoo/odoo#53453
X-original-commit: 8a6cc1a572cd04f540e4a5e83362319c13274aea
Signed-off-by: Laurent Smet <smetl@users.noreply.github.com>
Signed-off-by: oco-odoo <oco-odoo@users.noreply.github.com>
Steps to reproduce the bug:
- Let's consider a new instance with default installed language 'en_US'
- Install CRM
- Activate a second language (e.g. en_GB)
- Set that language in all users
- Inactivate default language 'en_US'
- Reset the language of your current user (no value)
- Go to contact and try to create a new one
Bug:
A traceback was raised because the lang en_US did not exist.
PS: Forcing the user to set a language ensures that this fallback
will never occur anymore.
opw:2267711
closesodoo/odoo#53375
Signed-off-by: Simon Goffin (sig) <sig@openerp.com>
Before this commit, the calendar view showcases tasks by deadline. Because it is a simple date field, the day/week modes don't have much value and are even confusing to the users, who expect to be able to define timeframes.
In addition, the quickcreate doesn't allow to select a project. This is problematic because it leads to "ghost" tasks.
closesodoo/odoo#52478
Taskid: 2264594
Related: odoo/enterprise#10976
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
Displaying full name with code helps to Identify Products with `default_code` in the warning message. (Especially when variants are activated)
closesodoo/odoo#51720
Signed-off-by: Simon Lejeune (sle) <sle@openerp.com>
In some cases the value of `httprequest.remote_addr` is empty. In that
very case, it is useless to create a reveal_request in that specific
case since it will never be validated.
closesodoo/odoo#53466
X-original-commit: 2acdd795d7db28026968f5312574d7bb68267538
Signed-off-by: Rémi Rahir (rar) <rar@odoo.com>
1) removal_date in inventory report should be readonly if
product tracking is none or use_expiration_date of product
is false.
2) removal_date should be editable in inventory mode.
Fixes-2273732
closesodoo/odoo#52827
Signed-off-by: Simon Lejeune (sle) <sle@openerp.com>
Task 2206499
We have to call the onchanges manually in order to compute the taxes
We don't want pdf's because they are not consistent with the data.
* Generated pdf would depend on the company details, set during the
demo steps
* Generating a pdf would need to be done through a cron because
wkhtmltopdf needs the web server to be running at install time, which
is not the case. This has been judged too complicated and not worth.
* Hard coded pdf would also depend on the l10n, the date.
closesodoo/odoo#53279
X-original-commit: c41cedef8f0a75ad795a7bd22f96f990e3f0d483
Signed-off-by: Quentin De Paoli (qdp) <qdp@openerp.com>
The xpath was wrongly replacing the 'owner_user_id' field before the
kanban templates definition (which isn't displayed in the view).
closesodoo/odoo#53459
X-original-commit: b63043e36702046000aedf3f1f934122d51ef441
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
Purpose of the task is, we have added the activities on various
listviews, the goal of this task is to update SO/PO/invoice demo data
with activities and also set tags on sales orders.
So in this commit, We added the activity on several SO/PO/Invoices and
also added the some tags one sales order and set the user as False
where the user is set as 'Odoobot'.
closes odoo/odoo#51799
Taskid: 2254708
Closes: #51799
Related: odoo/enterprise#10743
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
We want to create a XMLID for every first exhibition of a field in a
model. That is, we just want one XMLID by field by model and not one
XMLID by field by class. Previous implementation was determining the
"first field exhibition" by making sure the field was created and used
as part of the same module.
This assumption is invalid when we consider mixins. A mixin is an
abstract model that define fields and methods to be included in other
models. As it is abstract, it does not exhibits the field by itself. The
field will only be exhibited when included in a concrete model via
inheritance. When it is included in another module, the XMLID creation
is discarded.
Take a module M1 that defines a model A, take another module M2 that
defines a mixin X with a field X1. In a third module M3, extend A to
inherit from X. While M3.A is the first model module to exhibit the
field X1, the XMLID creation was discarded because `"M2" != "M3"`.
See https://github.com/odoo/odoo/issues/49354#issuecomment-614093767
Task: 2235368
Closes#49354closesodoo/odoo#53435
Signed-off-by: Raphael Collet (rco) <rco@openerp.com>
Before this commit the message "Applicant created" was displayed twice in the chatter.
Task-2278142
closesodoo/odoo#53252
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
When a view is:
- a specific view (duplicated for a specific website)
- inherited by a new view that is translated
the inheriting view will also be duplicated, but the translation will
only be created for the generic version and not the specific ones.
With this changeset, we duplicate translation of arch_db terms of the
generic view onto matching specific views.
Without the change, added test fails with:
AssertionError: '<div>hello</div>' != '<div>hi</div>'
loading module translation copy translation from base to specific view
fixes#51579
opw-2261278
closes#52451closesodoo/odoo#53012
X-original-commit: 989d58d26f8803b40c1411cb97b0171b05d274d7
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
currently, the expense banner is displayed on to many menus like:
'expense report > to Pay, to Post'.
so in this commit,the banner should only be visible in the
'My Expenses' and 'My Expense Reports' menus.
and also removed some unused action from hr_expense.
closes odoo/odoo#52241
Taskid: 2267850
Closes: #52241
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
Before this commit the font-size for the days/hours left was too big. There is
also a useless scroll bar for the calendar. Adjusting the CSS to remove the scroll bar.
Task-2254820
closesodoo/odoo#52178
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
Purpose of this task is,lots of business flows can be crashed if
the field Private Address(address_home_id) is a private address instead
of a regular contact.
so in this commit,we change the demo data for employee and set the
private type address on employee for private address and also fix
the flows on which errors could occur.
Currently billing administrator does not have right for private address
and while creating payment from expense it was going to set the
customer from the employee's private address on payment so give the
private address right to the billing adminnistrator.
Also chaned admin/demo user's private address as 'private' instead of
regular contact.
and on hr_expense use the Sudo while accessing the home address this
method is used from payslip too.
TaskID:2170016
closes odoo/odoo#46628
Closes: #46628
Related: odoo/enterprise#8924
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
When clicking on an image in edit mode, the web editor attempts to find
an attachment that corresponds to the image's URL. In the case of the
website logo, the URL looks like it's referencing an attachment by id or
xml-id, but it's actually neither. This cause a variable to never be
initialized, which in turns causes a traceback when trying to access it
later.
This commit fixes that by always initializing attachment to None.
closesodoo/odoo#53418
X-original-commit: 790e33de190392b937e21c73905db4d48cfb86aa
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
This PR allows to display sample (fake) data in empty views, in
the hope of easing user onboarding. This can be enabled (in
list and kanban views) with attribute sample="1" on the arch
root element. In this case, if there is no data to display, sample
data will be generated based on heuristics (depending on field
types and names). This can be used in addition to the no
content helper.
This PR also activates it in a bunch of list and kanban views.
Task 2232801
closesodoo/odoo#53417
Forward-port-of: odoo/odoo#52867
Related: odoo/enterprise#11330
Signed-off-by: Christophe Monniez (moc) <moc@odoo.com>
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Co-authored-by: Aaron Bohy <aab@odoo.com>
Co-authored-by: Mathieu Duckerts-Antoine <dam@odoo.com>
Co-authored-by: Jérémy Hennecart <jeh@odoo.com>
Co-authored-by: Julien Mougenot <jum@odoo.com>
This commit sets attribute sample="1" in a bunch of list and
kanban views, to enable the new sample data feature when views are
empty.
Task 2232801
X-original-commit: 5471309b35619f307242c2704c7681ba63d2be42
Some changes in AbstractModel have been done to ease the
implementation of the sample data feature. This commit reverberates
those changes in other addons.
Part of task 2232801
X-original-commit: dd8069a3c80570e7fa03a80dbb100ab0a182692a
For the sample data feature to work, rpcs done by the view need to
be mocked. This commit properly mocks the 'retrieve_dashboard'
function. It also remove custom no content helper style that was
conflicting with the new style in web.
Task 2232801
X-original-commit: 300bc6d9ac2c1bea823bfc80675ffcf8e5dd3e9f
Previous commit introduces the sample data feature in list and
kanban views. When sample data is displayed, most parts of the
renderers can't be clicked on, to prevent the user from interacting
with sample records (e.g. to open a sample record in form view from
the list). This commit disables keyboard navigation as well, as
those sample records could still be accessed with the keyboard.
To do so, several refactorings have been done in views:
- _giveFocus function added on controllers (so that we can hook
on the moment where we want to focus the renderer, and prevent
it in sample mode), it kind of replaces giveFocus of ActionMixin
which wasn't use from the outside
- updateRendererState -> _updateRendererState as it is private
- _setState function added on controllers, to have a hook when we
set a new state (already existed, but only in kanban)
- _renderView function moved from Basic to AbstractRenderer, so
that we have a proper hook to deactivate clickable elements in
sample mode
Task 2232801
X-original-commit: 4482a03fe2f083f4f44fc6eb76d90ae22afbff91
With this commit, it is now possible to display sample (fake)
data in empty views, in the hope of easing user onboarding.
This can be enabled (in list and kanban views) with attribute
sample="1" on the arch root element. In this case, if there is
no data to display, sample data will be generated based on
heuristics (depending on field types and names). This can be
used in addition to the no content helper.
Task 2232801
X-original-commit: 7c8e627ff5029cb539d702705e5ce53d658c76ed
Co-authored-by: Aaron Bohy <aab@odoo.com>
Co-authored-by: Mathieu Duckerts-Antoine <dam@odoo.com>
Co-authored-by: Jérémy Hennecart <jeh@odoo.com>
Co-authored-by: Julien Mougenot <jum@odoo.com>
Leftover tooltips may make following tests fail, which isn't what
we want as a test shouldn't impact another one.
X-original-commit: 17a4c72b9a86186c7690bdba5e62ccd64ab2f77a
This commit introduces a new utility function: 'groupBy'. It is
similar in API and result as the underscore method of the same
name.
X-original-commit: 834a1967161dc537cb2d5543314a062dbac08f9c
- Create 2 companies A & B, with different currencies
- Create a product in company B
Set the company on the product
Automated valuation
- Receive some stock in company B
- Switch to company A, and keep B available
- Go to Inventory > Reporting > Inventory Report
The currency on the product is the currency of the product company
instead of the currency of the current company.
The value is computed in the current company currency:
https://github.com/odoo/odoo/blob/bc3d1f2dc408fa91d42743d6a7063042e0f6c42b/addons/stock_account/models/product.py#L115
The currency should be consistent.
opw-2278751
closesodoo/odoo#53426
X-original-commit: 8aa952d18acca5a0ac3b32579e812158e641c13c
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
This commit fixes an issue with deliveries slip
when time < 10 AM in autraslian timezone.
If datetime is 22/06/2020 5AM,
it will be 21/06/2020 on the delivery slip.
This is due to the fact that we use
widget=date on a datetime field.
OPW-2277194
closesodoo/odoo#53425
X-original-commit: c8ec8b4ffbaceb9a58a5ca48bd5a087e779edcc9
Signed-off-by: Jason Van Malder (jvm) <jvm@odoo.com>
This commit updates the orderpoint (replenishment) view with the
following changes:
- group "Min Quantity", "Max Quantity", and "To Order" together
- make preferred route "selection" only (note that widget="selection"
does not work in list view => standard workaround applied)
- renaming of order buttons: "Order" => "Order Once" and "Order Always"
=> "Automate Orders"
- add a link to forecasted inventory report for the product (note this
link will show even if there is no data to show in the report)
- remove class decorates from replenishing related buttons ("Order
Once", "Automate Orders", and "Snooze")
Specifications 14 and 15 of inventory usability task.
Task: 2206279
Related Enterprise PR: odoo/enterprise#10723closesodoo/odoo#51681
Signed-off-by: Arnold Moyaux <amoyaux@users.noreply.github.com>
This commit makes the stock rule added delay consistent with the naming
scheme of "Lead Time" used for many other "delay" values. Also adds
"days" to the view for context of what the number means.
Specificiation 9 of inventory usability task.
Task: 2206279
Related Enterprise PR: odoo/enterprise#10723
When an external report layout has not been setup and an admin user
tries to click on Routes: View Diagram within a product form > Inventory
then the document template setup would open even though it is not
necessary for this diagram.
Specification 10 of inventory usability task.
Task: 2206279
Related Enterprise PR: odoo/enterprise#10723
Two stat buttons which should have said "Product Move" said
"Traceability" instead (which is a different stat button.) This
commit fixes this.
This covers specification 6 of overall inventory usability task.
Task: 2206279
Related Enterprise PR: odoo/enterprise#10723
Delivery slip updated to include the backordered products (not
canceled or already done) in a new table. Note that this only goes
1 level deep (i.e. backorders with backorders will not have their
backordered values included).
To support table alignment, small changes were made to existing delivery
slip table.
This covers specification 4 of inventory usability task.
Task: 2206279
Related Enterprise PR: odoo/enterprise#10723
Rename "Inventory" to "Count Sheet" under print dropdown and add in a
"Print Count Sheet" button to inventory adjustment.
This covers specification 2 of inventory usability update.
Task: 2206279
Related Enterprise PR: odoo/enterprise#10723
Before this commit, monetary fields occurring in kanban views
without widget="monetary" specified weren't correctly formatted:
the whitespace separating the value from the currency symbol was
formatted has $nbsp; (html) instead of a simple whitespace.
closesodoo/odoo#52521
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Co-authored-by: Aaron Bohy <aab@odoo.com>
Create a promotion program with conditions:
- Minimum product quantity (ex 2)
- Minimum purchase in currency (ex 500$ tax excluded)
- Auto apply
- On current order
- with reward:
-- Free product (Free Prod A)
-- 1 Quantity
Create a sale order. Insert 3x ProdA @ 1000$. Click on "promotions".
Nothing will occur because the minimum order amount for applying the reward is
calculated removing from the order the product associated with the
reward. This removed all of the products from the order, so the result is 0.
Fixing by subtracting just the amount specified in the reward program.
opw-2274316
closesodoo/odoo#53407
X-original-commit: 804461fb1353c931986eeae94bd3ad8465b604e7
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
Before this commit the schedule and timezone were only visible in debug mode. As the default timezone is UTC, some misleading information could be displayed in some cases (e.g. planning without internal users).
closesodoo/odoo#52111
Taskid: 2246557
Related: odoo/enterprise#10370
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>