Commit Graph
130 Commits
Author SHA1 Message Date
Victor Feyens 57ced812f0 [REF] product: clean pricelist API
* Do not rely on context, everything should be cleary specified through
parameters
  Catch context keys in an unique targeted place to improve code clarity
* Drop strange old API
  * do not provide unused partner parameter anymore
  * do not provide products, qty as a list of tuple, we only request the
same qty for all products anyway
* Clear methods, add/adapt comments and docstrings
* Reduce potential side-effects of context content.
2021-12-23 15:30:23 +01:00
Tiffany Chang (tic) 0d882a4e49 [FIX] product,stock: print lot when provided instead of product
When Print Labels was revamped in odoo/odoo#69690 it was decided that
only product barcodes would be printed. Unfortunately we want SN/Lot
barcodes to be printed instead when they are filled in, so we make this
the case when applicable (i.e. when printing Transfer Quantites + qtys
done).

closes odoo/odoo#80079

Task: 2678336
X-original-commit: 105587e9e411442fd8e6d30efaa35b90b0e09959
Signed-off-by: Arnold Moyaux <arm@odoo.com>
2021-11-19 12:50:58 +00:00
William Henrotin 07ee514897 [FIX] product: use correct price field
Commit fa034b2a64 removed lst_price on
product.template That means we need to check if product is a variant or
not to choose the suitable price field.

closes odoo/odoo#76503

X-original-commit: c50e7b106b08577228a410e1e34403bd8a6eb80d
Signed-off-by: Arnold Moyaux <amoyaux@users.noreply.github.com>
Signed-off-by: William Henrotin <Whenrow@users.noreply.github.com>
2021-09-15 07:48:12 +00:00
William Henrotin d9f45ba694 [IMP] product,stock{_picking_batch}: product labels revamp
This commit removes the pdf and zpl reports for product templates and
variants. Instead, labels are printed via a new wizard allowing to
specify the label quantity, format and optional text.

There are a bunch of usual retail label sizes in pdf or zpl code

Task : 2501730

closes odoo/odoo#69690

Related: odoo/enterprise#20246
Related: odoo/upgrade#2542
Signed-off-by: William Henrotin <Whenrow@users.noreply.github.com>
2021-09-01 15:01:48 +00:00
Victor Feyens d1dda79c2f [IMP] product: clean product pricelist report code & logic
* Linting, typos & cleanup
* Avoid using the context to pass data to the server
* JS: let the web client service manage the data transfer
    instead of "manually" specifying it in the report_name

closes odoo/odoo#73198

Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2021-08-23 09:33:19 +00:00
Shweta Goltar 1ad72def2a [IMP] product: improve for the pricelist report
PURPOSE
------
In the new pricelist report, showing the resulting price of a product in the
situation of a pricelist or another, for certain quantities, the specified
quantities are shown as "X Units".

This can be misleading when using multiple Unit of Measure, because
the quantites are expressed in the products unit of measures, thus
not always in "Units".

We should probably either group the products by UoM, to display
adequates column titles, or we should update the display to make sure the user
understands clearly that the prices are /unit in the product uom.

users should be able to 'hide' pricelist name on the PDF.

TaskID-2360597
2021-08-23 09:31:54 +00:00
Tiffany Chang (tic) 53cc41016f [IMP] mrp, product, {purchase_, sale_}stock{_picking_batch}: add reception report
New reception report added for non-outgoing transfers. This is intended
to support easier stock allocations by allowing dynamic MTO
assignment/unassignment, e.g. if we have an incoming transfer with
products we want to assign to an existing outgoing transfer, then we can
use the report to create a MTO link to the specific outgoing moves. To
support this assignment flow, the report also allows printing of labels
to place on the product so stock workers know which transfer/MO the
product has been assigned to.

Expected use case is when a product is purchased to fulfil a sale.
Demo data has been added so reception report can be immediately
seen/used for this flow.

Implementation Notes:
- Report has been made flexible to work with batch transfers.
- Only done moves can be assigned to moves that already have quants
  reserved (prevents undesired behavior + this makes sense logically)
- Confirmed (+ Done and everything inbetween) moves can be assigned to
  any confirmed moves that are not already assigned.
- Report does not affect quant reservation/unreservation at all. It
  works only with linking moves (i.e. move_orig_id/move_dest_id) so
  move/transfer linkage traceability is stored within db (i.e. this
  isn't possible with quants)

Limitations: To keep code simple for now, this assignment flow will
  break in certain cases:
1. Done amount of an assigned move is less than the Demand amount
   (linked move will not autoreserve correctly when assigned move is
   validated, same issue already occurs in multi-step transfer).
2. If a linked move is unreserved after its assigned move is
   validated, then another move can reserve its quants and its
   assignment link will not be accurate.
3. Already reserved SNs + assign move, may lead to mismatching SNs
   between report and what's actually reserved.
4. Changing a linked move's Demand amount after a move is assigned to
   it.
5. Potential moves to assign to are only checked for being in same
   warehouse, not in a matching source location to destination location.
   User is expected to make this match on their own.

Task: 2500844
ENT PR: odoo/enterprise#18268
Upgrade PR: odoo/upgrade#2731

closes odoo/odoo#70669

Signed-off-by: Arnold Moyaux <amoyaux@users.noreply.github.com>
2021-08-17 11:42:23 +00:00
Christophe Monniez 2949138a7d [IMP] various: use the barcode qweb widget whenever possible
When using the route `/report/barcode/...` in a report, wkhtmltopdf
makes htpps requests on the server to retrieve the barcode image.
If a lot of barcodes have to be printed, this can overload the server
with too much requests and makes wkhtml crashes.

With this commit, the qweb barcode widget is used to include the barcode
as an img tag with inline barcode image as base64 data.

closes odoo/odoo#64211

Related: odoo/enterprise#15619
Signed-off-by: Christophe Monniez (moc) <moc@odoo.com>
2021-01-12 12:50:23 +00:00
Xavier Morel 6835aeb0de [REM] core, *: deprecate <act_window> and <report>
Convert deprecated tags through the codebase.
2020-07-28 13:03:13 +00:00
Martin Trigaux d9287caf94 [IMP] *: convert to private methods
render, render_template, load, activity_schedule_with_view,
get_website_pages should all be private:
It should not be possible to render an aribtrary template only with
its name or id

Still need to render some qweb views from js so the method
render_template is kept public.
This explains why the website editor still need read access on
ir.ui.view as we want to allow any snippet to be rendered.
2020-05-14 13:59:10 +02:00
jerome hanke (jhk) 91d341adce [FIX] product: barcodes can be url encoded
Steps to reproduce:
- install sales and barcodes
- go to sales > catalog > products > create
- give the product a random name and the following barcode: #1N4005-T+A
- save > print > product labels

Current behavior:
the barcode is not generated properly because it is not url encoded
everything after the # charachter is ignored

Current behavior:
barcodes are url encoded and generated properly

opw-2203716

closes odoo/odoo#48607

X-original-commit: 5aaacb825d0c408bc11c4fbb386e1d365a68594b
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2020-03-30 12:19:21 +00:00
Siddarth GajjarandJigar Patel c44d846006 [IMP] product: added new product pricelist report
Generate a pricelist report for products and its variants. It's base on selected
pricelist and quantities. It also bring new UI.

closes odoo/odoo#35341

Signed-off-by: Damien Bouvy (dbo) <dbo@odoo.com>
Co-authored-by: Jigar Patel <jat@openerp.com>
2019-12-23 09:18:16 +00:00
Siddarth Gajjar 34cfd0df0d [REM] product: removed older product pricelist report 2019-12-23 08:17:35 +00:00
Christophe Simonis 58a83d1222 [MERGE] forward port branch saas-12.4 up to 4a1321bc99
closes odoo/odoo#37127

Signed-off-by: Christophe Simonis <chs@odoo.com>
2019-09-20 14:33:54 +00:00
Jorge Pinna Puissant 4b750f3a3c [FIX] product: price list reports with too many fractional digits
Before this commit, when printing the Price List report of a Product
Variant, the price is printed directly from the float result of the
calculation of the price, even if this price is rounded, the
representation of the float can have, sometimes, float precision errors
(a lot of 0 after the decimal point, and a 1 or 2 at the end).

Now, the function returns a string formatted to the correct number of
fractional digits.

opw-2069305

closes odoo/odoo#36705

closes odoo/odoo#36770

Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2019-09-12 11:15:48 +00:00
Sébastien Theys 22a11a6f4d [REF] product, *: save product.template.attribute.value on variants
* account, hr_expense, mrp, sale, sale_product_configurator, stock_account,
  website_sale, website_sale_comparison

Before this commit, the `product.attribute.value` were stored on the variants.
This required filtering of attribute lines to find the appropriate matching
`product.template.attribute.value` that were used in most of the business code,
such as when computing the `price_extra`.

This also prevented to have multiple attribute lines for the same attribute,
which is needed to handle use cases such as grape varieties for wine products.
This will be done in the following commit.

After this commit, the combination of `product.template.attribute.value` will be
directly stored on the product variant.

Other changes
=============

Add `combination_indices` on product, which allows to quickly find a variant
matching a combination (1 simple indexed equality query as opposed to 1 query
with as many joins as there are attribute lines), and to add an easy
SQL constraint to ensure active combination uniqueness.

Add active field on `product.template.attribute.line` and
`product.template.attribute.value`, with the same behavior as variants:

They become archived if they can't be unlinked. This allows to keep the database
consistent, such as archived variants correctly keeping all their values, sales
order lines keeping their custom and no_variant. This is done with the help of
`ondelete=restrict` on the corresponding m2m fields, and the `unlink` methods
falling back to archiving when `unlink` is restricted.

Part of task-1912579

PR: #32946
2019-08-26 13:01:13 +00:00
Christophe Simonis 37e05d35d2 [MERGE] forward port branch saas-11.3 up to 132e38beef 2019-06-19 14:41:36 +02:00
Christophe Simonis 132e38beef [MERGE] forward port branch 11.0 up to b5a04fd29f 2019-06-19 12:07:56 +02:00
Lucas Perais (lpe) 187b77d7b9 [FIX] product: report pricelist empty data
Try to get the report_pricelist with empty data
(Studio Report editor can)

Before this commit, it crashes because we tried to access dict keys directly
in an empty dict

After this commit, it doesn't crash

OPW 2009862

closes odoo/odoo#34118

Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
2019-06-14 08:05:33 +00:00
Christophe Simonis 15f686eef6 [MERGE] forward port branch 11.0 up to 468dab6748 2018-11-15 20:39:10 +01:00
Christophe Simonis 468dab6748 [MERGE] forward port branch saas-15 up to 3c78026dc0 2018-11-15 18:57:09 +01:00
Christophe Simonis 5523e6b1c9 [MERGE] forward port branch 10.0 up to 8a9569b31e 2018-11-15 17:00:52 +01:00
RomainLibert 8cdfe1d8fe [FIX] product: use product.pricelist in report product_pricelist
We were using hr.contribution.register as a doc_model on the
product.pricelist report which makes no sense since it should show
pricelist informations
2018-11-14 13:06:58 +01:00
Rishabh Jadia 3d52704296 [FIX] product: product label/barcode report style
The purpose is to set the style of the product label and product barcode
reports that was lost in bootstrap v3 to bootstrap v4 conversion.

opw-1920478

closes odoo/odoo#30407
2019-01-24 17:42:54 +00:00
Jorge Pinna Puissant f69fde6e2c [FIX] product: report product labels price
opw-1916965

Before this commit, the price printed in the product label was the
list_price (catalog price) it didn't take into account the extra price
of the variants.

Now, the price printed is the lst_price (catalog value + extra).

closes odoo/odoo#30039
2019-01-08 14:32:34 +00:00
Christophe Simonis 4b8bd36219 [MERGE] forward port branch saas-11.3 up to bab2a191d2 2018-11-16 15:39:02 +01:00
Nimesh Jethva 71820dbc20 [IMP]crm_*, sale_*: Improvement in model description
Purpose of this commit is to give description more "business oriented"
because those descriptions appears in Odoo Studio which is supposed to be used by end users, not only by developers.

Related Task ID : 37311
2018-09-21 11:45:14 +02:00
William Henrotin c7219c4876 [IMP] product: new report on product packaging
This commit adds two reports on the product packaging model. They act as 
labels representing the packaging. The first one is a pdf, the second 
one is a text one to be printed thanks to a zebra printer.
2018-09-10 17:23:02 +02:00
William Henrotin 3cebe88d8d [IMP] stock: report consitency
Some pdf reports are renamed to be identified as pdf reports (to
be distinguished with zpl ones). The old layout become similar with
the label one.

Task ID:1837175
2018-08-09 14:33:03 +02:00
qsm-odoo 6e223b9273 [REF] *: BS4, adapt tables (and list view)
`table-condensed` -> `table-sm`

Also SCSS variables were renamed.
Also restore list view design.
2018-07-27 12:36:54 +02:00
qsm-odoo ed1b18f103 [REF] *: BS4, adapt col-related classes
col-lg-* -> col-xl-*
col-md-* -> col-lg-*
col-sm-* -> col-md-*
col-xs-* -> col-*

col-lg-offset-* -> offset-xl-*
col-md-offset-* -> offset-lg-*
col-sm-offset-* -> offset-md-*
col-xs-offset-* -> offset-*

col-lg-pull-* -> order-xl-1
col-md-pull-* -> order-lg-1
col-sm-pull-* -> order-md-1
col-xs-pull-* -> order-1

col-lg-push-* -> order-xl-2
col-md-push-* -> order-lg-2
col-sm-push-* -> order-md-2
col-xs-push-* -> order-2
2018-07-27 12:36:54 +02:00
Laurent Smet 93cacd5e59 [FIX] account: improve security in reports and in account's query_get()
* privatize the get_report_values() method
* check read access rights and ir.rules in _query_get() from account module

Was task 36590
Was PR #25822
2018-07-23 12:21:06 +02:00
Christophe Simonis 49edee1f4b [MERGE] forward port branch saas-11.4 up to d54a3726ec 2018-06-29 12:46:00 +02:00
Christophe Simonis b06af028e6 [MERGE] forward port branch saas-11.2 up to d112a163cd 2018-06-28 10:55:12 +02:00
Gert Pellin c7247c07b6 [FIX] product: Product variants attributes are not shown in pricelist report (#25497)
Product variants are only shown by product name and price with no distinction between them.

related to task #1861988
2018-06-27 11:57:46 +02:00
kujiu 9de1bc0eef [IMP] Improve compatibility with screen readers (accessibility) (#24574)
Today, Odoo is really tricky to use without seeing the screen, it must be improved to be usable.

This PR forbid to use labels without a "for" attribute, add some title, rule and aria attributes in HTML. With that, Odoo will be fully usable with a screen reader.


* [IMP] Labels must have a for attribute. Improve accessibility.
* [IMP] Better error message when trying to read a missing cached value
* [FIX] Add some aria-label and title attributes for screen readers.
* [FIX] Template name is not included in the error message in case of SyntaxError in QWeb
* [FIX] Improve the Tour failed at step error message to be more explicit.
* [IMP] Add aria-labels
* [FIX] Add missing aria-label on failing test
* [IMP] aria-hidden means hidden. Fix all bad aria-hidden and hide aria-hidden for all.
* [IMP] Color names on kanban views and many2many tags
* [IMP] Add some checks on views for accessibility.
* [IMP] Add `alt` attribute on `img` tags.
* [IMP] Add aria-label and title on non-described icons
* [IMP] Add button role to widgets with btn class
* [IMP] Translate aria and formatted attributes.
* [IMP] Remove wrong aria-labelledby
* [IMP] Add menu role on dropdowns
* [IMP] Buttons must be focusable
* [IMP] Add aria attributes on progress bars
* [IMP] Improve accessibility of basic widgets
* [IMP] Change main layout to more semantic tags
* [IMP] Add menuitem role when missing
* [IMP] Remove wrong role='presentation'
* [IMP] Improve accessibility of tab panels
* [IMP] Add aria-invalid on invalid fields
* [IMP] Add aria-sort on ordered columns
* [IMP] Add role on alerts
* [IMP] Use dialog role, header, main and footer tags for modals
* [IMP] Add labels on o_status
* [IMP] Improve accessibility of kanban view with feeds and articles
* [IMP] Add alerts in case of new messages
* [IMP] Add widget, navigation or img role to aria-labelled items
2018-06-22 21:22:21 +02:00
Christophe Simonis c2c9a60466 [MERGE] forward port branch saas-11.2 up to a2f275dfc4 2018-05-29 21:05:26 +02:00
Christophe Simonis 459efb4276 [MERGE] forward port branch 10.0 up to 2288a89564 2018-05-29 18:45:00 +02:00
Goffin Simon b5ea61bf72 [FIX] product: Print "Products Labels"
The number of characters must be taken into account to print the
barcode. With 13 characters -> EAN13, with 8 characters -> EAN8 else
-> Code128

Backport of 12b11c1e6f

opw:1849965
2018-05-29 14:06:06 +02:00
Goffin Simon 12b11c1e6f [FIX] product: Print "Products Labels"
The number of characters must be taken into account to print the
barcode. With 13 characters -> EAN13, with 8 characters -> EAN8 else
-> Code128

opw:1849965
2018-05-29 12:27:58 +02:00
invitu 7d1775fda3 [IMP] product: use montenary label
Format the product price on the product label report to format correctly
the currency

Closes #22999
2018-03-02 16:43:00 +01:00
Thibault Delavallée 00d5a2f039 [IMP] inventory related addons: improve report naming and use print_report_name
Purpose of this commit is to clean and uniformize report naming through
various addons. It has been chosen to name them using a formatting like
<report_name> - <object_name or suffix> .

Improve report naming in product, stock, mrp and mrp repair.
2017-05-10 17:16:09 +02:00
xmo-odoo fffaf735f5 [FIX] P3: list -> iterable builtins (#16811)
In Python 3:

* various builtins and dict methods were changed to return
  view/iterable objects rather than lists
* and the separate Python 2 view/iterable builtins and methods were
  removed altogether

This is problematic when using these items as list (which the happens
repeatedly in Odoo), but more viciously when iterating *multiple times*
over them (which also happens, which I've messed up multiple times while
writing this, and which is a pain to debug even when you've just created
the issue).

Convert all code using these to semantics-matching cross-version
helper functions to get the LCD behaviour between P2 and P3, and
forbid the builtins via lint.

issue #8530
2017-05-10 09:39:55 +02:00
Laurent Smet e80238042c [REF] report: remove the report module
The content of the report module is now dispatched in
the 'base' and the 'web' modules.
2017-05-08 09:23:12 +02:00
Laurent Smet 3425752eac [REM] odoo/report: remove deprecated stuff
- RML Reports
- Webkit Reports (most part already removed by 13b9982c62)
- LocalService in netsvc.py
- rename attributes like rml_% to report_%
- rename ir.actions.report.xml to ir.actions.report
- allow rendering directly on an ir.actions.report by calling render method
- remove 'controller' report_type
- remove unused res.font stuff
- remove print_report method in models.py (not used)
- restore removed call to pdftotext process in test_reports
2017-05-08 09:22:56 +02:00
xmo-odoo b4429c2a91 [FIX] Various P3-related import changes
* LDAP import: python-ldap is not python3-compatible, pyldap is

  Warning: only supported from debian Stretch (current testing)?
  https://packages.debian.org/search?searchon=names&keywords=pyldap

* implicitly relative imports
* imports of moved or removed stdlib modules

issue #8530
2017-04-28 09:06:53 +02:00
mdi-odoo 255de89330 [FIX] report,*: correct reports without header/footer
Since 3d04e44880 [0], the class `article`
is used instead of `page`. As reports not using `external_layout` does
still manually used `page` class as wrapper, there were not rendered
properly. Force these reports to correctly wrap their content into an
`article` div by using a dedicated template.

Closes #15118

[0] more precisely https://git.io/vM58c
2017-01-23 13:00:00 +01:00
Ravi Patel efdb5373c3 [IMP] *: Define pdf report name according to the business case
Purpose:

When downloading a document, the name by default is not clear at all because by default, the printed report name is empty.

Specification:

Change the Printed Report Name. In most of the cases, it should be the name of the object + the number.

For the following reports :

- BOM Structure ==> BOM-product_variant_name ===>  'BOM'+'-'+(object.product_id.name)

- BOM Cost ==> BOM Cost-product_variant_name ===>  'BOM Cost'+'-'+(object.product_id.name)

- Call for Tenders ==>Tender-TE00001 ===> 'Tender'+'-'+(object.name)

- Delivery Slip ==> Delivery Slip-Customer Name-Picking Number ===> 'Delivery Slip'+'-'+(object.partner_id.name)+'-'+(object.name)

- Expenses Report ==> Expenses-Employee Name-Travel By Air  ===> 'Expenses'+'-'+(object.employee_id.name)+'-'+(object.name)

- Inventory ===> Inventory-Starting Inventory  ====> 'Inventory'+'-'+(object.name)

- Invoice (pos.order)===> Invoice-Main-0002 ===> 'Invoice'+'-'+(object.name)

- Invoices (account.invoice):
	===> Invoice-INV-2016-0019  ====> ((object.type == 'out_invoice') and (object.state == 'open' or object.state == 'paid'))  ===> 'Invoice'+'-'+(object.number)
        ===> Vendor Bill-BILL-2016-003 ===> (object.type == 'in_invoice') ===> 'Vendor Bill'+'-'+(object.number)

- Location Barcode  ===> Order Processing-Location ===> (object.name)+'-'+'Location'

- Lot Barcode ===> Lot/Serial-0000018 ===> 'Lot/Serial'+'-'+(object.name)

- Payslip  ===>  Employee Name-Payslip ===>  (object.employee_id.name)+'-'+'Payslip'

- Print Batch Deposit ===> Bank- DEPOSIT/2016/0001 ===> (object.journal_id.name)+'-'+(object.name)

- Print Check (Top)  ==> check_Partner name_Draft Payment_top   ===>  'check_'+(object.partner_id.name)+'_'+(object.name)+'_top'

- Print Check (middle)  ==> check_Partner name_Draft Payment_middle ===>  'check_'+(object.partner_id.name)+'_'+(object.name)+'_middle'

- Print Check (Bottom)  ==>  check_Partner name_Draft Payment_bottom  ====>  'check_'+(object.partner_id.name)+'_'+(object.name)+'_bottom'

- Production Order ==>  Production Order-MO-00006  ====>  'Production Order'+'-'+(object.name)

- Quotation / Order (sale.order):
	 ==> Order-S00001  ===> (object.state not in ('draft', 'sent'))==> 'Order'+'-'+(object.name)
         ==> Quotation-S00002   ====>  (object.state in ('draft','sent'))===> 'Quotation'+'-'+(object.name)

- Quotation / Order (mrp.repair):
	 ==> Repair Order-RMA00005         ===>  (object.state != 'draft') ===> 'Repair Order'+'-'+(object.name)
         ==> Repair Ouotation-RMA00005    ===>  (object.state == 'draft') ===> 'Repair Quotation'+'-'+(object.name)

- Registration Badge ===> Registration Event-Attendee Name       ====>  'Registration Event'+'-'+(object.name)

- Web Quotation(sale.order):
	==> Order-S00001  ===>  (object.state not in ('draft', 'sent')) ===> 'Order'+'-'+(object.name)
        ==> Quotation-S00002   ====>  (object.state in ('draft','sent')) ===> 'Quotation'+'-'+(object.name)

- Payslip Details: ===> Payslip Name ===>(object.name)

- Purchase Order:
	===> Purchase Order-PO0012 ===>(object.state != 'draft') ===> 'Purchase Order'+'-'+(object.name)
        ===> Request for Quotation-PO0012 ===> (object.state == 'draft') ===> 'Request for Quotation'+'-'+(object.name)

- Request for Quotation:===> Request for Quotation-PO0012  ===> 'Request for Quotation'+'-'+(object.name)

- Due Payments ===> Due Payments-Partner Name  ====> 'Due Payments'+'-'+(object.name)

- Products Labels ===> Products Labels-Product Name ===> 'Products Labels'+'-'+(object.name)

- Picking Operations ===> Picking Operations-Customer Name-Picking Number ===> 'Picking Operations'+'-'+(object.partner_id.name)+'-'+(object.name)

- Duplicates Invoices (account.invoice):
	===> Duplicate Invoice-INV-2016-0019  ====> ((object.type == 'out_invoice') and (object.state == 'open' or object.state == 'paid'))  ===> 'Duplicate Invoice'+'-'+(object.number)
        ===> Duplicate Vendor Bill-BILL-2016-003 ===> (object.type == 'in_invoice') ===> 'Duplicate Vendor Bill'+'-'+(object.number)

- Intrastat Invoices (account.invoice):
	===> Intrastat Invoice-INV-2016-0019  ====> ((object.type == 'out_invoice') and (object.state == 'open' or object.state == 'paid'))  ===> 'Intrastat Invoice'+'-'+(object.number)
        ===> Intrastat Vendor Bill-BILL-2016-003 ===> (object.type == 'in_invoice') ===> 'Intrastat Vendor Bill'+'-'+(object.number)

- Cost Structure Analysis ==> Cost Structure Analysis-Product Name ===> 'Cost Structure Analysis'+'-'+(object.name)

- Cost Analysis  ===> Cost Analysis-Product Name  ====> 'Cost Analysis'+'-'+(object.name)

- Print Badge  ===> Print Badge-Employee Name ===> 'Print Badge'+'-'+(object.name)

- Event Badge ==>  this report is in html format so ,there is no need to give the print_report_name.

- The following reports are print through wizard so there is no need to give the print_report_name

Budgets ===>
Financial Report ==>
General Ledger  ===>
Leaves Summary  ===>
2016-11-07 16:57:18 +01:00
Yannick Tivisse a3f83916d0 [FIX] report: Pass correctly the docids to render_html method
In the 'get_html' method, the report is using a custom model to render its html,
we should use its own 'render_html' method to generate the report. During the
module migration, we replaced
'report_model.render_html(cr, uid, ids, data=data, context=context)'
by
'report_model.render_html(data=data)'

The new API signature of 'get_html' is

    @api.model
    def get_html(self, docids, report_name, data=None):

That way, 'render_html' doesn't receive docids anymore when called. We should do instead

    if report_model is not None:
        return report_model.browse(docids).render_html(data=data)

As render_html is an api.multi method, this is all wrong too, because we'll send a
browse record with the custom report model to the render_html method, to use the
ids with 'self.ids' that are absolutely not corresponding to the report model but to
to the record model we want to print (an invoice for example).

In old API style we were sending a list of ids, but it's not correct to keep the same
behavior by sending a browse record with only the ids relevant. We have also to
change render_html method decorator to @api.model with a new signature

    @api.model
    def render_html(self, docids, data=None):

And replace the call to render_html by

    if report_model is not None:
        return report_model.render_html(docids, data=data)

In the case the report is printed from a wizard, this is sufficient because the ids
are taken from the active_ids in context, or in data.

In the case the report is printed from a simple action, we should replace the occurence
of 'self.ids' (which doesn't mean anything) to 'docids'

This fix doesn't solve the printing issues for the custom accounting reports, because
the method get_pdf has been reimplemented in the module account_reports.
2016-08-10 11:13:33 +02:00
Thibault Delavallée 1b4f96cf40 [MIG][IMP] product: migrate and clean product pricelist report 2016-08-01 15:05:33 +02:00