Commit Graph
1933 Commits
Author SHA1 Message Date
Louis (wil) 3f6f949fa5 [I18N] export sources
closes odoo/odoo#140002

Related: odoo/enterprise#49687
Signed-off-by: Louis Wicket (wil) <wil@odoo.com>
2023-10-27 08:36:16 +00:00
Walid 74497136cc [FIX] purchase_requisition: correct sequence according to company
Step to reproduce:
- Create company specific sequences for purchase agreements.
- Create a purchase agreement for Chicago company
- Select both comapanies for current user and switch to San francisco
- Confirm the call for tender

Bug:
sequence from San francisco is applied since ir.sequence takes current
company by default

Fix:
for company specific purchase agreements apply their own companies sequence

opw-3505571

closes odoo/odoo#139310

X-original-commit: 1e7625bb132909b892311a0da3bac9585217bd8c
Signed-off-by: Adrien Widart (awt) <awt@odoo.com>
Signed-off-by: Walid Hanniche (waha) <waha@odoo.com>
2023-10-20 18:06:40 +00:00
Xavier Bol (xbo) 6d195397e4 [IMP] stock,purchase_requisiton: remove some warning messages
This commit removes some warning messages displayed in some wizard and
removes the fields used to display or not those warning
messages.

task-3356114

closes odoo/odoo#124820

Related: odoo/upgrade#4899
Related: odoo/enterprise#42472
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
2023-10-10 12:34:56 +00:00
Kartik ChavdaandKamlesh Pathekar e3bc974ea4 [IMP] base,** : make error message user friendly
Before this commit error messages in odoo are boring and
not much attractive to user. Those were like odoo is preventing
them from doing something user want to do.

In this commit, we have modified the message to be a more friendly
and humorous tone, making it less tedious and more enjoyable. It
aims to enhance the user experience and ensure that interactions
with any application are both pleasant and informative. As a result,
the messages have been clear, short, easy to understand and informative.

task-3356114

Part-of: odoo/odoo#124820
Co-authored-by: Kamlesh Pathekar <kpt@odoo.com>
2023-10-10 12:34:56 +00:00
Djamel Touati ad253ef4c2 [FIX] purchase: set the correct price in alternative PO
Steps to reproduce the bug:
- Create a storable product “P1”:
    - Price at “Wood corner”:
        - $5, min qty =1
    - Price at “Open wood:
        - $6, min qty = 1
        - $4, min qty = 10

- Create a purchase order at wood corner:
    - 100 units
> the price is automatically computed at $500

- Go to Alternative tab in the PO:
   - Create a one for “Openwood” and copy lines

Problem:
The price for 100 units is computed as $600 instead of $400.

When we create the alternative purchase order, in the "create" function
of “purchase.order.line,” we receive only the quantity as "qty=100" in
the values. Therefore, the missing fields should be prepared.

https://github.com/odoo/odoo/blob/a9cbd2a2ae2e21f1ba14379aecd908c44497b8ab/addons/purchase/models/purchase.py#L1102

https://github.com/odoo/odoo/blob/a9cbd2a2ae2e21f1ba14379aecd908c44497b8ab/addons/purchase/models/purchase.py#L1102

First, the line is created with the received values (“qty=100”), and
the price_unit is computed correctly as $4.

https://github.com/odoo/odoo/blob/a9cbd2a2ae2e21f1ba14379aecd908c44497b8ab/addons/purchase/models/purchase.py#L1400

So, the price_unit is computed correctly at $4

However, the “onchange_product_id” function is then called, resetting
the price_unit and product_qty to 0.

https://github.com/odoo/odoo/blob/a9cbd2a2ae2e21f1ba14379aecd908c44497b8ab/addons/purchase/models/purchase.py#L1401

https://github.com/odoo/odoo/blob/a9cbd2a2ae2e21f1ba14379aecd908c44497b8ab/addons/purchase/models/purchase.py#L1176

Afterward, the “_suggest_quantity()” function is called

https://github.com/odoo/odoo/blob/a9cbd2a2ae2e21f1ba14379aecd908c44497b8ab/addons/purchase/models/purchase.py#L1180

suggesting a minimal quantity based on the seller (so=1).

https://github.com/odoo/odoo/blob/a9cbd2a2ae2e21f1ba14379aecd908c44497b8ab/addons/purchase/models/purchase.py#L1363

Therefore, the price_unit is computed based on qty=1, resulting in $6.

Finally, the price is returned because it is the only missing field.

opw-3497825

closes odoo/odoo#137774

X-original-commit: 0781198f1b5e5d6a4e2722ea3c663b74fb131bc3
Signed-off-by: Djamel Touati (otd) <otd@odoo.com>
2023-10-06 07:12:13 +00:00
Touati Djamel (otd) 6af53f5f48 [FIX] purchase_requisition: convert purchase price to current currency
Bug introduced in:
https://github.com/odoo/odoo/pull/128327/commits/8f96e08985ebac3309745f1036a5e83d287e6382

Steps to reproduce the bug:
- Activate 2 currencies (assume EUR and USD, conversion
   rate: 0.65 EUR = 1 USD)
- Create new product “P1”:
    - Purchase tab:
        - add two vendors:
- Vendor_USD, currency = USD, price = 100
- Vendor_EUR, currency = EUR, price = 80
 - Create PO:
    - vendor = vendor_EUR
    - Currency = Eur
    - Add P1, Unit price should be 80

- Alternative tab > Create alternative > Vendor = Vendor_EUR
- Compare product lines Issue: The line with price = 100 USD is
 highlighted as being the cheapest option, but if we apply conversion
 rules, 80 EUR = 123,07 USD > 100 USD.

Solution:
Before selecting the cheapest line, we convert the prices of the
purchase order lines that are in a currency other than the current
currency of the company.

opw-3378253

closes odoo/odoo#137642

X-original-commit: c45272828ee85bc23dd97dc93dc741f8f59a5305
Signed-off-by: Tiffany Chang (tic) <tic@odoo.com>
Signed-off-by: Djamel Touati (otd) <otd@odoo.com>
2023-10-05 15:36:26 +00:00
Jorge Pinna Puissant ef424a9dc2 [REF] *: remove owl from linter's accepted global variables
Before this commit, owl was in the linter's accepted global variables.
This allowed  direct access to owl global object.

For instance, to use xml from owl, you could do :
`const { xml } = owl;`
or you could use it directly:
`owl.xml`

Now, owl is not accepted on linter's global variables anymore, so to
import xml, now you need to use a proper import:

`import { xml } from "@odoo/owl";`

task-id 3498859

closes odoo/odoo#137517

Related: odoo/enterprise#48364
Related: odoo/design-themes#709
Signed-off-by: Samuel Degueldre (sad) <sad@odoo.com>
2023-10-05 10:21:53 +00:00
Paweł Fertyk d747d66646 [IMP] purchase_requisition: improve "Alternative Warning" popup
Changes applied also to "Alternatives" tab in RfQ.

Task: 3290154
Part-of: odoo/odoo#122511
2023-09-28 10:22:03 +00:00
Paweł Fertyk db26958ae4 [IMP] purchase_requisition: put "Vendor" first in Blanket Order
Task: 3290154
Part-of: odoo/odoo#122511
2023-09-28 10:22:02 +00:00
Valentin Vallaeys (vava) f8d351aa43 [FIX] *: fix domain definition (not) in operator
* account, account_peppol, purchase_requisition, stock_delivery, base

There are some conditions in xml that uses `in` or `not in` for a check
with a string. These are replaced by `==` or `!=` operators,
respectively.

closes odoo/odoo#132798

Signed-off-by: Rémy Voet (ryv) <ryv@odoo.com>
2023-08-25 13:58:46 +02:00
Hubert Van de Walle (huvw) 1076dbdd58 [FIX] purchase_requisition: add missing date_planned computation
Steps to reproduce
==================

- Create a blanket order
- Choose a vendor
- Add a product P
- Set a price
- Save and Confirm
- Click on the RFQs/Orders smart button
- Create a new RFQ
- Delete the line
- Add a new line with the same product P
- Save

-> A validation error appears because the date_planned is not set

Cause of the issue
==================

`_compute_price_unit_and_date_planned_and_name` is overriden and passes
an empty recordset to the super method.

Solution
========

We can compute the `date_planned` using the selected seller

opw-3416573

closes odoo/odoo#132428

X-original-commit: d7db1d799fe042ef248968c6dee53eaf6e0ed3db
Signed-off-by: Tiffany Chang (tic) <tic@odoo.com>
2023-08-21 12:39:47 +02:00
Gorash 774a3fad0e [REF] base,all: Update modifier syntax: view migration
Apply of the migration script to update all view modifiers.

Part-of: odoo/odoo#104741
2023-08-18 09:49:13 +02:00
Gorash 75a105f46a [REF] base/all: Update modifier syntax: remove 'states' from fields
These changes are made as a result of simplifying attrs and 'states' in
views. However, they should have remained in a separate commit. When
applying the script making the xml changes (used later for the migration
script), the script checked the definition of the python fields in order
to convert the information into a python expression. Therefore, this
commit is not applied when the script is applied to xml changes.

During this attribute deletion pre-existing errors were found. Part of
the code was using the boolean values of 'states' and another part of
the code was not. The behavior could therefore be different (in cases
where readonly on the field had the same value as the ballan in
'states').

Following the deletion of 'states' and without the application of the
view migration, the js tests (tower) were no longer functional. Tests
using the Form view suffered the same effect. There are few tests that
had to be adapted, including two tests in business accounting (updated
by the accounting team). A test for column_invisible did not work. Test
checking if the test system triggers an error if we try to write on an
invisible field. It turns out that Form was testing on the value of
invisible but not taking into account if the column was invisible. The
test system fix is applied separately because there were a lot of tests
that were incorrect.

Part-of: odoo/odoo#104741
2023-08-18 09:49:11 +02:00
Arnold Moyaux 9c8a9991eb [FIX] stock,mrp,purchase: remove demo right
Before [1] the demo user only has the basic right. Now it has
the administrator rights and it prevent an easy testing for user
flow.

The demo and admin users get their rights from the common
template with administrator right everywhere. Since it's a
data, we could just remove the administrator level and set
the user level in the demo data.

[1] commit 121cd0d608

X-original-commit: 7b7fdf5d4eb892bfd3c2fdb575264025dca21ca5
Part-of: odoo/odoo#131707
2023-08-14 13:41:54 +02:00
Arnold Moyaux 9f6ea16943 [FIX] purchase_requisition: Fix failing test
During the test, the rate are created on UTC timezone.
However the test could be run with a different timezone.

Since the rate doens't have a name, by default they have the
create date name. However due to timezone difference, it could
be different day and the newly created rate for the test will be
filter out

closes odoo/odoo#131708

X-original-commit: 300fe8ad36163b6ad7f8a37ac26b014c1510d64f
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
2023-08-11 15:53:04 +02:00
Jorge Pinna Puissant e338487028 [REF] *: remove owl="1" from the templates
As all the templates are now imported in the owl app, there is not need
anymore to specify the owl="1" attribute in the templates.

Part of task~3443861

Part-of: odoo/odoo#130467
2023-08-11 14:32:30 +02:00
Saran440 7cda37b7a4 [FIX] purchase_requisition: pass default currency for list created rfq
Issue:
The currency in the RFQ created from the list created RFQ on the Purchase Agreement is incorrect.

Steps to reproduce:
- Install Purchase Agreement
- Config multi currency
- Create a Purchase Agreement with multi currency (difference main currency) > Confirm
- Click smart button RFQs/Orders > Create
- RFQ will default currency is main currency

Fix:
Add a context on button `action_purchase_requisition_list` to default currency

closes odoo/odoo#131489

X-original-commit: ff001848a2e4906dbf5401508cc0ff2185265eac
Signed-off-by: Tiffany Chang <tic@odoo.com>
2023-08-10 10:39:30 +02:00
stcc-odoo 5618236ce2 [FIX] purchase_requisition: fix multicurrency alternative
Steps to reproduce:

- Activate 2 currencies (assume EUR and USD, conversion rate: 1 EUR = 0.9 USD)
- Create new product P
	- Purchase tab, add two vendors
	- V_USD, currency = USD, price = 100
	- V_EUR, currency = EUR, price = 101
- Create PO, vendor = V_USD, Currency = USD
- Add P, Unit price should be 100
- Alternative tab > Create alternative > Vendor = V_EUR
- Compare product lines

Issue:

The line with price = 100 USD is highlighted as being the cheapest option, but if we apply conversion rules,
101 EUR = 90.9 USD < 100 USD.

Solution:

Convert prices in company currency before comparing.

opw-3378253

closes odoo/odoo#129984

X-original-commit: 8e53914362eaf29675051e157dbcfdbfbdec88da
Signed-off-by: Tiffany Chang <tic@odoo.com>
2023-07-28 16:29:11 +02:00
Louis Wicket (wil) 7da30c7d14 [FIX] mail, *: fix grammar error in field help
This commit fixes a really old grammar error in the help message of the
message_needaction_counter field.

Before this commit: “Number of messages which requires an action”
After: “Number of messages requiring action”

The subject of “require” is “messages”, which is third-person plural, so
it can't take the -s suffix.

closes odoo/odoo#129468

X-original-commit: 0d10cfeaa56d5df23df05f436d353978043f4a71
Related: odoo/enterprise#44509
Signed-off-by: Louis Wicket (wil) <wil@odoo.com>
2023-07-25 17:36:08 +02:00
218ad8456a [REF] *: adapt codebase to new RelationalModel
This commit adapts the code in addons w.r.t. the introduction of
the RelationalModel.

Main changes that were requested are:
 - record datapoints no longer always have an "id" key in their
 data (they still do if the id field is in the view), so we use
 record.resId instead
 - the new model is based on fined-grained reactivity, so several
 components that previously relied on onWillUpdateProps to update
 their internal state no longer worked. Typically, using the hook
 "observeRecord" is the way to go now.
 - specialdata are no longer handled in the model, so the components
 needing specialData can use the hook "useSpecialData"
 - more generally, all overrides of models (RelationalModel or
 KanbanModel) needed to be reworked.

Part of task~3179751

Part-of: odoo/odoo#114024
Co-authored-by: Aaron Bohy <aab@odoo.com>
Co-authored-by: FrancoisGe <fge@odoo.com>
Co-authored-by: Jorge Pinna Puissant <jpp@odoo.com>
Co-authored-by: Pierre Rousseau <pro@odoo.com>
2023-07-24 20:17:50 +02:00
clesgow d331fa21e4 [FIX] purchase_requisition: Add missing data on report
On the Blanket Order PDF (as well as other purchase agreements), the
vendor isn't specified on the report while it is a required and
significative field on the purchase agreement.
Added it like in the purchase order PDF.

Also added in the Custom Description field into the PDF as it may
contain useful information as well.

Task-3358385

closes odoo/odoo#126561

X-original-commit: 926c6b4aa34c7df46de3121c97742caccbc39be2
Signed-off-by: Arnold Moyaux (arm) <arm@odoo.com>
Signed-off-by: Quentin Wolfs (quwo) <quwo@odoo.com>
2023-06-28 17:41:53 +02:00
Mahdi Cheikh Rouhou (macr) 297cf7c7ea [FIX] purchase_requisition : prevent creating purchase agreement from PO form
When you create a purchase agreement from the from view of a purchase order , it can have some invalid states which may lead to not having a vendor too.
Since choosing a purchase agreement makes the vendor read only on the PO form , then it may lead to having a PO form without a vendor and can't update it.

Steps to reproduce the error :
1- activate blanked orders
2- create a new purchase order directly from the PO form

opw-3335891

closes odoo/odoo#124528

X-original-commit: 100187e904b85306a7823c54adb78f493abacf78
Signed-off-by: Tiffany Chang <tic@odoo.com>
Signed-off-by: Mahdi Cheikh Rouhou (macr) <macr@odoo.com>
2023-06-12 11:22:07 +02:00
JF Aubert 1bd1b5018b [FIX] purchase_requisition: make report translatable
Allow printing of the purchase requisition in the vendor's language.

closes odoo/odoo#123256

Opw: 3277229
Signed-off-by: Tiffany Chang <tic@odoo.com>
2023-06-05 13:31:43 +02:00
Martin Trigaux 2afdda2576 [I18N] *: export saas-16.3 source terms
closes odoo/odoo#123046

X-original-commit: 137f5ca0cb703ee953cb01db525362f7a778e6bd
Related: odoo/enterprise#41703
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2023-06-01 11:43:51 +02:00
Saran440 e2533a85e8 [FIX] purchase_requisition: default representative from Agreement tto RFQ
closes odoo/odoo#122648

X-original-commit: 479a3354a119c36f5e02b2ab049c276cc2a60503
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
2023-05-26 16:16:04 +02:00
Louis Wicket (wil) 04189318cc [I18N] *: update master translations
Currently, only stable releases see their translations updated. This has
resulted in master accumulating outdated stuff for years, which can be
confusing for users testing master on runbot.

This one-shot commit resynchronizes master translations based on the
content from 16.0 and removes empty PO files (i.e. no longer containing
translations).

closes odoo/odoo#121629

Related: odoo/enterprise#41171
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2023-05-22 17:52:07 +02:00
Martin Trigaux 077bbd0b0b [I18N] *: export master source terms
closes odoo/odoo#121563

Related: odoo/enterprise#41140
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2023-05-17 10:34:00 +02:00
Elisabeth Dickinson b2ef35a431 [IMP] *: replace .bg-color by .text-bg-color on ribbons
Also remove unnecessary CSS on ribbons.

Part-of: odoo/odoo#116641
2023-05-12 22:59:16 +02:00
clesgow 08ae8609c9 [IMP] purchase_requisition: set RFQ origins for alternatives
When creating an alternative RFQ, set the source document of the
original RFQ as source document of the newly created alternative.

Part of task-3218314

Part-of: odoo/odoo#119381
2023-05-09 21:04:01 +02:00
clesgow 2a6f1e32f5 [IMP] purchase_requisition: unlock blanket orders custom descriptions
It should be possible to modify the custom description of a Blanket
Order line without having to reset it to draft to do so.

Part of task-3218314

Part-of: odoo/odoo#119381
2023-05-09 21:04:01 +02:00
Touati Djamel (otd) f23d0fedfa [FIX] purchase: compute the price with correct UoM in PO alternative
Steps to reproduce the bug:
- install the `purchase_requisition` module
- Create a storable product “P1”:
    - UoM: unit
    - cost: 10
- Create a PO:
    - Add 1 unit of “P1”:
        - Change the UoM from unit to Dozen
        - the unit price will be updated from 10 to 120
     - Save the PO
- Create a Po alternative

Problem:
The “Unit of measure” is correctly copied, but the unit price is wrongly
computed “10” instead of 120.

When creating the PO alternative, we copy the uom of the original
lines in the vals:
https://github.com/odoo/odoo/blob/4c2163d2b195a0c829d4e24a7afc3347e7c3401a/addons/purchase_requisition/wizard/purchase_requisition_create_alternative.py#L84

then, The line is created with the correct UoM, but we force the call
to `onchange_product_id`:
https://github.com/odoo/odoo/blob/c677f45dcb050ce7e6f755b71e56c9b9120bf613/addons/purchase/models/purchase.py#L1371-L1372

So `_product_id_change` will be called:
https://github.com/odoo/odoo/blob/c677f45dcb050ce7e6f755b71e56c9b9120bf613/addons/purchase/models/purchase.py#L1163

And the product UoM “Unit” will be set in the `purchase.order.line`:
https://github.com/odoo/odoo/blob/c677f45dcb050ce7e6f755b71e56c9b9120bf613/addons/purchase/models/purchase.py#L1171

Therefore, the unit price will be calculated with Unit instead of dozen:
https://github.com/odoo/odoo/blob/c677f45dcb050ce7e6f755b71e56c9b9120bf613/addons/purchase/models/purchase.py#L1225

Solution:
We have to ensure that the values only created by onchanges and not
provided during the alternative PO creation are still created via the
`onchange_product_id`. Therefore we avoid the incorrect uom reassignment
during the calculation of the unit price when creation is from an alt
PO creation with uom included.

closes odoo/odoo#117808

X-original-commit: 93769b9b51196c0aed74fc74cca1fcacdc59f789
Signed-off-by: Tiffany Chang <tic@odoo.com>
Signed-off-by: Djamel Touati (otd) <otd@odoo.com>
2023-04-05 17:31:55 +02:00
Saran440 afcf0fba8d [FIX] purchase: default currency from context
closes odoo/odoo#116238

X-original-commit: ba6f90c2d664b7cef7f7ecd619b763ad6fe2138b
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
2023-03-23 12:14:51 +01:00
Martin Trigaux 1be5eae8ef [I18N] *: remove nl_BE files
They dates from < 2027 and are quite outdated. Favour the nl
translation instead.
n_BE is not on Transifex so it was not possible to correct bad
translations.

closes odoo/odoo#115845

X-original-commit: d04c8b7e484db8306d858c891a7a2b11885fdcd9
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2023-03-20 16:51:30 +01:00
Touati Djamel (otd) f7abd3b960 [FIX] purchase_requisition: create alternative PO without requisition_id
Steps to reproduce the bug:
- Create a blanket order:
    - add any storable product
    - Confirm
    - Click on new quotation
- Create an alternative purchase order from the new PO

Problem:
A user error is triggered, because the “date_planned” is not set in the
`purchase.order.line`:
"The operation cannot be completed: Missing required fields on
accountable purchase order line."

The `default_requisition_id` is set in the context, so the alternative
purchase order is created with the `requisition_id` field set, and in
the compute override `_compute_price_unit_and_date_planned_and_name`:
https://github.com/odoo/odoo/blob/863c5090f09bfffc2867717ed8b3c99b05a5eb9c/addons/purchase_requisition/models/purchase.py#L119-L120

we don't set the `date_planned` and don't call the super compute with
this record, therefore the `date_planned` is not set:

https://github.com/odoo/odoo/blob/863c5090f09bfffc2867717ed8b3c99b05a5eb9c/addons/purchase_requisition/models/purchase.py#L132

https://github.com/odoo/odoo/blob/863c5090f09bfffc2867717ed8b3c99b05a5eb9c/addons/purchase/models/purchase.py#L1209-L1210

opw-3217377

closes odoo/odoo#115596

X-original-commit: 831ebe11c45e59c16a43051889512dc14fa75eb1
Signed-off-by: Tiffany Chang <tic@odoo.com>
Signed-off-by: Djamel Touati (otd) <otd@odoo.com>
2023-03-17 11:47:24 +01:00
Touati Djamel (otd) 934d9a5caa [FIX] purchase_requisition: create a PO alternative with note & section
Steps to reproduce the bug:
- Create a PO:
    - Add a product
    - Add a note or section
- Go To Alternatives:
    - Click on “Create Alternative”
         - Add another vendor
         - Try to validate

Problem:
An error is triggered: “The operation cannot be completed: Description
(name) is mandatory”

The “display_type” and “name” fields must be copied in the vals to
create a `purchase.order.line`

opw-3164863

closes odoo/odoo#115070

X-original-commit: 66f806399d173f53b61db80b81d06a93421c75a3
Signed-off-by: Tiffany Chang <tic@odoo.com>
Signed-off-by: Djamel Touati (otd) <otd@odoo.com>
2023-03-13 15:28:01 +01:00
Victor Feyens 24ccf7d9b0 [CLN] *: useless type info for actions
The type fields of actions already defaults to
the model name in the base model definition.

Therefore, specifying `ir.actions.server`, `ir.actions.act_window`
& so on as type is useless (and adds noise since it's the same as
the action model).

closes odoo/odoo#114539

Related: odoo/enterprise#37855
Signed-off-by: Julien Castiaux (juc) <juc@odoo.com>
2023-03-08 17:33:37 +01:00
FrancoisGe 17a24020ac [REF] *: do not use activeFields in Field components
This commit is to replace all uses of activeFields in Field components
by passing fieldInfos to extractProps. We will therefore retrieve the
node-dependent information in the extractProps function.

Why?
This ensures that the info used is that of the correct node. Because the
activeFields function contains the information from the last node that
referred to the same field.

Example:
<tree>
    <field name="a"/>
    <field name="a" context='{'b':"yop"}'/>
</tree>

For the first field:
    FieldInfo.context = {}
    activeField.context = {'b':"yop"}

For the second field:
    FieldInfo.context =  {'b':"yop"}
    activeField.context = {'b':"yop"}

Part of task: 3179751

closes odoo/odoo#113874

Related: odoo/enterprise#37621
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-03-06 15:18:48 +01:00
Michael (mcm) 9f4622492c [REF] *: register field descriptors instead of components
Before this commit, the field's description was stored on the
component and this component was then registered.

Now, an object describing the field is used on registration the same way
as it is done for views since https://github.com/odoo/odoo/commit/b828cfc72c587d0b73fcc5459695705640437671.
This split the component's description (props, template, ...) of
the field's description (displayName, supportedTypes, ...) and makes
it clearer.

closes odoo/odoo#112498

Task: 3171520
Related: odoo/enterprise#37105
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-02-16 14:13:32 +01:00
svs-odoo 4dd3104b96 [IMP] product_expiry,purchase_requisition,stock*: visual changes
- The `picking_type_id` field in the pickings form view is not openable;

- Display the `description` field (optional) in the SVL list view;

- Add the `expiration_date` field (optional) in the quant list views;

- Add a description text for the landed cost;

- Renames field `requisition_id`: "Purchase Agreement" > "Blanket Order"

- In Inventory Adjustment, hides the "Apply All" button is at least one
  record is selected;

- In `product_expiry`, renames two views to stick to the XML's coding
  guidelines: https://www.odoo.com/documentation/16.0/contributing/development/coding_guidelines.html#xml-ids-and-naming

- For the replenishment:
  - Places the field `product_id` as the first option when the user
    writes something in the searchbar;
  - Renames `route_id`: "Preferred Route" > "Route";
  - Renames the button "Automate Orders" into "Automate";
  - Set the `route_id` field as "optional=hide" until `mrp_purchase` is
    installed (in this case, it will be set as "optional=show") because
    in this case, there is at least two routes (Buy and Manufacturing).

task-3076044

Part-of: odoo/odoo#109511
2023-02-13 15:15:06 +01:00
niyasraphy 802d50219f [IMP] purchase_requisition: blanket order reference
currently on confirming a blanket order will generate a reference for the record using the sequence and once the record is moved to cancel state and clicking the reset to draft button is clearing the already assigned reference number.

and on clicking confirm again will generate a new reference number for the same record.

this pr will stop clearing the sequence number on reset to draft button.

closes odoo/odoo#108574

Signed-off-by: William Henrotin (whe) <whe@odoo.com>
2023-02-10 09:11:48 +01:00
niyasraphy 2f069b9ce8 [FIX] purchase_requisition: access right error on confirm/cancel bo
before this commit, on closing/confirming a blanket order by a purchase user throws access right on product_supplierinfo model.

after this commit, access right error will not be shown on confirming and closing the blanket order.

closes odoo/odoo#111896

X-original-commit: 9d86621029a478b8e1cbae4f228fe454a184fba3
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
2023-02-03 17:41:18 +01:00
Hansun (hale) 37e1d01166 [FIX] purchase_requisition: adequate display of internal reference
To reproduce the issue:
1. Install Inventory & Purchase apps
2. Toggle on Settings > Inventory > Purchase Agreements and save
3. Go to Purchase
- [Products] > [Products]: add a product w/ internal reference and w/o
- [Orders] > [Blanket Orders]: create a blanket order with the products
- Save, Confirm and click Print icon to generate the said report in pdf

Desired behavior: Do not show brackets for null internal reference

opw-3138636

closes odoo/odoo#110812

X-original-commit: fb0567ee4fe75d3d0ab2475eaf1c7277ee24636a
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
Signed-off-by: Lee, Hansun (hale) <hale@odoo.com>
2023-01-24 13:47:26 +01:00
Martin Trigaux 776689b0f4 [I18N] *: export saas-16.1 source terms
closes odoo/odoo#110752

X-original-commit: 56b2b52287a8f2192d80ea417c7efac80a87c0a9
Related: odoo/enterprise#36173
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2023-01-24 10:20:30 +01:00
niyasraphy 9a3a41202a [FIX] purchase_requisition, stock: improve usererror to show allowed stages
in purchase_requisition and stock module, when deleting a requisition and move, the raised warning says,the deletion can be done only in draft moves, where us the deletion is allowed for the cancelled records also.

improving the user error message to include the cancelled records in the message.

closes odoo/odoo#110340

X-original-commit: b71d298dabb4436182c0eb516d5a7b7e76fca437
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
2023-01-19 12:30:59 +01:00
Thibault Delavallée 4775bd93a2 [REF] mail: cleanup post with {view, template} wrappers
RATIONALE

Purpose of this commit is to cleanup main post helpers and have a more easy
and understandable way of calling them.

SUMMARY

We now have two main API methods, based on business flow: either posting
on documents, either sending a mass mailing. Indeed those two flows are
different

  * post: create message, then launch notification process by taking into
    account subtype, followers, ...
  * mail: create mails in batch with recipients being based on template or
    given partners. No notifications is involved, only maybe traces if a
    mass mailing is linked

Delegate QWeb rendering to the render mixin (i.e. _render_template_qweb_view)
in order to have a single point to forge evaluation context and re-use
existing rendering code.

SPECIFICATIONS

Main API helpers are now

  * ``message_post_with_source``: (batch) post on records, using an ir.ui.view
    (given a record or its xml id) or a mail.template record (given a record or
    its xml id). When using a template, a composer is called to post on each
    record (as batch post is not yet supported). When using a view, a direct
    call to message_post using the rendered bodies is done, one record at a
    time.
  * ``message_mail_with_source``: send a mass mailing on records, acting like
    invoking the mail composer in mass mode. Same arguments are valid, either
    a reference to a view, either a reference to a mail template.

Other helpers are

  * ``_message_log_with_view``: (batch) log on records, using an ir.ui.view
    to render the body using QWeb (no notification process);
  * ``_message_log(_batch)``: (batch) log on records (no notification process);
  * ``message_notify``: notify partners on records (creating notifications
    specifically for some people while message itself is not displayed in
    chatter);

Code migration

  * ``message_post_with_template`` in "mass mode": use ``message_mail_with_source``
    and set the template record as source;
  * ``message_post_with_template`` in "comment" mode: use ``message_post_with_source``
    and set the template record as source;
  * ``message_post_with_view``: its main usage was to post on a document, in which
    case it generally can be replaced by ``message_mail_with_source`` using
    the view reference as source;

Task-2710804 (Mail: Clean MailThread Posting API)

Part-of: odoo/odoo#99482
2023-01-17 20:58:34 +01:00
Thibault Delavallée 418761e344 [LINT] mail, various: use explicit subtype in message_post_{with_...}
RATIONALE

Purpose of this commit is to be explicit in subtype chosen when invoking the
message composer / calling message_post. As default value may not always be
clear, better be explicit in case the composer default value changes.

SPECIFICATIONS

Add explicit references to subtype when it is not obvious what will be the
final subtype, notably when using helpers (post_with_view or template which
uses the composer that is not crystal clear in its subtype management).

In this commit we also add support of XMLID-based subtype when invoking the
composer. A ``default_subtype_xmlid`` context key is transformed into a
``default_subtype_id``, to be used notably in JS where we cannot easily
use a ``ref``-like statement. Post API now also supports 'subytpe_xmlid'
argument allowing to give the xml id and ease calling the methods.

Use ``_xmlid_to_res_id`` to get directly the ID of subtypes in order to
avoid useless queries from ``ref`` that does an exists.

Also remove useless values given to post API, notably author_id that is by
default the current users' partner.

Task-2710804 (Mail: Clean MailThread Posting API)

Part-of: odoo/odoo#99482
2023-01-17 20:58:33 +01:00
clesgow 3449a6d7c7 [FIX] purchase_requisition{,_sale}: Link SO to alternative RFQ
Steps to reproduce:
- Create a service that is subcontracted `service_to_purchase` = true
- Create a SO containing this service
- Go to the newly created RFQ
- Go to Alternatives -> Create Alternative and select a new vendor
- The alternative RFQ doesn't show a link to the SO, nor the SO to this
RFQ

Initially, when the alternative RFQ is created, only the `product_id`
and its quantity is copied to the new RFQ. Now we add the reference to
the SO as well so the RFQ is properly linked to the original SO.

Part of task-2985735

Part-of: odoo/odoo#106411
2023-01-13 16:27:26 +01:00
niyasraphy 8ae9212b15 [FIX] purchase_requisition: show button without clicking save button
install purchase_requisition module, and create an RFQ in db, check the alternatives tab in the notebook, currently the button Create Alternatives will not be visible unless user click the save button manually. button no longer needs to be hidden when creating a new PO since v16 added in the auto-save feature

closes odoo/odoo#107733

X-original-commit: a6a830e89c724f993b930442573d8d0c4e692b07
Signed-off-by: Tiffany Chang <tic@odoo.com>
2022-12-12 15:17:23 +01:00
niyasraphy eccc308f18 [FIX] purchase_{}, sale_stock, stock: quantities typo
closes odoo/odoo#107242

X-original-commit: 2e18bc8ced09e3100f509b56738cba8ac4288355
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
2022-12-07 15:32:06 +01:00
niyasraphy 9b603054ed [FIX] purchase_requisition: fix singleton error
Activate Product variants and create a new products with attributes Legs, Size and color.

Now enable Variant Grid Entry and Purchase Agreements from purchase settings and now create a Blanket Order from Purchase -> Orders -> Blanket Orders with any products from above created variants.

Confirm the created blanked order and click on New Quotation, now a new RFQ will be created, and click on add an item button and select the product we have created before, now Choose Product Variants matrix will be opened. Enter some random quantities in multiple lines and click on confirm button.

Exception will be raised

closes odoo/odoo#106572

X-original-commit: ca94ace181675b6e150c0f7486de9495198dc8e8
Signed-off-by: Tiffany Chang <tic@odoo.com>
2022-11-25 18:55:40 +01:00