Commit Graph
117156 Commits
Author SHA1 Message Date
Nicolas Martinelli 54c2c08747 [FIX] account: initial balance
- Create manually an account move
- Add a line with a credit != 0
- Click on "Add a line" => crash

`line_ids` does not contain the credit since it was not filled in.

opw-782980
2017-11-17 10:09:05 +01:00
jem-odoo 7a951d7085 [FIX] sale: to invoice/invoiced amounts for delivered policy
This commits make the computation of amount to invoice
and amout already invoiced on sale order line works
with invoice policy based on delivered quantities.

Before this, the upselling of delivered quantities
was not working: you were seeing the upsell amount
in the amount to invoice (qty delivered > qty ordered).
Notes:
- When a product is not delivered (qty delivered = 0), its
amount to invoice is zero too
- Draft invoice are not take into account really; they are
included at sale order price (discount on draft invoice does
not impact amounts to invoice/invoiced)

Also, when a SO in state 'draft' or 'cancel', its amount
to invoice should be zero, but its invoiced amount should
take all validated invoices into account.

Finally, more correct trigger are set on the compute
method, to trigger recomputation on right moment.

This commit also compute the 2 amount fields as sudo, since
the amount should not be dependent of access right of current
user.

To check those different points, this commit provide some
more tests with ordered and delivered product, SO cancelling,
upselling or delivery, ...
2017-11-17 10:01:00 +01:00
jem-odoo 93aea80cdf [FIX] sale_timesheet: to invoice amount, take discount into account 2017-11-17 10:00:48 +01:00
Nicolas Martinelli 054477113f [FIX] mrp: missing field used in domain
opw-782997
2017-11-17 09:29:59 +01:00
Christophe Simonis a33e27b139 [FIX] website_sale: return sale.order object
Always return a `sale.order` object, otherwise calling method may crash
since they expect receiving such an object.

opw-761344

Manual forward-port of 0888602831 which has
been lost during normal one.
2017-11-16 18:22:03 +01:00
Nicolas Martinelli fe674f06c1 [FIX] event: with_context
Using `with_context({'use_babel': True})` overrides completely the
environment context. Therefore, the lang is lost and the date is
formatted in the default language.

opw-779753
2017-11-16 18:01:29 +01:00
Arnold Moyaux d279a3e6d5 [FIX] stock: adapt portal rights
After commit 996a817071
The portal report on picking only check if
the user has a 'read' access on picking.
If he can read it, sudo is called and thus
record rule/access right on component objects
are not necessary.

This commit removes useless rights for portal users.
2017-11-16 16:54:42 +01:00
Lucas Perais (lpe) 837bd78672 [FIX] point_of_sale: fix perms in posbox script
Before this commit, the posbox was built and in the process the permissions of the repo were whanged
As a result, there was a diff in the repo, making it un-upgradable

After this commit, the permissions on the posbox' Odoo repository are unchanged, and no diff is to be seen
2017-11-16 13:14:00 +01:00
Christophe Simonis a094f6318b [MERGE] forward port branch saas-16 up to 745d00362a 2017-11-16 12:40:36 +01:00
Cedric Snauwaert 5b10f5dbc1 [FIX] account: reconciliation of payment with statement should not take lock date into account
If we have a payment in october and a statement in november and the lock date is 1st november, we can't reconcile both because we try to write statement_id on payment but there is the lockdate constraint. This is not correct and we should be able to reconcile both even after lock date as it is the case for other moves.
2017-11-16 12:23:48 +01:00
Géry Debongnie 6e8faf40bd [FIX] pad_project: make it usable
The pad_project addon has a simple mission: allow the user to choose if
he wants to use pads in all tasks from a given project.

This is a noble goal, and the code actually works for projects which
have a 'use_pad' field set to true.  However, when a project has
'use_pad' set to false, we have a critical issue, due to the way the pad
widget works.

The pad widget is kind of strange, because it is set on a field which
contains the url for a pad, and it should write itself (the same value),
whenever someone writes on the pad, so the server knows it has to fetch
the result and write it on the 'real' field.  This means that the pad
widget has to write its value each time the user modifies the pad
content and press save.  However, fun fact, we have no way of knowing
when something was changed inside the pad iframe, so we actually save
the value each time the form view is saved.

So, we have a problem now: the description field AND the description_pad
field are always saved, and they interfere with each other.

In this commit, we put the description_pad in readonly mode when it is
invisible, so we do not save its value at all for each edit/save cycle
(and prevent interference).  It actually prevent calling the
generate_pad_url method, but a pad is still created by the server code
each time a task is created.
2017-11-16 12:20:31 +01:00
Géry Debongnie 672b403d05 [FIX] web: make sure modifiers works for async widgets
Before this commit, asynchronous field widgets (with willStart async),
with a non empty template had a problem: the invisible modifier was not
applied properly.

The reason is that the code that applied the modifiers was called
directly after the widget was 'willStarted'. This means that if this is
async, and if there is a template, the $el in willStart will be replaced
by another $el after, which will remove the invisible modifier.

This was an interesting problem with the pad widget (it is asynchronous
the first time a pad widget is instantiated)
2017-11-16 12:20:30 +01:00
Géry Debongnie 745d00362a [FIX] web: make sure modifiers works for async widgets
Before this commit, asynchronous field widgets (with willStart async),
with a non empty template had a problem: the invisible modifier was not
applied properly.

The reason is that the code that applied the modifiers was called
directly after the widget was 'willStarted'. This means that if this is
async, and if there is a template, the $el in willStart will be replaced
by another $el after, which will remove the invisible modifier.

This was an interesting problem with the pad widget (it is asynchronous
the first time a pad widget is instantiated)
2017-11-16 12:19:15 +01:00
Hardikgiri Goswami 797f0c1b6e [CLA] HardikG signs CLA
Closes #20984
2017-11-16 11:02:28 +01:00
Lucas Perais (lpe) b4ec51021b [FIX][BACKPORT] calendar: correct search in recurrent event
backporting 76b724294a

OPW 779208

closes #20996

original commit message:

Add a 3 use cases with tests that were failing before.

datetime filters were not working correctly on stop filters
The `_get_recurrent_date_by_event` was only computing recurrency on the start
field of an event which can make a difference. A recurring event
  start=2017-01-01 09:00:00; stop=2017-01-01 10:00:0
was not matched in a search ('stop', '>', '2017-01-01 09:30:00')

The filter != was not handled in the recurring use cases.
e.g. making the search 'start is set' in the web client is equal to
  ('start', '!=', False)

Searching with only a start filter matching recurring events but not the
first ("real") occurence, was returning no result if no stop filter was present.
  start=2017-01-01 09:00:00; count=5
had no result in a search ('start', '>', '2017-01-02')
2017-11-16 10:39:32 +01:00
Goffin Simon 840e260794 [FIX] account: Due date of a paid invoice should not be editable
Due date of a paid invoice should not be editable when the state of the invoice
is "paid".

opw:782560
2017-11-16 09:40:40 +01:00
Nicolas Martinelli 7931506434 [FIX] hr_payroll: deprecated menu
The tree view has been removed, so the menu is simply deprecated.

opw-781261
2017-11-16 09:37:13 +01:00
Martin Trigaux 58375c99f2 [I18N] export source terms
Follow uup of 6e4d2e36aa
2017-11-16 09:24:37 +01:00
Laurent Smet 9785f8bbed [FIX] account: fix migrate_tags_on_taxes not working on multi-company
-opw: see PR https://github.com/odoo/odoo/pull/20792
2017-11-16 09:11:03 +01:00
Nicolas Lempereur 6e4d2e36aa [FIX] base_setup,etcie: translate left setting menu
In left menu used for switching between "apps" particular menu, the
apps names were not translated.

This commit use the "string" attribute which is translated instead of
"data-string" fallbacking on data-string (so things still work without
updating the module).

opw-781728
closes #20972
2017-11-16 07:51:17 +01:00
Christophe Simonis a226f415f2 [FIX] account: add missing import 2017-11-15 17:55:33 +01:00
Laurent Smet 676ae771a6 [FIX] l10n_nl: add 'product' and 'dienst' tags
Was PR #20955. Issue 781690
2017-11-15 16:52:47 +01:00
Christophe Simonis 5877b7b38c [MERGE] forward port branch saas-15 up to 73e4dacf78 2017-11-15 15:50:36 +01:00
Christophe Simonis 73e4dacf78 [MERGE] forward port branch saas-14 up to 0bf7ab4511 2017-11-15 15:20:52 +01:00
eLBati d8e49d3886 [FIX] purchase: add missing multi company record rule
Apply an inter-company rule for the purchase.report

opw:779192
2017-11-15 14:54:28 +01:00
Christophe Simonis 0bf7ab4511 [MERGE] forward port branch 10.0 up to 0fe7989e24 2017-11-15 14:50:46 +01:00
Lucas Perais (lpe) f5004154a2 [FIX ]point_of_sale: hardcode jessie in posbox scripts
Before this commit, the latest version of Raspbian was chosen.
It is not very helpful though as if something goes wrong, we don't on which part it is.

Also, fix python dependencies for the image
2017-11-15 14:42:16 +01:00
Nicolas Martinelli 0fe7989e24 [FIX] stock: warning on move
The warning should be a dictionary, not a string.

opw-781880
2017-11-15 14:08:42 +01:00
Pierre Masereel 4dc670bc81 [FIX] stock: uom field on production lot not readonly
Because the uom field on production lot is a related field of
product.prodcut, we shouldn't change the uom of a product through the
production lot formé
2017-11-15 13:58:46 +01:00
Géry Debongnie 6158c5ce04 [FIX] web: fix issue with combination of o2m, m2m, and m2o
Consider this: a form view with a one2many list view. In the one2many
list view, there is a many2one field.  When opening the manyone in a
modal form view, there is a many2many field.  In that situation,
clicking on 'Add a new record' on the many2many field had the
unfortunate effect of interfering with the one2many field in the main
form view, which caused a crash or the modal form view to close
unexpectedly.

The issue is that an event was simply not properly stopped at the proper
location.  This is usually not a big deal, but, as described above, it can be
a problem in some cases.
2017-11-15 13:48:49 +01:00
Nicolas Martinelli 4b92f914de [FIX] base: make currency visible
Make company currency field visible again on the company settings.
Indeed, if Account is not installed, it's impossible to change it.
2017-11-15 13:45:03 +01:00
Christophe Simonis 00e309ed91 [MERGE] forward port branch 9.0 up to 5297321207 2017-11-15 13:39:31 +01:00
tbe-odoo 822078d16e [FIX] stripe: Fix crash when using language not defined
- This commit, fixes a crash triggered when the user is paying a quote while having his browser language set to a language not defined on the Odoo database.
This is due to the fact that the field 'name' on the model 'account.analytic.account' is translatable.
Stripe sends a json query to the server with the user's browser's language on the 'Accept-Language' http header field.
By doing this, Odoo add a 'lang' key to the context, which is then used to translate translatable fields.
2017-11-15 13:31:00 +01:00
Nicolas Martinelli 8a7426da75 [FIX] account: tax amount on invoice document
- Install French language
- Set language of Customer A to French
- Create an invoice for A (some tax must be applied)
- Print the invoice

The tax amount below 'Subtotal' is not formatted in French.

`t-esc` does make use of the `t-lang` option, so when the expression is
evaluated, the lang is not in the context. We do not change this
behavior since it can have a major impact.

opw-782118
2017-11-15 12:57:19 +01:00
Nicolas Martinelli a9beee42d6 [FIX] tools: lang in formatLang
- Install French language
- Set language of Customer A to French
- Create an invoice due in the past
- Open the Customer Statements

The customer statement of A is translated in French, but the amounts are
formatted in the company's user language (English by default).

We add the possiblity to take into account the lang in the context when
calling `formatLang`.
2017-11-15 12:57:19 +01:00
Romain Derie 86e79881e8 [FIX] website: use underscore's startsWith method for browser support
Since ES6's startsWith method is not supported by all/old browser, replace it
with underscore's one
2017-11-15 12:56:02 +01:00
Romain Derie 5297321207 [FIX] website_sale: 0.00 total is showing in empty cart if logged in
Before this commit, if you go on /shop/cart and your cart is empty, it will
show the total (Subtotal, Taxes, Total) as $ 0.00.
Indeed, the code is retrieving a 'sale.order' if you are connected and you
already have a draft sale order on DB (eg: you just add something to cart and
 emptied it afterward).

  - Add product to your cart and proceed to checkout
  - On checkout cart, remove the product, your cart is now empty
  - Reload the page (you should still be on /shop/cart) or go to /shop/cart
  - You now see the zero prices (Subtotal, Taxes, Total)

Now, we will hide this if you have an order but no line on that order.

This closes #20896
2017-11-15 12:45:41 +01:00
Roberto Lizana 1db3829540 [CLA] Trey signs CCLA
Closes #20958
2017-11-15 11:28:41 +01:00
Christophe Simonis 0a775adda8 [MERGE] forward port branch 9.0 up to b152c5be4f 2017-11-15 11:25:18 +01:00
qsm-odoo 4e32a23d96 [FIX] web_editor: restore selected images display
In the media dialog, when an image is selected, it has a colored border
to indicate it. Commit https://github.com/odoo/odoo/commit/e011d58bee140411ccfb1ef9115dddc090d573c3
made changes, part of them designed to "Improve the image dialog to be
able to select/unselect". While this commit was indeed doing that, it
was also breaking stuff: when selecting image(s) then performing a
search, the colored border disappeared while the images were in fact
still selected.

Fortunately, this stuff breaking is only due to code modification that
was made for no reason (so reverting part of the commit is enough to
restore the features while keeping the commit's improvements).
2017-11-15 10:59:49 +01:00
Yenthe V.G dfa554ba7d [IMP] doc: Improve mobile documentation (#20940)
* [IMP] Doc: improve the documentation

This makes the documentation more readable, makes cleaner sentences and removes the random capital letters within the sentences.

* [IMP] doc: make the info of switchAccount as clear as possible

* [IMP] doc: Make requested changes
2017-11-15 07:59:05 +01:00
Goffin Simon 661dab1ed6 [FIX] product: Keep the stable behavior
Revert of this commit: 7f989b94b0
because it changes the behavior in stable version.

opw:779808
2017-11-14 22:35:57 +01:00
Simon Lejeune 79821458fa [REF] stock: wording on view location constraint 2017-11-14 17:44:15 +01:00
Simon Lejeune 217661ab7f [FIX] stock_account: always compute FIFO no matter the cost method
This is to ease the change of cost method.

opw 779284
2017-11-14 17:44:15 +01:00
Simon Lejeune c6c802aac6 [FIX] purchase: kit and unit price
When buying a kit, the components should not get their unit price on the
kit. By doing this patch + a previous that set the unit_price on the
move as copy False, it'll take the standard price.
2017-11-14 17:44:15 +01:00
Simon Lejeune 99b9874ab3 [FIX] mrp, purchase_mrp: purchase_line_id also with kits
When confirming a move for a kit, it is basically unlinked and replaced
by moves for its component. The link to the purchase line was kept in
v10, but since rev[1] it is not anymore. Make an helper to get the
values and override it in purchase_mrp to add the purchase line link.

[1] https://github.com/odoo/odoo/commit/8248f0e153ae5fcc1449d0d05149b61df615ad4f

opw 779497
2017-11-14 17:44:15 +01:00
Simon Lejeune a4740861d3 [FIX] stock, stock_account: return
A return should be valued at the standard price. As the `price_unit`
field is not set as copy=False and a return move is a copy of the
original move, the valuation was wrong.

opw 779803
2017-11-14 17:44:09 +01:00
Simon Lejeune 7a4ab354be [FIX] stock_account: in or out move consideration
Only looking on the stock move to determine if a move should create
accounting entries is not enough: it is possible that sublocations
implement some strategies that impact the valuation (example: a move
between stock and stock where the move lines move things to a scrapped
location).

We now look on the move line and if any of the move lines is IN, the move
is IN, if any of the move line is OUT, the move is OUT, if there's a
mix, the move is invalid.
2017-11-14 17:39:08 +01:00
Simon Lejeune 48f4ce4afa [FIX] stock_account: the quantity to value depends on the sublocations
We can imagine a scenario into which the main stock location (wh/stock)
is set as a view location to force people to put things in the
sublocations. Since the stock_account refactoring, only the location of
the stock move is considered to know if the locations should be valued
and, if so, the quantity to value. It is problematic since a view
location shouldn't be valued, but if its move lines put or take things
to or from a valued location to a non valued one, the valuation
mechanism should run.

We now introduce these specifications to handle this kind of usecase
correctly:
- the authority to get the price_unit is on the stock move
- the authority to now how much quantity should be valued is delegated
  to the move lines.
2017-11-14 17:36:52 +01:00
Simon Lejeune 20c19560cd [FIX] stock_account: to value or not to value
The initial condition was too naive, it only checked the presence of
company_id on the concerned locations. This is problematic because
people need to create, for instance, multile inventory loss locations
once they have multiple companies, as the accounts set on the locations
are not property fields.

We also use the same condition to determine if the move is IN or OUT on
the move valuation mechanism and the accounting entries creation
mechanism.
2017-11-14 17:26:37 +01:00