Commit Graph
34 Commits
Author SHA1 Message Date
althaf shaik 1e77837bf5 [FIX] purchase_stock: print report of the purchase order with incoterm location
The traceback arises when a user tries to print 'Request for Qutation'
in 'purchase order' after providing 'Incoterm Location' and 'incoterm' value.

To reproduce this issue:

1) Install 'purchase_stock'
2) Open any existing purchase order
3) Click on 'Other Information' and give any value for 'Purchase Location'
4) Select any 'Incoterm'
5) Now print 'Request for Qutation' template

Error:-''purchase.order' object has no attribute 'invoice_incoterm_id''

On 'purchase_report_template' instead of 'incoterm_id', 'invoice_incoterm_id'
is used.
See:-
https://github.com/odoo/odoo/blob/158f8090ef30065b97ebe8b15b0bf73fff6a9ac4/addons/purchase_stock/report/purchase_report_templates.xml#L43-L48

In 'Purchase_order' there is no attribute of name 'invoice_incoterm_id'.
When the user tries to print 'request for Qutaion' and because of
'invoice_incoterm_id' is used, which leads to above traceback.

sentry-4379690422

closes odoo/odoo#132080

X-original-commit: c1daf78d1aa4252bf0f85cd704df0e929062f496
Signed-off-by: Tiffany Chang (tic) <tic@odoo.com>
2023-08-17 09:20:49 +02:00
Maximilien (malb) 9ddc128d7b [IMP] sale, purchase, account: incoterm location
Before this PR, the incoterm location was not present in the account module.

This pr does multiple things:
- Add the Incoterm Location field in Accounting on Customer Invoices and Vendor
Bills. The field already exists on Sale Orders and Purchase Orders. When you
create an Invoice from a Sales Order, or a Vendor Bill from a PO, copy the value
of the field on the invoices.

- Update the PDF to display the field value if present, and remove the useless
duplication

- Remove incoterm setting on sale

- Remove useless xpath since now it is displayed directly on invoice when
incoterm field is fill.

Task-id: 3273460
Part-of: odoo/odoo#118954
2023-07-12 21:45:44 +02:00
Rémy Voet (ryv) 687d0ed285 [IMP] *: change the override of read_group
The new backend version of read_group can simplify the
current overrides of read_group. Do it for each of them and
avoid making extra search (done with __domain) when it is possible.

Part-of: odoo/odoo#110737
2023-04-19 21:58:27 +02:00
Mathias Mathy (MAMA) 0a43740481 [REF] Stock: report_stock_forecasted to owl
Refactoring of report_stock_forecasted to owl
Since it wasn't really a report (no print action),
it changed from a report to a client action.
Task: 2885757
See Upgrade : odoo/upgrade#3926
See Enterprise : odoo/enterprise#32116

closes odoo/odoo#101247

Signed-off-by: William Henrotin (whe) <whe@odoo.com>
2023-02-06 14:16:26 +01:00
Adrien Widart (awt) d4f82ff1fa [FIX] purchase_stock: generate vendor delay report
The vendor delay report only works with basic use cases. Here are
the issues:
- For each SM, we sum up the done qty of all SMLs without
  considering the UoMs
- When grouping several lines (for instance, by partner and product),
  we sum up the quantities of each line but their UoM can be different
- When grouping several lines, we sum the `qty_total` which are the
  quantity of the related POL. This is an issue: suppose a POL with
  a quantity Q and suppose there are two SM (backorder), if we group
  by product, we will have a total quantity of 2Q, which is
  incorrect (and so will be the delivery rate)

To reproduce the issues: See the tests added by this commit.
Note: the last test (`test_vendor_delay_report_without_backorder`)
was not failing before this commit. It is added to simply improve
  the tests

OPW-3065065

closes odoo/odoo#109471

X-original-commit: c2e351534b9627b6844effba9943b09d4b0b93f3
Signed-off-by: Arnold Moyaux (arm) <arm@odoo.com>
Signed-off-by: Adrien Widart <awt@odoo.com>
2023-01-10 11:23:22 +01:00
Rémy Voet (ryv) 2f5eaedd2e [REM] purchase_stock: remove avg_receipt_delay field
Since https://github.com/odoo/enterprise/pull/31641, this field
is not used anymore. Then remove it and remove
the override of read_group linked to.

odoo/upgrade#4162

closes odoo/odoo#108977

Signed-off-by: William Henrotin (whe) <whe@odoo.com>
2023-01-05 15:37:25 +01:00
Rémy Voet (ryv)andJulien Castiaux e967e25095 [IMP] *: remove bad usage of search_read.
Reading only 'id' with `search_read` is equivalent to use `search` but
complexify the result usage. Fix all these bad usages.

Part-of: odoo/odoo#104838
Co-authored-by: Julien Castiaux <juc@odoo.com>
2022-11-07 11:26:32 +01:00
Tiffany Chang (tic) 9649000b89 [IMP] {purchase_, sale_}stock{_account}: improve forecast report UX
Minor UX updates to forecast report:

- add missing space (between # and unit + before |) also removed
  superfluous uoms (only need it at the end now that an equation is
  displayed)
- move On Hand Value to under product link (+ variants if they exist)
  and make it a link to the valuation report of the product(s) in
  question
- add link from Quantity on Hand to the locations (i.e. inventory/quants)
  report for the relevant product(s). Note that product template was
  added to Search in order to support default searching due to
  forecasting report structure
- redo the top right forecast values to be On Hand + Incoming - Outgoing
  = Forecasted so we provide more explicit and transparent values.
  Additionally, these values are made to not display decimal digits if
  all of those digits are 0.  Note that forecasted values in table are
  untouched (i.e. Forecasted Inventory = Forecasted is unchanged and
  Forecasted with Pending still shows in table)

Also did some t-esc => t-out replacement and other small cleanup since
templates were already being edited.

"forecasted report" part of b2b task: 2882539

Part-of: odoo/odoo#97109
2022-08-29 23:46:35 +02:00
Romeo Fragomeli 1fcd098af5 [REF] *: BS5: migration
Automated change made by a lot of RegEx to change all think that is
possible to automate.

https://getbootstrap.com/docs/5.1/migration

Task ID: 2766483

Part-of: odoo/odoo#95450
2022-07-07 13:30:24 +02:00
Ahmed Khalaf(ahkh) 7253130cb1 [IMP] {purchase, sale}_stock: Incoterm Location field
Added Incoterm Location field in SO and PO forms and reports

Task: 2764771
Part-of: odoo/odoo#91640
2022-06-03 12:02:05 +02:00
Adrien Widart 50fb7fd963 [FIX] purchase_stock: include "to approve" PO in forecasted report
When a PO is in the "To Approve" state, it disappears from the
forecasted report

To reproduce the issue:
1. In Settings, enable "Purchase Order Approval" with a minimum amount
equal to 0
2. Create a storable product P
3. With Marc Demo:
    - Create a PO with 50 x P
    - Consult the forecasted report of P: there are 50 x P "Forecasted +
Pending"
    - Confirm the PO (its state becomes "To Approve")
    - Consult the forecasted report of P

Error: The 50 x P disappeared: 0 On Hand, 0 Forecasted, 0 Forecasted +
Pending. We should still see 50 Forecasted + Pending

OPW-2774586

closes odoo/odoo#86476

X-original-commit: c66fc2f3bfd069642fc9ed61ff322a136974a65c
Signed-off-by: Arnold Moyaux <arm@odoo.com>
Signed-off-by: Adrien Widart <awt@odoo.com>
2022-03-16 08:04:38 +01:00
Adrien Widart 31f29e5742 [FIX] purchase_stock: remove useless qty conversion in report
To reproduce the issue:
1. In Settings, enable "Units of Measure"
2. Create a product P:
    - Type: Storable
    - Unit of Measure: Units
    - Purchase UoM: Dozens
3. Create a PO with 1 (Dozens) x P
4. Open the Forecasted Report of P

Error: The value of "Requests for quotation" is 144, it should be 12.
The quantity has been converted twice.

OPW-2744195

closes odoo/odoo#84091

X-original-commit: 524a1c597fd409a488bb6af37aca8248727691c1
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
Signed-off-by: Adrien Widart <awt@odoo.com>
2022-02-07 15:25:07 +00:00
anhe-odoo 9255d3d7d9 [FIX] purchase: corrects the order date on validated RFQ/PO pdf report
Expected behaviour

The order date on the Purchase Order report (printable pdf) should be the
confirmation date if available and the order deadline else.

Observed Behaviour

The order date on the PO pdf is the order deadline of the RFQ, no matter
if the oder has been confirmed or not.

Reproducibility

This issue can be reproduced following these steps:
1. Create a new RFQ
2. Set an order deadline different from the current day
3. Confirm the RFQ
4. Download the printable PDF (as pdf) and check the Order date

Related ticket
- opw-2696794

closes odoo/odoo#82267

X-original-commit: 91d0354
Signed-off-by: Arnold Moyaux <arm@odoo.com>
2022-01-05 12:50:20 +00:00
Noe Antoine 2c9a76e3a5 [IMP] mass_mailing_sale, * : make fa icons (cart, card, ...) consistent
*: mrp_subcontracting_purchase,payment,purchase_(stock)

BEFORE THIS COMMIT

fa-shopping-cart was used for different purchase-related contexts.
This icon should only be used for online shopping / ecommerce.

AFTER THIS COMMIT

Wa make sure one icon is used for one concept.
- fa-shopping-cart : ecommerce / add to cart
- fa-credit-card : purchases
- fa-credit-card-alt : replaces other uses of fa-credit-card
- fa-pencil-square-o : quotations in marketing modules

Icons are updated accordingly. Other icons are also changed to
increase readablity.

--- Links ---

Task Id - 2593306
COM PR - odoo/odoo#75694
ENT PR - odoo/enterprise#20478

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2021-09-08 07:55:53 +00:00
Mathieu Duckerts-Antoine 7545913020 [REF] *: graph archs cleaning
We clean various graph archs taking into consideration that:
 - the default type of a graph is "bar".
 - a bar chart is by default stacked.
 - the field attributes type="row" and type="col" does not make sense for
   a graph view (since its implementation was separated from the pivot
   implementation a long time ago))
 - the boolean attributes should now take 1 or 0 as value (but the other
   values are accepted for retrocompatibility).

Part-of: odoo/odoo#76065
2021-09-07 15:50:14 +00:00
Guillaume (guva) 13e54c2f9b [FIX] purchase_stock : issue with pivot pivot_view
Step to reproduce

- Purchase >> reporting
- Filters > choose a Vendor
- Filters > Effective Date Last Year
- Toggle Studio
- Add Pivot View and close
- Measures > On-Time Delivery Rate

Got a traceback, the read_group method didn't take into account
the aggregate functions.

opw-2600230

closes odoo/odoo#74672

X-original-commit: ca3821aa35bece74a461a47ea8a8f5e680df83a7
Signed-off-by: Anh Thao PHAM <kitan191@users.noreply.github.com>
Signed-off-by: guva-odoo <guva-odoo@users.noreply.github.com>
2021-08-03 18:01:14 +00:00
Nicolas Pierre b03e900a40 [IMP] stock(_*), mrp: highlight PO/SO links on forecast report
Replenishment is great to replace MTO but misses the direct link between SO and PO (smart buttons on both SO and PO to link to the corresponding PO and SO).
The info is actually there in the forecasted report but it is not accessible directly from the PO and in the case of the SO does not highlight the corresponding line of the SO.

This adds a graph icon in the PO, MO and receipt form to directly access the forecasted report (it already exists for SO and delivery).
The information linked to the SO/PO/MO/receipt/delivery is also sent to the forecasted report to highlight the corresponding line.
Note that in the case of the SO, the information needs to go first through the qty_at_date widget (which contains the link to the forecast report).

The graph icon for the PO, receipts and MO turns red when the forecasted quantity at expected date is negative. This is done using the new 'forecasted_issue' field.

closes odoo/odoo#62264

Signed-off-by: Arnold Moyaux <amoyaux@users.noreply.github.com>
2021-02-09 13:41:27 +00:00
JF Aubert c6847d9110 [IMP] stock: add priority star in forecasted report
see and set priority on sales orders and manufacturing orders in forecasted report
without having to go to the SO/MO

add the priority star icon in front of the SO/MO reference
changing priority should reload the page with reordered SO's/Mo
add a unreserve button next to 'reserved from stock' in the replenishment column
add total order and customer amount in used by column
remove time in delivery/receipt dates
change column headers (Quantity -> the UoM of the product, Expected Receipt -> Receipt, Expected Delivery -> Delivery)
change 'Draft SO' -> 'Quotations' and 'Draft PO' -> 'Requests for quotation' and add links
mobile view: display KPI's on new line
check decimals on quantities, must be 2

closes odoo/odoo#60578

Task: 2349142
Signed-off-by: Arnold Moyaux <amoyaux@users.noreply.github.com>
2020-11-09 16:44:18 +00:00
yhu-odoo 03f898c5dd [FIX] purchase_stock: disable links on vendor delay report
Disable the link on the vendor delay report graph view, as it leads us
to a undesired list view.

Task 2346121

closes odoo/odoo#59410

X-original-commit: 29e7e70e9452f354247f98412d925d1f17e5f86b
Signed-off-by: Arnold Moyaux <amoyaux@users.noreply.github.com>
2020-10-07 12:56:33 +00:00
yhu-odoo 9547813e8e [FIX] purchase_stock: compare only date in on-time delivery
Previously, when compute on-time delivery, we compare the date_planned
on PO line with the date on stock.move. Since they are both datetime,
the product that delivered on the scheduled date may be considered delay
because of the 'time' part is late, which is normally not what we want.
In this commit, we only compare the date part of them to decide whether
it's late or not.

Task 2346121
PR #58653

closes odoo/odoo#59386

X-original-commit: 86af7c647fe56f776c6cebc22dd5856577878980
Signed-off-by: Arnold Moyaux <amoyaux@users.noreply.github.com>
2020-10-07 10:35:37 +00:00
Barad Mahendra 63f239163a [IMP] *: set sample="1" on various graph archs
The purpose of this commit is to enable sample data in various
graph views.

TaskID: 2311486
2020-08-12 09:57:09 +00:00
svs-odoo 38018469a7 [IMP] purchase_stock: extend replenishment report
Adds Purchase Orders as replenishment/consuming document for the
replenishment report.

task-2058495
2020-07-31 12:36:54 +00:00
Krupal Oza a8ed0c000d [FIX] purchase_stock: Fix traceback while accessing purcase report
Since recent commit[1], from the report 'purchase.report' inherited in
purchase_stock, `effective_date` field is moved out from the query and
is placed inside the domain. However, `effective_date` field is not
available in 'purchase.report' and is part of the 'purchase.order'
and so moving it inside the domain results into a traceback.

This commit fixes the issue by adding this field from purchase.order to
purchase.report so domain works as expcted.

commit[1] - https://github.com/odoo/odoo/pull/49999/commits/b7115cc006fb15c935ceef41e8372b1d3ceb1462#diff-34545aa3f96ecc997188c974620118ee

closes odoo/odoo#52103

Taskid: 2263566
Closes: #52103
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2020-06-02 07:02:46 +00:00
Fabien Pinckaers ccfc54113d [IMP] purchase: Improve reminder mail usability
Some change to imporve reminder mail usability:

1. Scheduled date on POL of the PO form now is always editable.
2. Improve tooltip for the reminder email
3. don't show number of days when reminder email not checked on
   both PO and partner form.
4. only show "confirm receipt date" button in debug model
5. In the mail, format date by partner.lang
6. Add button to send preview reminder mail
7. On default, receipt_reminder_email on res.partner is False
8. merge expected_date with date_planned (done by FP)

Task 2265912
PR #52693
2020-06-09 13:59:10 +00:00
yhu-odoo 181c7d82e3 [IMP] purchase: send reminder mail to vendor
1. automatically send a reminder mail to vendor to confirm the receipt
date. If confirmed, (confirmed by vendor) will be added next to the
receipt date. If not, vendor can update the date on the portal website.
An warning activity will be set for the purchase representative for this
update.

2. Vendor can also comfirm recieption of the PO when we 'send PO by mail'.
If confirm, (confirmed by vendor) will be added next to the confirmation
date. An filter is added in the PO search view to show all unconfirmed
PO.

Task 2230811
PR #49921

Signed-off-by: Simon Lejeune (sle) <sle@openerp.com>
2020-05-27 08:20:17 +00:00
yhu-odoo d83334ef8e [IMP] purchase_stock: add vendor on-time delivery rate
Add on-time delivery rate to vendor. When editing a PO, user can see
the overall on-time delivery rate during the last 365 days next to the
vendor. When click it, user will be redirect to a graph view showing
the detail of the on-time delivery rate of this vendor. Also add a stat
button to show the on-time delivery rate on partner form.

Task: 2230811
PR: #49921
2020-05-27 07:41:43 +00:00
Raphael Collet 84a595301e [REF] expression: use and return a Query object
The management of the join contexts now relies on the `Query` object,
that has all the necessary logic to do so.  The refactoring also removes
the class `ExtendedLeaf`, which is no longer necessary: the join
contexts are all managed by a single `Query` object, and the parsing
stack now only contains triples like (leaf, model, table_alias).

Also inline directly the SQL translation made in `_to_sql`, which
overall simplifies the management of SQL parameters in the domain
compilation.  The algorithm is illustrated in the code itself.
2020-05-20 07:56:44 +00:00
Tiffany Chang (tic) 52dc25d428 [IMP] purchase(_stock): Add more reporting values
Added new values "Average Days to Purchase" and "Average Receipt Delay" to be
used in purchase enterprise reporting tab where:

  Days to Purchase = confirmation date (i.e. 'date_approved') - creation date
  Receipt Delay: effective Date - ('date_planned' or 'expected_date' if
                 no 'date_planned)

Note that these 2 new values are specific to purchase orders only.
Because of this the standard query result cannot be used since it is
done at the purchase order line level. This means duplication of PO
values occur and results in incorrect aggregation calculations. A hack was
done to ensure that these value will aggregated correctly when used at the
enterprise level. Therefore these 2 new values should only be used in
aggregate.

To support these new measures the following updates were also done:
- Addition/improvement of help descriptions for other date related
  measures to avoid confusion
- Change state string to "Status" to match purchase.order (for
  consistent filtering purposes)

This commit supports "Adapt Reporting" subsection of Purchase KPIs task.

Upgrade PR: odoo/upgrade#877
Enterprise PR: odoo/enterprise#8945
Task: 2198420
2020-03-31 10:31:35 +00:00
Mitali Patel b47aa1b005 [IMP] account: update incoterms list
Purpose of this commit is to update incoterms list
base on new incoterms guidlines and add incoterms in RFQ/PO
and invoices/venderbills reports

task-2179236

closes odoo/odoo#43883

Related: odoo/upgrade#922
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2020-03-17 13:01:57 +00:00
Hetashree Chauhan b5cea7e2b6 [IMP] purchase: purchase report improvement
Modify purchase report in order to make it consistent with
sales report.
For the RFQ it will show the Order Date and for the Purchase order
menu it will display the Confirmation Date.

Also rewrite a bit the SQL view in order to compute every purchase
order in the company currency.

Technicaly rewrite the SQL alias in order to have a report more
readable in the future.

Task ID : 1857130.

closes odoo/odoo#28248

Signed-off-by: Arnold Moyaux <amoyaux@users.noreply.github.com>
2019-05-31 09:06:30 +00:00
Julien Castiaux 88348f8ff9 [FIX] purchase_stock: print shipping address
When there are multiple warehouses, the shipping address must appear on
the purchase order and the RFQ.

opw-1955874

closes odoo/odoo#32230

Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2019-03-29 08:37:19 +00:00
Pierre Masereel 94a3919d09 [ADD] stock, sale_stock, purchase_stock, mrp: Routes 2D report
We are adding a new report available on products that displays all the
routes applicable on the products and dislay them as arrows between the
different locations.

We also display the putaway rules and reordering rules on locations
where they are applied.

TASK-46972
2018-08-10 11:25:01 +02:00
Cédric Snauwaert c71da7db84 [REF] report, *: defines address area in external layout templates
This is needed because some reports we want to add later on, need to have
    the address field on the left or following a given format.

    Hence we moved the address div from each existing report on to the main report
    template itself, Since some reports uses up until 3 addresses, we have defined
    an area for the main address that each report can set (address used on the
    envelope's window for sending). The any other extra address, or additional
    information should be defined in the 'information_block' div

Was part of task: 35289
Was part of PR #25472
2018-07-24 17:12:52 +02:00
jem-odoo e38ed7c780 [MOV] purchase_stock: move code from purchase
We want to break the dependency between stock and purchase
for our furtur developpement. For more modularity, a new
bridge module 'purchase_stock' is created.
This commti move part of business code, views, data, ...
related to stock management from purchase into purchase_stock
without changing any feature.

Task #47927
2018-05-23 10:13:49 +02:00