Commit Graph
126133 Commits
Author SHA1 Message Date
Julien (juc) Castiaux c9229aa949 [FIX] website_crm: contact us form create leads in wrong company
In a mutli-company account with multiple websites for the
differents companies, the 'contact us' form creates leads in the
company of the admin instead of the one linked to the website.

This PR corrects that behavior by setting a 'company_id' field
to the company_id of the user in case that field is missing on
models that require it.

opw-1907375

closes odoo/odoo#28749
2018-11-19 15:57:52 +00:00
Nicolas Martinelli 84bf9f3145 [FIX] sale: free optional product
- Create a dynamic product P1 with an optional product P2
- The list price of P2 is 20
- Create a pricelist where P2 is free (fixed price of 0)
- In a SO, choose 'Configure a product' and choose P1, add

In the modal which suggests P2, its price is 20 instead of 0.

This is because we fall back on the list price when fetching the
combination prices.

This should not be necessary since:
- a pricelist is required to fetch a price
- a pricelist should always contain a rule applying to all products

Therefore, the list price doesn't need to be used as a fallback.

It is then necessary to modify the test tours by adding a partner on the
SO before selecting the product. Anyway, this is usually the way to go
since the selection of the partner determines the pricelist.

opw-1902456

closes odoo/odoo#28687
2018-11-20 10:22:56 +00:00
Nicolas Martinelli 9ba547100d [FIX] web: External Link
- Install Sales
- Go to Sales > Orders > Customers, 'Invoicing' tab
- Add a Bank Account

The 'External Link' button (which allows opening the form view) on the
bank account is not visible.

More generally, in the case of a One2many list view in a `<group>` tag,
the 'External Link' button of a Many2one field (which allows opening
the form view) is not visible.

The `flex: 1 0 auto;` should not be applied in the list view.

Corresponding PR in v11: #28812
opw-1903158

closes odoo/odoo#28741
2018-11-19 19:22:51 +00:00
Lucas Perais (lpe) 596af12c21 [FIX] web: dateField datepicker don't propagate field options
In a form view (account.invoice), have a date field as:

    <field name="date" options="{\'datepicker\': {\'warn_future\': true}}"/>

Open a record with the field set to a value
Click Edit, click save
Click create

Before this commit, the value of the field of the new record
took the one of the previous record

On account invoices, it resulted on having the popup "The record has been modified etc...."
And it was not possible to create an invoice from another one

this was because we passed the same reference object for the datepicker

After this commit, there is no popup as the field do not take a value from the framework

OPW 1906085

closes odoo/odoo#28759
2018-11-19 15:38:22 +00:00
Raphael Collet 5eb2fbdec3 [FIX] base: create parent XML ids before XML id
When a module creates a record from a model M that `_inherits` from some parent
model P, the method `_load_records` creates an XML id for the record, and an
extra XML id for the parent record.  The corresponding `ir.model.data` entries
must be created in the right order (parent record, then record), so that the
record is deleted before its parent record.

closes odoo/odoo#28805
2018-11-19 14:57:52 +00:00
Goffin Simon 7b8c415fc5 purchase_mrp: qty_received not updated on a PO
Steps to reproduce the bug:

- Let's consider a product P with a BOM in kit
- Create a PO with P and confirm it
- Cancel the shipment and the PO
- Reset to draft the PO and confirm it
- Valide the new shipment and receive P

Bug:

The qty_received was not updated

opw:1904678
2018-11-19 15:23:00 +01:00
len-odoo 0081321136 [FIX] website_sale_digital: display download links on free digital orders
Create a coupon/promotion that gives a 100% discount on some digital product.
If the total of the order is 0, then the client won't have the possibility
to download the product(s), since the download links appear on invoiced lines;
and no invoice has been created.

We display the download link on the products if the order total is 0,
as the other cases are already covered by the existing code.

opw 1905682

closes odoo/odoo#28799
2018-11-19 13:46:02 +00:00
Denis Ledoux 8ea10d42ba [FIX] website_sale: performance imp to search abandoned carts
By removing the `.id` from the `partner_id.id` domain leaf,
the ORM avoids to do a useless `SELECT` to read
the id of all partners different from the public partner,
as it already got the information from the `sale_order` table

e.g
Here is the SQL request before the revision:
```
SELECT "sale_order".id FROM "sale_order" WHERE ((((("sale_order"."date_order" <= %s)  AND  ("sale_order"."team_id" in (%s)))  AND  ("sale_order"."state" = %s))  AND  ("sale_order"."partner_id" in (%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s)))  AND  ("sale_order"."id" in (%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s))) ORDER BY "sale_order"."date_order" DESC,"sale_order"."id" DESC
```
Here it is after:
```
SELECT "sale_order".id FROM "sale_order" WHERE ((((("sale_order"."date_order" <= %s)  AND  ("sale_order"."team_id" in (%s)))  AND  ("sale_order"."state" = %s))  AND  ("sale_order"."partner_id" != %s))  AND  ("sale_order"."id" in (%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s))) ORDER BY "sale_order"."date_order" DESC,"sale_order"."id" DESC
```

closes odoo/odoo#28927
2018-11-21 17:05:13 +00:00
Raphael Collet 4894419b61 [FIX] cache: ormcache logger
The adaptation to Python 3 was done with two mistakes: the iteration on the lru
cache does not return keys, and functions are not sortable.

closes odoo/odoo#28870
2018-11-21 10:16:06 +00:00
Florent de Labarre baf48ee1f9 [FIX] project: remove unused and slow field
closes odoo/odoo#28887
2018-11-21 12:17:22 +00:00
Nicolas Martinelli 89927b7725 [FIX] point_of_sale: fine tune test
Remove false-positive errors based on the order of the data.

opw-1910248

closes odoo/odoo#28880
2018-11-21 11:18:26 +00:00
Nicolas Lempereur 2e8cc56432 [FIX] account: invoice sent when sent from list
The "sent" field on an invoice indicates if it has been sent to
customer or not.

When the invoice is sent to a customer from a form view the sent was
set, but when it was sent from the "Send" action on the list view,
it was not updated which seems wrong.

opw-1910937
closes #28796
2018-11-19 13:36:28 +00:00
Aaron Bohy 48a2ee0b07 [FIX] web: remove debugger
closes odoo/odoo#28798
2018-11-19 13:41:36 +00:00
Olivier Dony 45aaca1d4b [FIX] mass_mailing: fix typos in 8545e05fc0
TODO: add test coverage for this computed field

closes odoo/odoo#28797
2018-11-19 13:33:44 +00:00
Géry Debongnie d28c413991 [REF] *: update js test suite to use helpers
This rev. is the counterpart of community PR odoo/odoo/pull/28784.

Joint work with aab, dam, ged, mge, svs and vsc.

closes odoo/enterprise#3100
2018-11-19 13:30:30 +00:00
Prakash Prajapati 96b103a8b1 [IMP] stock_account: Return product improvement
-Ticked by default(Update quantities on SO/PO)
   -Hidden in debug mode
   -Rename label "To Refund (update SO/PO) into Update quantities on SO/PO"

This commit is related to task ID 1880715 and closes PR #28091.
2018-11-19 11:11:30 +00:00
Robot Odoo 8272b914d5 [REF] mrp: state refactoring
The purpose of this PR is to allow more flexibility on Manufacturing.
It will allows:
- Pull and Push rules are no more directly trigger. It will require a confirmation from the user in order to launch them. (except when it comes from another rule)
- The user will be able to add extra components. Those components will follow the classic flow (trigger rules, will be present in workorders and produce wizard, ...)
- State will be computed and will not require explicit write
- Advanced filter

Task 1889384

closes odoo/odoo#28034
2018-11-28 06:06:17 +01:00
Robot Odoo 257bd0e874 [IMP] website_sale: add html field to customize category header
closes odoo/odoo#29085
2018-11-27 18:27:17 +01:00
Jeremy Kersten 432997b967 [IMP] website: support custom placeholder in empty-structure for editor
Before this commit, the placeholder was hardcoded:
'Drag building blocks here'

Now you can customize the placeholder using a data-editor-message attribute.
2018-11-27 16:13:01 +00:00
Fabien Pinckaers d06fcffe1d [IMP] website_sale: ability to set a cover (or other building block) in /shop/category/X
This commit closes #29045
2018-11-27 15:49:43 +00:00
Arnold Moyaux 1efc2e9ad9 [FIX] mrp: mrp user w/h inventory right 2018-11-27 11:58:02 +00:00
Arnold Moyaux 7206b385b5 [IMP] mrp: raw moves generation in onchange 2018-11-27 11:58:02 +00:00
Arnold Moyaux d76048c003 [IMP] mrp: miscalenous tab no more in debug mode 2018-11-27 11:57:44 +00:00
Arnold Moyaux 3bb3e6a530 [IMP] mrp: add a 'draft' state to MO
The purpose is to be able to plan manufacturing order
without propagate the components's documents directly.
Except when the manufacturing comes from a pull rule, it will
be confirmed directly.

In order to do it, it will just create the moves without confirm them.
They will be only confirmed after a 'Mark as Todo' click.
2018-11-27 11:57:43 +00:00
Arnold Moyaux c407d9afb9 [REF] mrp: compute state for production
Refactor production order state:
- Directly have an idea of linked workorders's state
- Computed in order to manage it in a single method
- Add tooltips for each state

Remove the None in availability selection field instead use a False

Also refactor the ready_to_produce field in order to only set as
assigned a production order that have the component for its first
workorder.
2018-11-27 11:56:56 +00:00
Romain Derie 52c3836780 [IMP] website_sale(_comparison): simplify xpath for old customize_show
Historically, the `website_sale.product_attributes` was a customize option.
That template became a normal view (removed customize_show attribute) with
bbd2d0e42
As it is now a normal view, there is no reason left to be an xpath view and we
can move itw code directly into the inherited template.

That way, we can simplify the `website_sale_comparison.product_attributes_body`
template that was doing a cross xpath (inheriting `website_sale.product` but
xpathing a DOM element from `website_sale.product_attributes` which was also
inheriting `website_sale.product`).

Note that cross xpath was not working well with multi website but was fixed
with 410c07283b

Still, we should avoid doing cross xpath when possible (originally it was not
possible since the view was a customize_show) as it is hard to grep DOM element
to find possible breaking xpath when doing changes on DOM.
This is the reason of this commit.

closes odoo/odoo#29044
2018-11-26 16:52:40 +00:00
Richard Mathot 30791b59b3 [IMP] hr: allow to search employees per company
closes odoo/odoo#29053
2018-11-27 08:10:53 +00:00
Robot Odoo 7614eaf725 [IMP] stock location cleanup
Here we are cleaning some stuff in locations

closes odoo/odoo#28449
2018-11-27 13:24:26 +01:00
Pierre Masereel 0d6bcd3918 [IMP] stock: scrap location internal or inventory
We restrict the case of locations that can be scrap locations to
locations of usage internal or inventory loss, depending on how you want
to manage your scrap. Other usage of location shouldn't be scrap
locations.

TASK-ID: 38469
2018-11-27 11:05:56 +00:00
Pierre Masereel e0cac32bdc [IMP] stock: orderpoint only on internal and view location
We put a domain on location_id on order point to only allow to create
orderpoint on location of type 'view' or 'internal'.

TASK-ID: 38469
2018-11-27 11:05:55 +00:00
Pierre Masereel 5e42f46b87 [IMP] stock: warehouse view
We add the stock and view location in debug mode for warehouse form to
be able to check easily the warehouse configuration.

TASK-ID: 38469
2018-11-27 11:05:55 +00:00
Pierre Masereel 9775d4cce8 [FIX] stock: Don't allow to archive main locations of warehouse
When a location is archived, we are checking that it is not used a
warehouse stock or view location to avoid bad configration leading to
inconsistencies on stock available quantities.

TASK-ID: 38469
2018-11-27 11:05:55 +00:00
Pierre Masereel f3ad1e2bcb [REF] stock: remove confusing demo data
As configuring multiple vendor locations is a quite advanced case, that
need too change configuration on partners, and eventually routing, we
remove those demo data that can lead to misunderstanding the way vendor
locations works.

We've also adapted a test that was using those demo data

TASK-ID: 38469
2018-11-27 10:47:36 +00:00
Pierre Masereel 2062ac6dec [REF] stock: remove unsused field partner_id
The field partner_id on locations is not used in odoo, and can create
some confusion in odoo with the customer/supplier location you can set
on your partner and/or the owner_id you can set on your moves ans
quants. So we removed it.

TASK-ID: 38469
2018-11-27 10:47:36 +00:00
Pierre Masereel feb336a203 [REF] stock: remove unused location usage
The stock location usage 'procurement' is not used anymore in stock, and
we remove it as it is not used either for the stock and valuation of
stock.

TASK-ID: 38469
2018-11-27 10:47:36 +00:00
Darshil Trivedi e94477f746 [IMP] stock: Set company_id empty on sequnce of orderpoint.
Purpose : When we create order point in another company, it is not setting name ( sequence ).

After this commit it will use ( sequence ) in all company, as we not set company_id on the sequence of order point.

Task #1908526
Closes #28597
2018-11-27 08:46:16 +00:00
Pratima Gupta 5a2b38918a [IMP]stock_account: Prevent user to set same valuation account and IN/OUT accounts.
In this commit use the python constraint to check the accounts if they are duplicate.

This change is because before this configuration there will be an entry cancelling another one in the same account,
resulting in a not impacted valuation account.

This commit is related to task #1908065.

closes odoo/odoo#28604
2018-11-27 07:23:15 +00:00
Kirti Choudhary cca864f509 [FIX] product, point_of_sale, sale_management: Hide product sales tab
The sales tab is displayed on product form even if there are no modules
that need it are installed and no fields are displayed in it.

It has been introduced in this commit: https://github.com/odoo/odoo/commit/8e40fed7734793178e4b661a2b28a7f36f8ff626
that we revert and fix by adding an xpath in the point_of_sale module
that display the sales tab when point_of sale_module is installed (even
if sale module is not installed.

Task ID - 1893455

closes odoo/odoo#28176
2018-11-27 05:20:08 +00:00
Nimesh Jethva b0a6f3398d [IMP] *: add next activities on all modules
*: account, event, mrp, purchase_requisition, stock_landed_cost, stock_picking_batch

Add activity on below models:
account.payment
event.event
event.registration
mrp.workorder
purchase.requisition
stock.landed.cost
stock.picking.batch

Related Task ID : 1867620

closes odoo/odoo#26092
2018-11-26 12:28:19 +00:00
qsm-odoo 2dcd8c8566 [REF] web, *: review the assets helpers organization
* survey, website_slides

While not changing their name or their amount, this commit reorganizes
the assets helpers to:

Avoid all file duplicates in different helpers
----------------------------------------------

Before, we had to put some files in different helpers, like our
bootstrap mixin overrides which were in the _assets_utils template and
in the _assets_bootstrap template.

Enforce the use of an helper when using bootstrap
-------------------------------------------------

Bootstrap functions, variables and mixins are now out of the
_assets_bootstrap template, which now only contains bootstrap css rules
and our bootstrap fixes and extensions.

Allow using the correct bootstrap utils in all assets
-----------------------------------------------------

In some assets (especially editor ones), we may want to use bootstrap
variables even though bootstrap is not included in those. This worked
before but using *default* bootstrap variables. Now, our overrides can
be properly included if necessary.

Note: this commit may also be a first step to allow for backend
bootstrap and frontend bootstrap to co-exist.

closes odoo/odoo#28204
2018-11-26 12:23:09 +00:00
Robot Odoo 4173d4603e [IMP] stock: usability improvement
Description of the issue/feature this PR addresses:
- Task : https://www.odoo.com/web#id=1891230&action=333&active_id=131&model=project.task&view_type=form&menu_id=4720
- Pad : https://pad.odoo.com/p/r.c685147bff2284699d1933fb36e3fec3

Current behavior before PR:
- Usability MTO route

Desired behavior after PR is merged:
- Rename stock_location_route "Make to Order (MTO)" into "Replenish on Order (MTO)".
- The field responsible on the product should be empty by default and it shouldn't be required.
  If empty, the next activity should be assigned to the "system" (the admin)

--
I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr

closes odoo/odoo#27554
2018-11-26 15:01:17 +01:00
Haresh Shyara abcfa38f2c [IMP] stock: rename 'Make to Order (MTO)' into 'Replenish on Order (MTO)' 2018-11-26 12:24:13 +00:00
Haresh Shyara 93a33e603a [IMP] stock: removed require on responsible field
- when responsible field is empty on the product then next activity should be assigned to the system admin.

Task ID : 1891230
2018-11-26 12:24:13 +00:00
Darshil Trivedi fbcf6e86e0 [IMP] purchase : Rename date_approve label
This commit is related to task ID 1869130.

closes odoo/odoo#27018
2018-11-26 11:54:16 +00:00
Robot Odoo d2b83bbe8f [MERGE][IMP] mail, web: drag/drop files in conversations
This merge adds the support of drag/drop files in a conversation
(discuss, document chatter and chat windows).

It also adds helper functions to simulate drag/drop with files in test
environments.

Task-ID 32469

closes odoo/odoo#18914
2018-11-26 13:50:33 +01:00
Robot Odoo db0f80ee53 [IMP] repair, stock: views improvements
Display destination and source location on picking tree view
Order repair button with primary first in the list
Add the source document on stock move line view

Pad:https://pad.odoo.com/p/r.66fe9d8682b74783346d91b0fe7e3a87
Task:https://www.odoo.com/web?#id=1872294&action=333&active_id=131&model=project.task&view_type=form&menu_id=4720

Description of the issue/feature this PR addresses:

Current behavior before PR:

Desired behavior after PR is merged:

--
I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr

closes odoo/odoo#26380
2018-11-26 12:46:49 +01:00
Alexandre Kühn 6f8bb750f3 [ADD] mail:tests: discuss drag-and-drop file in composer
Task-ID 32469
2018-11-26 11:34:00 +00:00
Alexandre Kühn fb895f9119 [ADD] web:tests: test utils for drag/drop files
This commit adds test helper functions to drag and drop
files:

- `createFile`: create a file that can be used for drag and
  drop in tests.
- `dragoverFile`: to drag a file created from `createFile`
  over a DOM element.
- `dropFile`: to drop a file created from `createFile` on
  a DOM element.

These utility functions are available from `testUtils.file`.

Example of usage:

```js
var testUtils = require('web.test_utils');
testUtils.file.createFile({
	name: 'text.txt',
	content: 'hello, world',
	contentType: 'text/plain',
}).then(function (file) {
	testUtils.file.dragoverFile($el, file);
	testUtils.file.dropFile($el, file);
});
```
2018-11-26 11:34:00 +00:00
Dharmang Soni fb051d3420 [IMP] mail: Allowing drag/drop files/images on mail composer
By this commit user can upload attachments by drag and drop in chatter composer.
This feature can be used from discuss UI, chat windows and form view chatter.

Before this commit chatter unlinks the attachment if another attachment uploaded
with same name. Criteria for removing duplicate attachment is changed with this
commit. Now it will remove the attachment based on name and size of attachment.
The reason for this change is, when you upload image with same name from different
directory with old condition it was not possible to attach more then one image/file
of same name.

Related to task #32469
Closes #18914
2018-11-26 11:34:00 +00:00
Prakash Prajapati c5ce51168e [IMP] stock: Add the new field 'origin' in 'stock.move.line'
Useful to know for which SO the product is reserved

Task #1872294
Closes #26380
2018-11-26 10:40:41 +00:00