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>
Before this fix, the many2one text in the list view was not wrapping.
After this fix, the text will wrap according to the available space
(managed automatically by the browser).
closesodoo/odoo#34345
Signed-off-by: VincentSchippefilt <VincentSchippefilt@users.noreply.github.com>
Following the revamp / contextualisation of multi company, the list of
allowed companies from the context is now used as part of the ir_rule
caching key.
Sadly that list is a list, and thus not hashable, meaning
_compute_domain was not cached anymore. Sadlier, type errors would be
silently ignored (just increasing the error counter of the cache stats).
Fix both issues:
* Store lists from the context as tuple. Technically could be a
frozenset but that might not always be the case so it doesn't feel
future-proof, a tuple might lead to slightly less hits but seems safer
* Log a proper warning in case of an ormcache TypeError (non-hashable
type used as cache key). It should never routinely happen.
closesodoo/odoo#34330
Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
When registering a payment against multiple vendor bills and change the memo,
the memo must be populated to all the payments. This behavior has been introduced
with the following commit in stable 11.0: c04065abd8
opw:2024652
closesodoo/odoo#34322
Signed-off-by: Simon Goffin (sig) <sig@openerp.com>
Backport from 12.0 to 11.0 (commit: 3cbdfe8807)
- Have two crm teams with the same team leader, and without team members
(team1, team2 as instance).
- Create a new lead, add as Salesperson the team leader, and as Sales
team the second previously created team (team2).
- Save the new lead.
Before this commit, when we save the lead, the sales team will change,
to set the default sales team for the chosen Salesperson, in this case
team1.
opw-2005924
closesodoo/odoo#33898closesodoo/odoo#34327
Signed-off-by: Simon Goffin (sig) <sig@openerp.com>
This commit improves the elearning onboarding on the quizzes
If the user is not logged in, a log in button will show up under
the quiz
If he is logged in but not a member of the course and the course is public,
a join button will appear under the quiz
If the course needs to be bought, a buy button will appear under the quiz.
If the course is on invite only, a message under the quiz will inform the
user about it
TaskID: 2003986
PR: #33861
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>