If there is no website selected, there is no point to show the specific
settings (which are supposed to be wrote on website model, that will write on
an empty recordset) as it just flood the screen for nothing.
If multi website is enabled, tell the user he could select a website to load
the settings.
If not enabled, the user can't select a website as the select will be hidden.
In that case, just tell the user that he could create a new website for this
company.
More than just a display improvement, it will also prevent misunderstanding of
the website settings when an user arrive on the settings with no website
selected.
Followup of https://github.com/odoo/odoo/pull/34706closesodoo/odoo#34764
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
This test was merged in 12.0 at 9308180089 where the new folder hierarchy and
asset did not exists (introduced in saas-12.4 at fdbf11643f).
This commit fixes it.
closesodoo/odoo#34629
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
Auto add source Livechat when lead created from livechat command /lead
task:internal-request
closesodoo/odoo#34763
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
Purpose
=======
On a many2many targeting the hr.employee model, if the user has no
access rights to the hr.employee model, clicking on a record of the
many2many will lead to a traceback.
Specification
=============
It's because load_views, called by the web client, will try to load
the form view on the hr.employee model. Overriding the method to
load the public employee form view instead if the user has no read
access is sufficient to solve the issue.
We could have overriden the methods fields_view_get and fields_get,
but it doesn't seem necessary yet.
closesodoo/odoo#34724
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
When opening items from Accounting/Accounting/{Journals/Ledgers} list
it should group items by the related Journal/Ledger but when we
ungroup related Journal/Ledger from 'Group By' list, it should show
all the items which was not happening before this commit.
task: 2026153
closes: #34328
Signed-off-by: Quentin De Paoli (qdp) <qdp@openerp.com>
The read permission on `hr.employee` has been removed from the public
and portal users; replaced with read access on the public employee
profile.
closesodoo/odoo#34508
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
Previously to commit [1] notification emails were send using the after commit
hook (see [2] for related code move and [3] for original code). That commit
changed the parameter default value without any reason, meaning this mechanism
is not used anymore. This commit fixes that behavior.
[1] See commit 581a74143e: code cleaning
[2] See commit 7a6269719f: code move
[3] See commit 38e181ee2c: use of post-commit hook in mail
closesodoo/odoo#34645
Signed-off-by: Xavier Dollé (xdo) <xdo@odoo.com>
Since commit 632fa044c3, polib is used instead of a custom pofile
reader. The setup.py file was forgotten in packaging, leading to a
faulty source package.
closesodoo/odoo#34585
Signed-off-by: Christophe Monniez (moc) <moc@odoo.com>
* Sales > Orders > Sales Team > traceback with error 'user_type_id' isn't defined on account.move.line.
* Also the move.team_id has to appear in some group by because we're using an aggregate function.
Both bugs have been introduced by beaa30a (aka accounting-pocalypse)
closesodoo/odoo#34570
Signed-off-by: Quentin De Paoli (qdp) <qdp@openerp.com>
Commit f60825b439 moved phone validation addition on res.partner model
from a specific module to crm directly. However the inherit from the validation
mixin class was forgotten, leading to a crash when changing phone from the UI.
closesodoo/odoo#34545
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Scenario:
We have the following models:
class A:
submodel_1_ids = fields.One2Many(B)
submodel_2_ids = fields.One2Many(B)
class B:
parent_model = fields.many2one(A)
name = fields.Char()
and the following onchange on class A:
api.onchange(submodel_1_ids)
def onchange_submodel1(self):
// add newline to second o2m
submodel_2_ids = submodel_1_ids
api.onchange(submodel_2_ids)
def onchange_submodel2(self):
do_smth
In a form view containing both o2m fields (editable="bottom" lists):
1) add a line on first o2m -> the onchange adds the same line on
the other o2m
2) add a line on the second o2m
Before this rev., the line (added in (2)) wasn't added at the bottom
of the list, and the row in edition wasn't the newly created one.
The issue occurred because we couldn't retrieve the datapoint
corresponding to the other line (the one created by the onchange on
the first o2m), and we thus created another which was put at the
end of the list. Then, the BasicModel messed up the sort of the
records because it couldn't match the virtual id of that new record
with the ones in orderedResIds.
We fixed the issue by preventing the model from creating a new
datapoint after the onchange, by using 'ref' instead of 'res_id' to
retrieve the one that already exist.
closesodoo/odoo#34493
Signed-off-by: VincentSchippefilt <VincentSchippefilt@users.noreply.github.com>
Co-authored-by: Aaron Bohy <aab@odoo.com>
Co-authored-by: David Monjoie <dmo@odoo.com>
This reverts commit 43d51466c8.
Reasons:
- too complex having 2 UoM "Hours"
- impossible with UoM to modelise month: is that 30 days or 31 ?
Task-1971491
closesodoo/odoo#34497
Signed-off-by: Jérome Maes (jem) <jem@openerp.com>
Since groups added on fields 'barcode' and 'pin' on hr employee in
rev: c9ca376146
It is not possible anymore to launch the POS when 'pos_hr' module is
installed. Because we don't want to allow users to access in read on all
pin codes and barcodes of employees. We've made a function that will get
a sha1 signature of the barcode and pin code of all employees to store
it in the frontend of POS.
We don't have other solutions concerning the security if we want to keep
the POS working offline. We also know that it is not brute force proof,
as pin code are composed of only digits and you can easily generate the
signatures of all pincodes.
closesodoo/odoo#34447
Signed-off-by: pimodoo <pimodoo@users.noreply.github.com>
Now that an onchange set its result into the cache, we
cannot create a user because the onchange tries to put
the reified fields (eg: sel_4_7) into the cache.
As those field don't exist and are pseudo-fields used
to manage groups into the res user form view, we should
replace the values by ORM commands on the groups_id field,
as this is already the case in the create and the write
methods.
closesodoo/odoo#34487
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
This is mainly a typo / wrong computation introduced at 581a74143e.
This commit also fixes some typos in comments.
closesodoo/odoo#34443
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Let's assume a one2many field in a form view with a default value
with commands 4 (link to). Before this rev., when saving the record,
the BasicModel generated a command 4 and a command 1 (update) for
each record, with the values of the record (directly coming from DB).
This can cause an issue when the related record can't be edited
(e.g. a posted journal entry in accounting).
closesodoo/odoo#33797
Signed-off-by: Quentin De Paoli (qdp) <qdp@openerp.com>
This commit merges the following models
* account.invoice and account.move
* account.invoice.line and account.move.line
* account.voucher and account.move
* account.voucher.line and account.move.line
It was the opportunity for a big cleanup of the code, so it also restructures the whole account module, its different models/fields, the tests etc. for a better world and a better code readability.
==== Rationale ====
The rationale of this huge change is that we want journal entries / invoices to be easily edited, and changes reflected in the other model. It's a HUGE feature and very strategic for the fiduciary companies. For example, changing the account of a journal entry needs to be automatically reflected on the related invoice.
The same reasoning applies to sale/purchase vouchers.
==== Changes made in features =====
When creating an invoice, you are now creating a journal entry directly.
--> The object account.invoice no longer exists.
In the same fashion when creating an invoice line, you're now adding journal items directly in the journal entry representing the invoice. If this invoice line has some tax, it may create additional journal items as well.
--> The models account.invoice.line & account.invoice.tax no longer exist
Identically, when creating a sale/purchase receipt with its lines, you are now creating a journal entry directly and there's no more usability difference between encoding a receipt or an invoice.
--> The object account.voucher no longer exists.
--> The object account.voucher.line no longer exists.
--> The whole account_voucher module no longer exists.
Positive side-effects coming from these changes are
* draft invoices/bills/sale or purchase receipts now create a draft accounting entry. Validate these objects now simply post its journal entry. That means that draft invoices/bills/sale or purchase receipt can straightforwardly be included in reporting or budgets.
* opening a journal entry in form view will now always open the correct view: if it's a sale/purchase journal entry we will have a customer invoice/vendor bill view or a sale/purchase receipt view, whatever the menu we're coming from.
* code & business logic simplification. It is also condensed in a single place instead of being partially duplicated on invoices, vouchers and journal entries.
There should be no feature loss, except the one allowing to group multiple journal items together based on the same product during the invoice validation.
==== Changes made in models =====
* account.invoice: model removed. Instead, now use account.move with following mapping
field (account.invoice) field (account.move)
----------------------- --------------------
name invoice_payment_ref
number name
reference ref
comment narration
user_id invoice_user_id
amount_ total_company_signed amount_total_signed
residual amount_residual
state state + invoice_payment_state /!\ selection changed
date_invoice invoice_date
date_due invoice_date_due
sent invoice_sent
origin invoice_origin
payment_term_id invoice_payment_term_id
partner_bank_id invoice_partner_bank_id
incoterm_id invoice_incoterm_id
vendor_bill_id invoice_vendor_bill_id
source_email invoice_source_email
vendor_display_name invoice_vendor_display_name
invoice_icon invoice_vendor_icon
cash_rounding_id invoice_cash_rounding_id
sequence_number_next invoice_sequence_number_next
sequence_number_next_prefix invoice_sequence_number_next_prefix
'invoices' subset of account.move can be accessed by using the selection field 'type' or one of the many helpers like is_invoice()
* account.move: now has a valid state 'cancel' that has to be excluded from all business logic
* account.move: field 'amount' renamed into 'amount_total'
* account.move: field 'reverse_entry_id' renamed into 'reversed_entry_id'
* account.move.line: now has a field 'display_type' that has to be excluded from all business logic, in order to support invoice layouting
* account.invoice.line: model removed. Instead, now use account.move.line with following mapping
field (account.invoice.line) field (account.move.line)
---------------------------- -------------------------
invoice_id move_id
uom_id product_uom_id
invoice_line_tax_ids tax_ids
account_analytic_id analytic_account_id
'invoice lines' subset of all account.move.line from a journal entry can be accessed by using the boolean field 'exclude_from_invoice_tab'
* account.invoice.tax: model removed. Instead, now use account.move.line with following mapping
field (account.invoice.tax) field (account.move.line)
--------------------------- -------------------------
invoice_id move_id
account_analytic_id analytic_account_id
amount price_unit
base tax_base_amount
'tax lines' subset of all account.move.line from a journal entry can be accessed by using the relational field 'tax_line_id'
* account.invoice.confirm: model removed. Instead, now use the 'post()' function of account.move
* account.invoice.refund: model removed. Instead, now use account.move.reversal to reverse the entries with the same options as we had for invoices
* account.voucher: model removed. Instead, now use account.move of type in ['out_receipt', 'in_receipt]
* account.voucher.line: model removed. Instead, now use account.move.line
==== Changes made in functions ====
* on account.move, method _run_post_draft_to_post() renamed into _autopost_draft_entries()
* on account.move, method action_account_invoice_payment() renamed into action_invoice_register_payment()
* on account.move, method action_invoice_reconcile_to_check() renamed into action_open_matching_suspense_moves()
* on account.move, method _get_domain_edition_mode_available() renamed into _get_domain_matching_supsense_moves()
* on account.move, method _get_intrastat_country_id() renamed into _get_invoice_intrastat_country_id()
* on account.move.line, method _get_domain_for_edition_mode() renamed into _get_suspense_moves_domain()
* in account.bank.statement, contextual key 'edition_mode' renamed into 'suspense_moves_mode'
Was task 1917430
559bdc976 was merged with an extra line of code to avoid a bug as the fix was
merged in lower version (9efc11c8da) and we could not wait for the forward
port.
Thus, we forced the redirect on `/my` after signup. This code should be removed
for the test to really test the behavior.
closesodoo/odoo#34406
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
In case of selection or many2one field, while saving the page, the field
is re-rendered and loses the applied design changes.
This commit fixes the behavior by re-applying those changes on a newly
rendered field.
task-1961733
closesodoo/enterprise#4657
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
X-port/Cherry-pick of odoo/enterprise@298a9b3a94
Let's consider a product P with a unit price = 100€
When a price list PL with a discount of 20% was applied, and
a coupon program CP with a discount of 10% was also applied,
system still calculated the rate based on unit price of the product
and not on the discounted price.
So in this example, the amount of the CP discount was 10€ instead of
8€ because the CP discount was computed on the unit price 100€
instead of the discounted price 80€ (with 20% discount of PL)
opw:2006829
X-port/Cherry-pick of odoo/enterprise@23739e8a71
In case of failure at token creation, raise a proper UserError instead
of a generic traceback.
opw-2025723
closesodoo/odoo#34420
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
Avoid crash at currency conversion when no company is set on the SO
opw-2009044
closesodoo/odoo#34408
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
It's currently possible for binary downloads to be missing an
extension entirely. Generate an extension from the mimetype and use
that. Also ensure the existing extension (if any) matches the
mimetype.
Warning: this may require adding new mimetype/extensions pairs to the
local mimetype database similar to
f413d155df.
Also fix missing or incorrect filenames on records without a filename
field: in some Odoo versions the client would send a filename of
"null", resulting in a download of e.g. "null.pdf" instead of the
attachment or inferred name.
Task 2025716
closesodoo/odoo#34299
Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
The error message is built from string pieces except one that is a list.
This commit cast this list into a proper string to be able to build the
error message.
closesodoo/odoo#34402
Signed-off-by: Arnold Moyaux <amoyaux@users.noreply.github.com>
Before this commit, on editable quant view list, when user tries to
create a duplicate line and save it with tab or enter key, the list
tries to go to the next line. But sometime, this line was moved cause of
the refresh, so it causes a JS error and raises a traceback.
This fix avoid to try to select something in case we refresh the list.
Task #2006337closesodoo/odoo#33866
Signed-off-by: Simon Lejeune (sle) <sle@openerp.com>
- Make a SO with a product that have a carriage return in its
description
- Export FEC report
The CSV contains new lines and is not correctly formatted.
opw-2026861
closesodoo/odoo#34385
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
- Install stock module
- Activate multi-company and variants
- Create a second company
- Create a product with 2 variants
- Create a picking with the product for both companies
- Add an attribute on the product with 2 values
- Save
An AccessError is raised on `stock.move`.
It arises because the field `product_qty` on `stock.move` must be
recomputed but is on a record in a different company.
The `try` / `except` clause doesn't protect against the recomputation.
Indeed, what happens is:
- try to unlink in batch => AccessError due to recomputation
- try to unlink individually => AccessError due to recomputation
- try to write individually => the field couldn't be recomputed before
(flagged as dirty), so try again to recompute => AccessError
We perform the operation as sudo, and take care of checking the access
rights beforehand.
opw-2009450
closesodoo/odoo#34369
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
There is a conflict in saas-12.3.
Indeed, the optional popup on a product when adding to cart got encapsulated
into a new module with 55ed70f405.
But 9308180089 introduced a new test in 12.0 about free delivery.
The tour expects the popup to be shown, but it is not the case anymore.
The tour needed to be adapted. Standard runbot was green since the test would
luckily be executed after `website_sale_product_configurator` would be
installed. That was not the case on runbot theme.
The chance is also taken to ensure the test is executed on the correct
delivery.
closesodoo/odoo#34367
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
When creating a new tax, before saving, the default-computed repartition lines had no country_id associated. It only 'appeared' when saving the record.
closesodoo/odoo#34359
Signed-off-by: Laurent Smet <smetl@users.noreply.github.com>