Add sudo in base to allow a unpriviledged user to interact with
ir.property in a safe way usingsetters and getters.
By making them callable without sudo, we encourage to use these
methods instead of making CRUD requests on ir.property directly
For other specific search where no native method exists, add sudo
Only administrators can access properties and configure them.
ir.property may contain sensitive information and should only be
accessed via code call to specific methods
Before this commit, when retrieving a property, the res_id had to be
in the format <model>,<id>. This was redudant with the model already
present in the arguments of the method.
This way a property can be retrieved with the more concise form
`Property._get("ref", "res.partner", 42)`
The business case is the following:
1) The Child company can order the product to the Parent company;
2) The Parent company order the product to a 3rd party supplier.
Settings:
- Enable ‘Inter-Company Transactions’ transactions with the option
‘Synchronize sales/purchase orders’ checked;
- Enable 'dropshipping'.
Set 2 companies:
- Parent company;
- Child company: which belongs to the Parent company.
Set a product 'my purchased product':
- Can be Purchased;
- Product Type: Storable Product.
- ‘Purchase’ tab:
- Set a Vendor price list line 1: which is your Parent company + set
your Child company who can buy the product;
- Set a Vendor price list line 2: which is your 3rd party Supplier +
set your Parent company who can buy the product.
- Log in as the Child company (disable the login in the Parent company,
select only the Child one);
- Place a Purchase Order for ‘my purchased product’ to vendor 'Parent
company';
- Confirm the PO.
Before this commit, an error message appears. The issue arises because
seller_ids is retrieved from the cache and not re-read as superuser.
Therefore, records are missing from the list and the correct seller is
not found.
Now, the correct vendor for the purchase order of the parent company is
selected.
opw-2261971
closesodoo/odoo#51887
X-original-commit: 0a9f0c5d2c85e80dd5dceaeacf3f04bfc8aa0be1
Signed-off-by: Jorge Pinna Puissant (jpp) <jpp@odoo.com>
With a database that contains a lot of production with kits or
BoM with a lot of bom.line. The database could become slow.
Index on stock.move <-> mrp.production could improve it.
closesodoo/odoo#51870
Signed-off-by: Simon Lejeune (sle) <sle@openerp.com>
PURPOSE
Improve marketing automation tests: improve their reading, add more tests
and notably SMS tests. For that purpose clean helpers and tools.
SPECIFICATIONS
Add some helpers to improve marketing tests (click on SMS, find sms / mail
based on data available in tests, ...).
Modules holding tests and helpers
* link_tracker: mainly mock, asserts and tools for link tracker tests
(MockLinkTracker);
* mail: mainly gateway mock and base for mail tests
* MockEmail -> mocks for mail gateway;
* MailCase -> tools and asserts for mail tests;
* MailCommon -> base for mail functional tests);
* sms: mainly SMS gateway mock and base for sms tests
* MockSMS -> mocks for SMS gateway;
* SMS Case -> tools and asserts for mail / SMS tests;
* SMSCommon -> update of MailCommon with SMS capabilities);
* mass_mailing: mainly asserts and tools for mass mailing tests
* MassMailCase -> update of MailCase for mass mailing tools and asserts;
* MassMailCommon -> update of MailCommon with mass mailing);
* mass_mailing_sms: mainly asserts and tools for mass SMS tests
* MockMassSMS -> update of MockSMS for mass SMS tools and asserts;
* MassSMSCommon -> update of MassMailCommon with SMS capabilities);
Modules for tests
* test_mail: module for mail app tests (TestMailCommon);
* test_mass_mailing: module for mass mailing app tests (TestMassMailCommon);
* test_mail_full: tests integrating all discuss features, currently mainly
mail and SMS (TestMailFullCommon);
Enterprise: update test_mail_enterprise and test_marketing_automation
LINKS
Task ID 2247037
Community PR odoo/odoo#50384
Enterprise PR odoo/enterprise#10266
Upgrade PR odoo/upgrade#1122
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
- Create rates at dates 1 and 2 for a foreign currency
- Create an invoice at date 1 in foreign currency, set a partner
- Register a payment at date 2
The foreign exchange entry has no partner, while it should have as it
was the case up to 12.0.
opw-2249257
closesodoo/odoo#51873
X-original-commit: 3bc48c01f68c6ee95bec206a4a992adc43a0d8b9
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
Fix a crash when calling assertSMSStatistics without a number but taking the
number from a partner.
Also fix "sent" sms helper, content should be optional like other helpers.
Task ID 2247037
Community PR #50384
Modules holding tests and helpers
* link_tracker: mainly mock, asserts and tools for link tracker tests
(MockLinkTracker);
* mail: mainly gateway mock and base for mail tests
* MockEmail -> mocks for mail gateway;
* MailCase -> tools and asserts for mail tests;
* MailCommon -> base for mail functional tests);
* sms: mainly SMS gateway mock and base for sms tests
* MockSMS -> mocks for SMS gateway;
* SMS Case -> tools and asserts for mail / SMS tests;
* SMSCommon -> update of MailCommon with SMS capabilities);
* mass_mailing: mainly asserts and tools for mass mailing tests
* MassMailCase -> update of MailCase for mass mailing tools and asserts;
* MassMailCommon -> update of MailCommon with mass mailing);
* mass_mailing_sms: mainly asserts and tools for mass SMS tests
* MockMassSMS -> update of MockSMS for mass SMS tools and asserts;
* MassSMSCommon -> update of MassMailCommon with SMS capabilities);
Modules for tests
* test_mail: module for mail app tests (TestMailCommon);
* test_mass_mailing: module for mass mailing app tests (TestMassMailCommon);
* test_mail_full: tests integrating all discuss features, currently mainly
mail and SMS (TestMailFullCommon);
Enterprise: update test_mail_enterprise and test_marketing_automation
Task ID 2247037
Community PR odoo/odoo#50384
Enterprise PR odoo/enterprise#10266
Upgrade PR odoo/upgrade#1122
The pos.order.line quantity wasn't considered when computing the discount amount.
E.g. buying 5 products (1$) at 50% would only show 0.5$ as discount_amount, instead of 2.5$.
Followup of #43587closesodoo/odoo#51872
X-original-commit: 96e96284fceb2f68838c85f04c40da65176eb006
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
Due to commit odoo/odoo@8e48ba3eb5
a span was added to show the time before the title on a event in
month view.
DOM of event
+---------------+
| SPAN FOR TIME |
+---------------+
| TITLE |
| |
| |
+---------------+
This commit, hide the empty span when is not needed, to avoid empty
blank space.
Steps to reproduce:
* Go in calendar app
* Go in view week (BUG)
closesodoo/odoo#51859
X-original-commit: 8456be44b1bc6746563cbca5366257a1da8b4a53
Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
Signed-off-by: rfr-odoo <rfr-odoo@users.noreply.github.com>
As some payment acquirers require the email to be set,
a warning is shown when generating a payment link if
the partner does not have an email.
OPW-2254011
closesodoo/odoo#51857
X-original-commit: 6f61e89ab9b947ca54cfd8dbd5470083a625d24e
Signed-off-by: Damien Bouvy (dbo) <dbo@odoo.com>
The description of the model is used in sentences like
This <model> has been created from: <link>
All model descriptions should be singular
Courtesy of Erwin van der Ploeg for raising the issue
closesodoo/odoo#51837
X-original-commit: e0acef778272abb748dacfe4460b3536b3c30a82
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
Don't try to save bytes, make longer sentences, easier to translate
instead of splitting it into small blocks of one word.
https://www.odoo.com/documentation/13.0/reference/translations.html#blocks
Courtesy of Erwin van der Ploeg for raising the issue
X-original-commit: 737ee6393cd99b0c41272f6cfa9a0acb68276744
- Create a user with only Point of Sale / User rights
- Open a POS session
An AccessError is raised on `account.cash.rounding`.
We add he access right: the user should be able to read the cash
rounding configuration.
opw-2258719
closesodoo/odoo#51816
X-original-commit: 61915c33e4e0e7979d10dee01fa80a6511498f33
Signed-off-by: pimodoo <pimodoo@users.noreply.github.com>
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
- Go to Website > Configuration > eCommerce > Payment Acquirers
- Activate Stripe
- Configure Stripe
- Go to Sales
- Create a quotation
- Send quotation by email
- Click on "Customer Preview" smart button
- On Website, click on "Sign & Pay" or "Pay Now" if already signed
- Sign it and confirm on "Accept & Sign"
- On payment wizard, select "Credit Card (powered by Stripe)"
- Validate with "Pay & Confirm" button
An error message appears.
opw-2262990
closesodoo/odoo#51815
X-original-commit: 3c5117eaac96604a3306c90480d106e0e36fed2f
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
Purpose
=======
On the Employees App, we dont have a smart way to start a discuss
with a colleague or an employee.
Specification
=============
Style for each button :
- use fa-comments
- use primary color/action color (green)
On private/public employees form/kanban views, add a button to
start a chat with the user
closesodoo/odoo#51484
Taskid: 2252207
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
Replaces the auto_join scheme which is pretty fast but doesn't quite
work (it's *completely* broken for read_group) by a subquery which is
slower but has the same semantics as the ORM version.
Ideally we'd use `EXISTS (select 1 from ...)` but that has no support
inside the SQL compiler right now, so use `id in (select inverse_field
from ...)`.
Here are some measures of a `read_group` on a simple object with lines
filtered on line values, similar to
read_group([('order_line.product_uom', '=', xxx)],
fields=['total_amount'], groupby=['user_id'])
+-------+-------+-------+--------+
| | ORM | join |subquery|
+-------+-------+-------+--------+
| large | 160 | 10 | 20 |
+-------+-------+-------+--------+
| many | 36000 | 50 | 180 |
+-------+-------+-------+--------+
* values of data fields (filtering, grouping and aggregating) randomly
picked between 10 different values
* "large" is 1000 objects with 1000~15000 lines each
* "many" is 1000000 objects with 1~40 lines each
closesodoo/odoo#48494
Signed-off-by: Raphael Collet (rco) <rco@openerp.com>
Due to commit odoo/odoo@0150141756
when the widget calendar is initialized with date type record for
date_start and without all_day mapping events aren't shown on day/week
views. This is because all day zone isn't visible when all_day mapping
is not set.
After this commit, we show the all day zone also when the date_start is
a date type.
Steps to reproduce:
* Go to Project App
* Select/Create a project
* Select/Add a task with a deadline
* Return to project
* Select calendar view
* Select week view (of the deadline) => BUG
closesodoo/odoo#51818
X-original-commit: 1d83f4184e1b82db4dd4db54d98e509432340996
Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
Signed-off-by: rfr-odoo <rfr-odoo@users.noreply.github.com>
Steps to reproduce the bug:
- Create a repair order RO for a product P1
- Create a part for a product P2 that needs a lot L
- Specify a source location for P2
- Process RO
- Click on 'END REPAIR'
Bug:
A UserError was raised saying: You need to supply a Lot/Serial number for product P2
even if a lot L was set to P2
opw:2251047
closesodoo/odoo#51797
X-original-commit: 1e3ed56332efd3f58ccd05f23c6af9cb23f1052f
Signed-off-by: Simon Goffin (sig) <sig@openerp.com>
Purpose
=======
Task 2195254 introduced many wonderful widgets to pimp the list view.
This task aims at implemeting them into the Services apps: project,
timesheets, helpdesk, expense, planning and field service.
Remaining days: https://drive.google.com/file/d/1o4Wn47445GxLqBkw-ifH9MgtFU_437xz/view
Avatar: https://drive.google.com/file/d/1yDwJWP0MZCUKZbqCa8hte1ziVTYRMMtb/view
Activities: https://drive.google.com/file/d/1e_rXH50eZq4zY2HOzw7_pfgiD39SoRIl/view
Field-specific decorations: https://drive.google.com/file/d/1WFnqJ-jkyDFftRHxWW4bgomoWrOpOuaY/view
More control on buttons
Specifications
==============
You will find below a list of which widgets to apply to which fields by
model. Some changes have to be done in the form/kanban views as well.
1) project.task
remaining days -> date_deadline -> list + kanban + form views
hide this field if is_closed is true
avatar -> user_id -> list view
activities -> 'next activity' field to be added -> list view
field-specific decorations
https://nimb.ws/ACewrY remove the current orange/red decorations we have
if planned_hours > 0, display the remaining_hours field in (list view):
red if progress is > 100%
orange if progress is between 80% and 100%
green if progress is <80%
display unit_amount in red if > 24:00 -> form view
2) rating.rating
display the rating in:
green = satisfied
orange = not_satisfied
red = highly_dissatisfied
list + form views
3) project.project
avatar -> user_id -> list + form views
4) account.analytic.line
avatar -> employee_id -> list view
display unit_amount in red if > 24:00 -> list + kanban + form view
https://nimb.ws/eIWa7E merge the timer and duration fields together
5) helpdesk.ticket
avatar
user_id -> list view
employee_id under timesheet_ids -> form view
remaining hours -> sla_deadline
activities -> 'next activity' field to be added -> list view
field specific decoration -> display unit_amount in red if > 24:00 -> form view
6) hr.expense
avatar -> employee_id -> list view
activities -> 'next activity' field to be added -> list view
badge -> state -> list view
draft = blue
reported = green
approved = green
done = green
refused = red
combine the unit_amount and the currency_id fields (see the total_amount field for reference) -> list view (idem for the expense_line_ids one2many on hr.expense.sheet)
display the total_amount in bold
move 'company_id' before 'amount'
7) hr.expense.sheet
avatar
employee_id -> list view
user_id -> list view
activities -> 'next activity' field to be added -> list view
badge -> state -> list view
draft = blue
submit = green
approve = green
post = green
done = green
cancel = red
display the total_amount in bold
move 'company_id' before 'amount'
8) planning.slot
avatar -> employee_id -> list view
decoration
display the allocated_percentage field in red if > 100% -> list + form view
display the forecast_hours field in red if > planned hours and if planned_hours > 0 -> form view
display the effective_hours field in red if > forecast_hours and if forecast_hours > 0 -> form view
9) misc
calendar.event -> avatar -> user_id -> form view
mail.activity.type -> combine the delay_count and delay_unit fields together -> list view
note.note -> 'next activity' field to be added -> list view
crm.lead.mining.request
combine the lead_number and lead_type fields together -> list view
display the name in bold
badge -> state
draft = blue
done = green
error = red
planning.slot.template -> display the duration field in red if it is = 0
closesodoo/odoo#51271
Taskid: 2248351
Related: odoo/enterprise#10605
Related: odoo/upgrade#1252
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
Before this commit, when a backorder is created, it was automatically
reserved. It is no more the case. Now user have to reserve it manually.
The reason is, when a user doesn't delivery all expected quantities, it
could be because there is no enough quantity in stock, or the user
doesn't want to delivery all. In these cases, it doesn't make sense to
reserved it directly.
task-2181611
When user creates a new order point, if he/she comes from a template or
variant product page, adds the product id or the product template id in
the `product_id` field domain in the `stock.warehouse.orderpoint` model.
task-2181611
This commit adds the `base.group_user` access group to the `pdf_js_lib`
template so it can be lazy loaded in the JS.
closesodoo/odoo#51804
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
* avoid doing super where we removed the super method: Was done in adapting l10n_cl to do without the methods in l10n_latam_invoice_document
* journal name to create
* at least fix for the document type itself
* making it work like before with shared sequences
closesodoo/odoo#49095closesodoo/odoo#51496
Related: odoo/enterprise#9699
Related: odoo/enterprise#10654
Signed-off-by: Josse Colpaert <jco@openerp.com>
- Create a vendor bill with a line having a group of taxes
An additional tax line is displayed under the bill total with a 0 amount
because the created group of taxes has a zero amount.
closesodoo/odoo#51802
X-original-commit: adb02066f7cbead66eca21185f2ad142b46298a8
Signed-off-by: oco-odoo <oco-odoo@users.noreply.github.com>
- Activate 'Delivery Packages', 'Storage Locations'
- Open Inventory → Configuration → Operation Types
- Create a new one with:
name: Pack Transfer
Default source location: Stock
Default destination location: Stock
Move Entire Packages: True
- Open product [FURN_7777] Office Chair
- Use button 'Update Quantity' to create a new inventory:
Choose 'Shelf 1' as location
Create a new package 'PACK0000001'
Set any quantity
- Go to Inventory → Transfers
- Create a new one (WH/PT/00001) with:
Operation Type: Pack Transfer
- Shipping Policy: When all products are ready
- Create a Package line (package level) to move the package
'PACK0000001' to Shelf 2
- Reserve the transfer WH/PT/00001
- Duplicate WH/PT/00001, which produces WH/PT/00002
From there, WH/PT/00002 seems empty, no apparent move, move line or
package level. However the new transfer is misbehaving, for instance:
- Add a new operation in WH/PT/00002 for 3 "[E-COM10] Pedal Bin"
- Mark as todo and check availability
The move for "[E-COM10] Pedal Bin" is reserved and the transfer
WH/PT/00002 is "Waiting" while it should be "Ready".
When the `stock.move` are duplicated, the value of `package_level_id` is
copied, linking the new `stock.picking` to the wrong package.
There is no need to copy the `package_level_id`. When not copied, the
list of products is correctly added to the new picking, without taking
packages into account.
opw-2252969
closesodoo/odoo#51798
X-original-commit: ecf726ae8221e6871c1e391294c633d8b6bcaa9a
Signed-off-by: Simon Lejeune (sle) <sle@openerp.com>
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
Before this -
unable to validate batch picking if - any of picking from
batch is manually done.
Fixes-2238699
closesodoo/odoo#51791
X-original-commit: 4123809a56c0aadc752cd9a9c331cccee34c0889
Signed-off-by: Simon Lejeune (sle) <sle@openerp.com>
- Go to any page where there is a chatter
- Click on the followers list icon to display all followers
- Click on the icon (not the name) of a follower
This generates an error.
The redirect is executed in JS by retrieving the model and the id added to the <a> element.
When clicking on the follower icon, we are not clicking on the <a> element but on a child.
The model and the id have to be retrieved from its parent element.
opw-2256795
closesodoo/odoo#51790
X-original-commit: 11c4a2907e635662216ebc0e745f0ce9d16771cb
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
- Create 2 companies C1 & C2
- Creae a product P
- In C1, set the routes as MTO + Buy, add a supplier
- In C2, add a BOM in kit for P
- Go back to C1 with C2 as an allowed company
- Create a SO for 1 unit of P, confirm
The PO for P is not created.
It occurs because the BOM of C2 is retrieved when running the
procurement, while it shouldn't be.
opw-2260945
closesodoo/odoo#51779
X-original-commit: 96b0dcf9e51f5a924e2cbf618c2ee5462cc1f03f
Signed-off-by: Arnold Moyaux <amoyaux@users.noreply.github.com>
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
Task 2005158
Manage the e-faktur numbers, create the required csv file to send to the
tax office, and mark invoices taken care of manually.
closesodoo/odoo#51767
Signed-off-by: Josse Colpaert <jco@openerp.com>
Create a coupon program following these steps:
- Set name
- set 'Discount Apply On' to 'On Specific Product'
- Add specific product
- Set 'Apply Discount' to Fixed price
- Input the fixed price
- Save
Generate a coupon and try to apply it on a quotation.
Error will popup because Not all conditions are met.
The field discount_apply_on (invisible with fixed price) keep the
application "specific_products". Fixing by checking the values in the
backend.
opw-2257783
closesodoo/odoo#51574
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
Check backorder is divided in 3 blocks:
1) quantities on move lines linked to a move
2) quantities on move lines without moves nor products but with a
package
3) quantities on move lines without moves but with a product
1) added quantities in the move's uom, 2) added quantitis in the product
uom, 3) doesn't seem to be used (and shouldn't be). Clarify all of that.
task-2239964
closesodoo/odoo#49790
Signed-off-by: Simon Lejeune (sle) <sle@openerp.com>
Bugs
====
On e-commerce, the portal user is not able to upload
attachment with his comment, under a product.
On website blog, the portal user is not able to upload attachment with
his comment, in the discussion of the blog.
And, in `website_crm_partner_assign`, portal user is not able to upload
attachment with his comment, under the lead/opp.
Issue
=====
In the create method of the mail message, we check is the user can
read the attachment. If he can't, we raise an error.
But, the method that make the verification doesn't care about the access
token. So, when a portal user want to upload an attachment on a "public"
record (without a token on the record to sudoed it) the error is raised.
The portal user give an token for the attachment, so he should be able
to attach it to the message. This verification is done with
`_portal_post_check_attachments` so we can sudo write the attachment
after the creation of the mail message to bypass the verification.
Task-2214795
closesodoo/odoo#51772
X-original-commit: d59f8f62dbc7771fee51c3593f89f9b6832bb7ec
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
- Create a SO, add a product with automated valuation
- Validate that SO
- Validate the picking
- Generate the invoice and validate
- As a limited user with only 'User' Inventory access rights, return the
picking
- Validate the return
An `AccessError` is raised on `stock.valuation.layer`.
A regular user should be able to make a return, but not access the
accounting information. Therefore, use `sudo` where appropriate.
opw-2256074
closesodoo/odoo#51764
X-original-commit: c819a7e2fccbecce344ac74a33f0653eb8ba1027
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
This commit adapts several views to make them use newly defined
widgets, the new decoration-xxx mechanism on fields, and to adapt
them to the new design of buttons.
used following widgets and designs -
1) decoration-bf
2) many2one_avatar_user widget
3) badge widget
Task-2248231
closesodoo/odoo#51074
Related: odoo/enterprise#10528
Signed-off-by: Simon Lejeune (sle) <sle@openerp.com>
Revision 29b3b67a16 introduced payment with iDeal but accidentaly
introduced an issue where some payments did not go through (in fact,
some cards could not be saved, preventing the payment to occur).
This fix prevents this issue from happening by clearly differentiating
between returns from the Checkout process and from the Elements process;
in the case of a Checkout flow, the 'card' key is always present in the
data dict but can be equal to None if a non-card payment method was used
(e.g. iDeal) while in the case of an Elements (payment from Odoo) flow,
the 'data' key is never present and the card information has to be
downloaded using a get request to the Stripe API.
opw-2253269
closesodoo/odoo#51269
X-original-commit: f0ba15cda070e968699cf77ac0ba58234dbdaf51
Signed-off-by: Damien Bouvy (dbo) <dbo@odoo.com>