Commit Graph
83 Commits
Author SHA1 Message Date
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
Touati Djamel (otd) 48a6f88c50 [FIX] product: prevent printing labels for archived products
Steps to reproduce the bug:
- Create a storable product
- Archive it
- Try to print labels

Problem:
A traceback is triggered, Because when we click on print the label
we have to open the wizard, so we load the wizard model
`product.label.layout` via an onchange:
https://github.com/odoo/odoo/blob/15.0/odoo/models.py#L6357-L6360
thanks to the context, it will find the concerned product
(via default_product_id) Except that the product is archived,
so ignored in the result returned by the onchange

therefore, in the confirmation, we will create the wizard,
but it will not have a product filled, so in the `_prepare_report_data`
function we do not enter in the if or the elif:
https://github.com/odoo/odoo/blob/d9f45ba6941939b3d4b40beb5abbc330be84d695/addons/product/wizard/product_label_layout. py#L49-L54

it will therefore raise a traceback when we want to iterate on it:
https://github.com/odoo/odoo/blob/d9f45ba6941939b3d4b40beb5abbc330be84d695/addons/product/wizard/product_label_layout.py#L60

opw-2855659

closes odoo/odoo#97226

X-original-commit: 6dcec12074014434ce1283449700aa352993ac0c
Signed-off-by: Adrien Widart <awt@odoo.com>
2022-08-01 19:37:20 +02:00
Victor Feyens a3ac36c941 [MOV] product: split product views by models
Part-of: odoo/odoo#84997
2022-02-21 13:14:02 +00:00
thcl-odoo 11e7954d23 [FIX] product: close 'Labels Printing' wizard after download
Current behavior :
When the download is finished, the wizard stay open

Expected behavior :
Wizard should automatically close after downloading

Reason :
The key `close_on_report_download` wasn't defined during new wizard implementation ( commit d9f45ba694 )

OPW-2710611

closes odoo/odoo#82472

X-original-commit: e50a60573e1f9ad201d4db8607d9ff121cd476c2
Related: odoo/enterprise#23355
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
Signed-off-by: Claude Thibault (thcl) <thcl@odoo.com>
2022-01-11 11:20:59 +00:00
Tiffany Chang (tic) 7bda571cd7 [FIX] product: remove missing field reference from label wizard
The label wizard is extended from product to stock, so we can print
labels even when stock isn't installed (e.g. only purchase or sales
installed). Therefore we shouldn't reference a field that's introduced
in the stock extension (i.e. label wizard will throw a stack trace when
stock is not installed).

Noticed during task: 2678336

X-original-commit: 9aeba3668e89f14bcfa4ea37861f33ad9add86d8
Part-of: odoo/odoo#80079
2021-11-19 12:50:58 +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
Siddarth Gajjar 34cfd0df0d [REM] product: removed older product pricelist report 2019-12-23 08:17:35 +00:00
Victor Feyens 088de4f1eb [FIX] *: see pricelists when enabled
Since 
https://github.com/odoo/odoo/commit/e88fe6f380ed5682f2cedad16ba13ca43a3828c2 
, the groups to have access to pricelists is `group_product_pricelist`, 
not `group_sale_pricelist` anymore.

`group_sale_pricelist` is now a technical group enabling access to 
advanced pricelist rules (percentage/discount).
2019-08-22 15:27:59 +00:00
Adrian Torres 4b38cc6590 [REM] *: calls to @api.multi
Multi is the default api for methods, it is not necessary to explicitly
decorate methods with it, adds clutter and most people use it because
they see that the rest of the code uses it.

Done with `find . -type f -name '*.py' | xargs sed -i '/@api.multi/d'`
2019-07-17 14:13:12 +02:00
Hiral Bhavsar 3cd7ed07a2 [IMP] *: remove 'view_type' on window actions.
The old tree views don't really exist anymore, this odd pseudo-flag to
dispatch between "list" and "tree" tree views has no reason to remain.

Task 1937686

closes odoo/odoo#31243

Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
2019-06-17 11:34:17 +00:00
Yannick Tivisse f5dfe4727c [IMP] api.py: Rename company_id/company_ids into company/companies
The goal is to be coherent with the user property.

Actually, company_id and company_ids on the environment are no fields.

Calling env.company_id returns a browse record, not an id.
2019-05-29 08:09:15 +00:00
Xavier Morel 10f1a1a0c4 [REM] multi from ir.actions.act_window
Task 1843603

* src_model is redundant with binding_model_id
* multi -> binding_view_types (if empty => all views) (maybe should be
empty by default yo?)
* in convert, type => rec.get(type) but no @type possible on <act_window>...
* removed deprecated auto_refresh & auto_search (not used anywhere (?))

closes odoo/odoo#24738

Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
2019-05-27 12:00:39 +00:00
Yannick Tivisse a5b6f31cf2 [IMP] base: Contextualize the multi company
Purpose
=======

Allow the user to select the allowed companies for which he wants to see records
on top of selecting his current company.

It is confusing for users to see the records from the company he is connected to
and the records of the children companies.

Instead of using the hierarchy of companies to access records across companies,
the user can now select (from his set of allowed companies) the companies for
which he wants to access records.

/!\ This means that the user will interact with records from company A when in
company B.
Example: a SO has been created and confirmed in A. When in B, I create the
invoice from it.

Specifications
==============

1/ Deprecate the parent/children hierarchy on the res.company model. The fields are
kept on the res.company model to ensure the retro-compatibility, but won't be used
accross the standard code anymore. The only functional usage for this mechanism
was to allow to see records from several companies by creating a virtual parent
company, which will be possible with the new mechanism.

2/ By default, a user will only see the records of the company he is connected
to (or records without a company). (It is still editable by the user if needed).
For that, put this information in the user context, to allow having different
configurations on different browser tabs. Instead of having domains like
['|',
('company_id', '=', False),
('company_id', 'child_of', user.company_id.id)]
you'll have something like
['|',
('company_id', '=', False),
('company_id', 'in', company_ids)]
Note that the 'company_ids' is a value that is passed in the evaluation
context on the record rule, as we already have user, or time.
company_ids is a list of the ids of all the enabled companies in the
user's context.

3/ Out of the generic improvements brought by this task, this will illustrate
issues that could exist since several versions. For example, it should not be
possible to create a scrap order for the company A with a package of the company
B, or it should not be possible to create an invoice on the company A with
payment terms from the company B. Before the version 12.0, it was easy to
encounter this kind of issues as the admin was the SUPERUSER_ID. A positive side
effect of the fact that the SUPERUSER_ID has become an inactive user was to
make it more difficult to introduce mismatch on the records, but haven't solved
the issue, as it was still possible to do it with parent companies
configuration. Some of these issues have been fixed in this commit, but all the
business flows should be re-tested to check if an ir.rule should be introduced
(eg: a multi company rule for stock.quand.package), if the company of a record
is correctly transfered to another record created from the first record (eg:
From a SO, create an invoice and a payment, the company of the sales order
should be transfered on the invoice and the payment, even if the company of the
sales order is A and I'm logged into the company B with the company A enabled.

4/ Currently, if I click on a button on a notification email (example 'View
Task'), I face a traceback if I'm not logged into the company of the record.
Now, if you click on a button and if you have access to the record, the correct
company will be automatically set.

5/ If I display a kanban view with several records from several companies (and
an image), all the images should be displayed.

6/ Currently if you copy paste an url, this will crash if you're not in the
correct company. This won't be fixed because it's quite impossible to do it in
a clean way. This task brings a workaround. Copy/Paste -> Traceback -> Log into
the correct company, re-copy/paste -> Ok.

7/ 2 property methods have been added on the environment to retrieve the company
on which the user is logged in and the companies the user enabled, on a specific
tab.
That way, when creating a record, instead of doing
default=lambda self: self.env.user.company_id
do
default=lambda self: self.env.company_id
On the other hand, to retrieve the enabled companies, do
companies = self.env.company_ids

8/ Modify the Company Switcher widget to allow to log into another company
WITHOUT writing on the res.users (and thus bringing cache invalidation issues
and so on). Also allow to enable several companies and see records from several
companies, and independantly of the other browser's tabs.

9/ When focusing on a tab, save the current company configuration on the local
storage. That way, when doing 'CTRL+T' or a middle click, the context is
propagated to the new tab.

10/ Improve the error message in case of multi company access errors. Now, when
the user is in debug mode, display the related names of the records and the name
of the user who brings the issue.

11/ Remove the context erasing when writing on a res.users
This is probably coming from the migration to new API of the base module.
The context was not propagated at this moment, which was a common mistake at
that time. When migrating the module, probably by using the 'black box' method,
as the context was not propagated, it was erased on the new version. This is
now an issue because the context (i.e. the enabled companies) was erased when
writing on a res.users, leading to tracebacks.
See: https://github.com/odoo/odoo/commit/7eab8e26d3d46c53f4be924d6a34e80a66e74960#diff-4c2e738ee8f64f11806c889ea097b5e7R624

12/ Fix the crash manager on redirect warnings. The issue is the following
- Create an invoice on a company without a configured CoA.
- Set a partner
- On the onchange_partner_id, a redirect warning is raised to propose you
to configure a CoA
- Click on 'Go to the configuration panel'
- A generic warning says something like 'Do you want to discard your changes?'
- Click on yes, the page refreshes, but not on the redirect action.
Now, set correctly the action on the hash, and reload instead. The breadcrumb is
lost for example, but you reach the correct action at least.

13/ Introduce a res.group to enable/disable the multi company per tab
feature.

14/ To help the users to know which tab is in which company, add the
possibility to have a favicon per company. When creating a company,
the classical 'O' icon is colored by default in a random color.

15/ Remove the company switcher on the frontend. This was mainly there
to allow a user to swicth to the company linked to the website.
This behavior is now transparent to the user. If the website A is
activated, then the company set on the context is the company of the
website.

16/ Deprecated the _company_default_get method on the res.company
model. Remove the method _get_company on the res.users model.

17/ Add 'allowed_company_ids' and 'current_company_id' on the pyeval
context. You can now use those variables on domains in the views to
access directly to the activated company.ies on the current tab.

TaskID: 1960971

closes odoo/odoo#32341

Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2019-05-13 08:57:49 +00: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
Christophe Matthieu 61eef73b52 [IMP] base, *: use a many2one for the company report layout
Before this rev. one could set the report layout on the company using a
hardcoded list (background, clean, standard, etc.). Other modules (typically
accounting modules) could add options in this list. The used template was built
on the layout key.

Now, the layout is a many2one field to a newly created model `report.layout`,
which is linked to a view with the layout architecture.

This gives more control to customize reports and create a new layout (without
creating a python module that extend the layout selection).
2018-08-13 17:09:28 +02:00
qsm-odoo c59380bac5 [REF] *: BS4, rename btn-default to btn-secondary
BS4 "btn-default" class was replaced with "btn-secondary", which makes
more sense.
2018-07-27 12:36:54 +02:00
Christophe Simonis e90cd4aa73 [MERGE] forward port branch saas-16 up to 1581d31b3e 2017-07-11 16:28:36 +02:00
Christophe Simonis 1581d31b3e [MERGE] forward port branch saas-15 up to 0f2a06e29b 2017-07-11 16:06:17 +02:00
Goffin Simon 2b307b37ff [FIX] product: Print Price list
When printing a report, if the company logo or report layout
is not set, it will return an action (ir.actions.act_window)
to set the layout or the logo.
But this change of actions does not forward the data parameters
to print the price list. So it raised an error.

PS: the problem comes from function "set_report_template" which doesn't
take the data parameters into account when it is called from "res.company.report.form".

opw:749724
2017-07-10 14:50:04 +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
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
Thibault Delavallée 1aa5bc0fdf [MIG] product: migrate addon to new API 2016-08-01 15:05:33 +02:00
mdi-odoo 75867d7bf6 [MOV] product: reorganize addon directory 2016-08-01 12:13:08 +02:00
Yannick Tivisse 42b891700e [FIX] report: allow 'get_action' to receive id, ids or browse records as 'docids'
1/ If no docids are passed in get_action (empty list) do not put in context

2/ The method should accept ids or browse records as docids for retrocompatibility.
- The api.v7 method took ids as docids
- The api.v8 method took a browse records 'records' to call the api.v7 method with
  'records.ids' as docids
In python, we cannot write 2 functions with the same name that takes differents types
for the same argument. The function 'guess' in api.py will lead to a crash if we expect
a browse record and we send a list
The only way to allow the method to receive different types for the same argument is
to decorate it with '@api.noguess' to prevent any effect from guess method.
That way, we check directly if 'docids' is an id, ids or a browserecord and we always set
a list instead.
2016-07-29 12:20:41 +02:00
rka-odoo 47c67b640b [MIG] report: Migration to new API 2016-07-19 11:56:29 +02:00
Ronak Baxi 393f136509 [IMP] *: Uniformize all modal footers
The main button has classnames btn btn-primary.
Other buttons have classnames btn btn-default.
No more 'or' between the buttons.
2015-08-19 08:10:45 +02:00
Olivier Dony 0bd4545348 [LEGAL] Use global LICENSE/COPYRIGHT files, remove boilerplate text
- Preserved explicit 3rd-party copyright notices
- Explicit boilerplate should not be necessary - copyright law applies
  automatically in all countries thanks to Berne Convention + WTO rules,
  and a reference to the applicable license is clear enough.
2015-06-02 03:16:04 +02:00
Leonardo Donelli 4a0b13ed92 [REF] remove vim modelines and resulting trailing blank lines
Let 2015 be a year without modelines!
cf #4174
2014-12-31 15:52:13 +01:00
Fabien Meghazi faa09da325 Removed version="7.0" from form views 2014-06-12 09:09:59 +02:00
Simon Lejeune 7be29e97c4 [IMP] Product pricelist converted to QWeb
bzr revid: sle@openerp.com-20140414155212-4l3gvys24prccln6
2014-04-14 17:52:12 +02:00
Vo Minh Thu e69326ee3b [REF] removed explicit model instanciations.
bzr revid: vmt@openerp.com-20130415102349-vgcrfok2k5y10cwz
2013-04-15 12:23:49 +02:00
Vo Minh Thu e7f4891d46 [IMP] use the openerp namespace.
bzr revid: vmt@openerp.com-20121206145632-0h1coh5aaem65wsy
2012-12-06 15:56:32 +01:00
Twinkle Christian (OpenERP) fc1b1749a8 [IMP]Remove type field from the modules
bzr revid: tch@tinyerp.com-20120809060516-zgx3gdyv6wdshfyw
2012-08-09 11:35:16 +05:30
Fabien Pinckaers 64a9321d56 [IMP] footer on forms
bzr revid: fp@tinyerp.com-20120710164011-unqi1okf2uu8yhts
2012-07-10 18:40:11 +02:00
Raphael Collet 5133bee1d5 [FIX] in form views, replace class 'oe_highlight_on_dirty' by 'oe_highlight'
bzr revid: rco@openerp.com-20120629083024-rqhtbf9melkygg0m
2012-06-29 10:30:24 +02:00
Randhir Mayatra (OpenERP) a4b94dbee6 [USA] add cancel button
bzr revid: rma@tinyerp.com-20120627141917-bs9bg2j3dasy9n1y
2012-06-27 19:49:17 +05:30
Twinkle (OpenERP) 471037495c [IMP]Apply css class flow on wizards buttons
bzr revid: tch@tinyerp.com-20120626063119-5i93di16milljxap
2012-06-26 12:01:19 +05:30
Twinkle (OpenERP) 0e97cefe9e [IMP]Improve wizard button
bzr revid: tch@tinyerp.com-20120625100901-ucjbttxod55erqmf
2012-06-25 15:39:01 +05:30
Twinkle (OpenERP) 660cc67256 [IMP]Added highlight button on wizard
bzr revid: tch@tinyerp.com-20120620104923-z1hty740vn160fg9
2012-06-20 16:19:23 +05:30
ajay javiya (OpenERP) 4311eaa121 [REM] : Remove cancel button from wizard
bzr revid: aja@tinyerp.com-20120618091236-3e8vhdb4thokf72i
2012-06-18 14:42:36 +05:30
Fabien Pinckaers 746610f234 [IMP] better form views
bzr revid: fp@tinyerp.com-20120609215628-0ro72kp0hzni67j9
2012-06-09 23:56:28 +02:00
Fabien Pinckaers e715b8cbce [IMP] better form views, new guidelines
bzr revid: fp@tinyerp.com-20120609153741-gkmqamwbr0s84wy6
2012-06-09 17:37:41 +02:00
Mayur Maheshwari (OpenERP) 9e59ce8812 [IMP]all: Improve all typos
bzr revid: mma@tinyerp.com-20120424060532-ohrf0sxwq8rpq6ls
2012-04-24 11:35:32 +05:30
Raphael Collet dade28f47d [IMP] config wizards: remove ir.actions.todo that are no longer useful
bzr revid: rco@openerp.com-20120403132618-qtwtg6aafig61wu4
2012-04-03 15:26:18 +02:00
Raphael Collet ff05f5dd8f [IMP] product: rename xml ids of new usability groups
bzr revid: rco@openerp.com-20120321100144-h5f6jjuz45p2qi6r
2012-03-21 11:01:44 +01:00
Ujjvala Collins (OpenERP) e2c8783f1b [ADD]: Added common configuration for UoM per product group.
bzr revid: uco@tinyerp.com-20120312102702-xp63smj3qcn1eu31
2012-03-12 15:57:02 +05:30
Stephane Wirtel e123082d88 [IMP] Add missing configuration wizards
bzr revid: stw@openerp.com-20110922131300-uudx3uwhkyaj3ry0
2011-09-22 15:13:00 +02:00
Rucha (Open ERP) 33a03774b2 [MERGE]: Merged with latest trunk-addons as there are many changes regarding config wizards
bzr revid: rpa@tinyerp.com-20110805060610-dg2vy1e62qxoycjo
2011-08-05 11:36:10 +05:30
Xavier Morel 09cf4d40d0 [FIX] convert ir.actions.todo fields to match model definition changes
* type = special => type = automatic
* type = recurring | normal => type = normal
* default type special => normal
* state = hidden => state = done

bzr revid: xmo@openerp.com-20110729140324-0nxus4p8ufj46z9y
2011-07-29 16:03:24 +02:00
Xavier Morel cc13113641 [REF] reformat xml files before applying automated search&replace on them
bzr revid: xmo@openerp.com-20110729134810-oiqptqs2omvo7o7c
2011-07-29 15:48:10 +02:00