From 622eb6b74711883606e44f6de51f4485b478606b Mon Sep 17 00:00:00 2001 From: len-odoo Date: Wed, 31 Oct 2018 12:14:48 +0000 Subject: [PATCH 01/39] [FIX] sale_stock: compute quantity differentiating incoming and outgoing pickings Suppose that you have a SO that you deliver. Then the client returns the products, getting a refund, which creates an incoming picking. If you do then update the product sold quantity, the quantity to deliver is computed by summing the relevant picking. We now discriminate incoming and outgoing picking, respectively substracting and adding the quantities. opw 1903559 closes odoo/odoo#28315 --- addons/sale_stock/models/sale_order.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/addons/sale_stock/models/sale_order.py b/addons/sale_stock/models/sale_order.py index e15de519516..de5cb54851c 100644 --- a/addons/sale_stock/models/sale_order.py +++ b/addons/sale_stock/models/sale_order.py @@ -225,7 +225,10 @@ class SaleOrderLine(models.Model): self.ensure_one() qty = 0.0 for move in self.move_ids.filtered(lambda r: r.state != 'cancel'): - qty += move.product_uom._compute_quantity(move.product_uom_qty, self.product_uom, rounding_method='HALF-UP') + if move.picking_code == 'outgoing': + qty += move.product_uom._compute_quantity(move.product_uom_qty, self.product_uom, rounding_method='HALF-UP') + elif move.picking_code == 'incoming': + qty -= move.product_uom._compute_quantity(move.product_uom_qty, self.product_uom, rounding_method='HALF-UP') return qty @api.multi From 9c7043d2356b239704a278ef32a2d77fb4c893a2 Mon Sep 17 00:00:00 2001 From: mreficent Date: Mon, 5 Nov 2018 15:28:39 +0100 Subject: [PATCH 02/39] [IMP] account: test data: don't define any currency on test bank journal The constraint introduced in https://github.com/odoo/odoo/commit/22f0da809e84618901b7ca4b78582abd64c03c55 raised in case the currency of the company loading the test data was also USD. --- addons/account/test/account_minimal_test.xml | 1 - 1 file changed, 1 deletion(-) diff --git a/addons/account/test/account_minimal_test.xml b/addons/account/test/account_minimal_test.xml index e127af9b289..5e1753efbfc 100644 --- a/addons/account/test/account_minimal_test.xml +++ b/addons/account/test/account_minimal_test.xml @@ -284,7 +284,6 @@ bank - From 5de5953ae7d60748ae7d7a2a66437d63fa8bec3f Mon Sep 17 00:00:00 2001 From: Andrea Stirpe Date: Fri, 24 Aug 2018 15:20:00 +0200 Subject: [PATCH 03/39] [FIX] account_asset: domain in multicompany In a multicompany environment, an user who has access to multiple companies is able to select accounts and analytic accounts of multiple companies. This can easily lead to mistakes in the definition of the asset category. With this commit the user can only read/select accounts and analytic accounts belonging to the company already set in the asset category. This is what is already done in most invoice or other accounting views Closes #26578 --- addons/account_asset/views/account_asset_views.xml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/addons/account_asset/views/account_asset_views.xml b/addons/account_asset/views/account_asset_views.xml index f569a6b60b1..6689500c0ac 100644 --- a/addons/account_asset/views/account_asset_views.xml +++ b/addons/account_asset/views/account_asset_views.xml @@ -28,18 +28,18 @@ - + kanban From 1767f2186d230cfa38a2b83f66628922e5849298 Mon Sep 17 00:00:00 2001 From: "Julien (juc) Castiaux" Date: Tue, 13 Nov 2018 12:57:52 +0000 Subject: [PATCH 26/39] [FIX] delivery: useless conversion to company currency when no company After removing the company from a delivery method, every checkout done in website fails due to odoo trying to convert the price to the company currency. This PR fix the bug by doing the conversion only when there is a company set on the delivery method. opw-1905466 closes odoo/odoo#28626 --- addons/delivery/models/delivery_carrier.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/delivery/models/delivery_carrier.py b/addons/delivery/models/delivery_carrier.py index 50bb9202ddc..d1e76fae927 100644 --- a/addons/delivery/models/delivery_carrier.py +++ b/addons/delivery/models/delivery_carrier.py @@ -206,7 +206,7 @@ class DeliveryCarrier(models.Model): 'error_message': _('Error: this delivery method is not available for this address.'), 'warning_message': False} price = self.fixed_price - if self.company_id.currency_id.id != order.currency_id.id: + if self.company_id and self.company_id.currency_id.id != order.currency_id.id: price = self.env['res.currency']._compute(self.company_id.currency_id, order.currency_id, price) return {'success': True, 'price': price, From da2d415b7977a2bb24d2b15fc68f088264c41a36 Mon Sep 17 00:00:00 2001 From: Nicolas Martinelli Date: Tue, 13 Nov 2018 12:55:09 +0000 Subject: [PATCH 27/39] [FIX] sale: date on Sales Analysis Use a consistent date between both views of the Sales Analysis report, otherwise switching from one view to another shows a different information. opw-1903091 closes odoo/odoo#28625 --- addons/sale/report/sale_report_views.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/sale/report/sale_report_views.xml b/addons/sale/report/sale_report_views.xml index 317e0e83355..3b054cf6429 100644 --- a/addons/sale/report/sale_report_views.xml +++ b/addons/sale/report/sale_report_views.xml @@ -18,7 +18,7 @@ sale.report - + From 6123cc912cd0878ab83c5ef379ea54b043e62d89 Mon Sep 17 00:00:00 2001 From: Goffin Simon Date: Tue, 13 Nov 2018 10:18:14 +0000 Subject: [PATCH 28/39] [FIX]purchase_requisition: Creating requistions from OP Steps to reproduce the bug: - Create a product : stockable + purchase : propose a call for tenders + reordering rule (qty min 0, max 0, multiple 1) - Create a SO for that product. - Run the scheduler once : a requistion is generated (Purchases > Purchase > Purchase Agreements), which is normal behavior - Run the scheduler a second time Bug: A new requistion was generated for the same product, by the same reordering rule opw:1892950 closes odoo/odoo#28611 --- .../models/purchase_requisition.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/addons/purchase_requisition/models/purchase_requisition.py b/addons/purchase_requisition/models/purchase_requisition.py index 650d442da1a..c752cd9189f 100644 --- a/addons/purchase_requisition/models/purchase_requisition.py +++ b/addons/purchase_requisition/models/purchase_requisition.py @@ -337,3 +337,14 @@ class ProcurementRule(models.Model): values['picking_type_id'] = self.picking_type_id.id self.env['purchase.requisition'].create(values) return True + +class Orderpoint(models.Model): + _inherit = "stock.warehouse.orderpoint" + + def _quantity_in_progress(self): + res = super(Orderpoint, self)._quantity_in_progress() + for op in self: + for pr in self.env['purchase.requisition'].search([('state','=','draft'),('origin','=',op.name)]): + for prline in pr.line_ids.filtered(lambda l: l.product_id.id == op.product_id.id): + res[op.id] += prline.product_uom_id._compute_quantity(prline.product_qty, op.product_uom, round=False) + return res From 526bfca3afc2dc4bcc2565912705be4cf738267d Mon Sep 17 00:00:00 2001 From: "Lucas Perais (lpe)" Date: Wed, 19 Sep 2018 15:44:34 +0000 Subject: [PATCH 29/39] [FIX] base_address_city: correct view_get with address fields Have a partner with children exceeding the limit of the kanban. Edit, Add a contact > save and quit Save the partner Before this commit, there was a traceback, because a check on parent_id was done to compute the modifier readonly of the city fields in subviews However, python onchange gets rid of parent_id because child_ids and parent_id are two faces of the same coin And if that check were not done, we would end up in an infinite recursion After this commit, there is no traceback, as we stop checking on parent_id in the case of paged subviews (list and kanban) because we literally know there is one OPW 1886320 closes odoo/odoo#27114 --- .../base_address_city/models/res_partner.py | 57 ++++++++++++++++--- 1 file changed, 49 insertions(+), 8 deletions(-) diff --git a/addons/base_address_city/models/res_partner.py b/addons/base_address_city/models/res_partner.py index 2f43935b0c2..5b98ac65ef6 100644 --- a/addons/base_address_city/models/res_partner.py +++ b/addons/base_address_city/models/res_partner.py @@ -25,17 +25,58 @@ class Partner(models.Model): # render the partner address accordingly to address_view_id doc = etree.fromstring(arch) if doc.xpath("//field[@name='city_id']"): - return arch - for city_node in doc.xpath("//field[@name='city']"): - replacement_xml = """ + return arch + + replacement_xml = """
- - + +
- """ % (_('City'), _('City')) - city_id_node = etree.fromstring(replacement_xml) - city_node.getparent().replace(city_node, city_id_node) + """ + + replacement_data = { + 'placeholder': _('City'), + } + + def _arch_location(node): + in_subview = False + view_type = False + parent = node.getparent() + while parent is not None and (not view_type or not in_subview): + if parent.tag == 'field': + in_subview = True + elif parent.tag in ['list', 'tree', 'kanban', 'form']: + view_type = parent.tag + parent = parent.getparent() + return { + 'view_type': view_type, + 'in_subview': in_subview, + } + + for city_node in doc.xpath("//field[@name='city']"): + location = _arch_location(city_node) + replacement_data['parent_condition'] = '' + if location['view_type'] == 'form' or not location['in_subview']: + replacement_data['parent_condition'] = ", ('parent_id', '!=', False)" + + replacement_formatted = replacement_xml % replacement_data + for replace_node in etree.fromstring(replacement_formatted).getchildren(): + city_node.addprevious(replace_node) + parent = city_node.getparent() + parent.remove(city_node) arch = etree.tostring(doc, encoding='unicode') return arch From 21976ca838458b29553be6b5aa33e2c674401c92 Mon Sep 17 00:00:00 2001 From: lul-odoo Date: Tue, 13 Nov 2018 08:16:59 +0000 Subject: [PATCH 30/39] [FIX] base: Fix rng for 'templates' tag in calendar view The following commit https://github.com/odoo/odoo/commit/76e6a0e3560db8257ab0d183463a894ace1e3a7e renamed in the js calendar view file the template tag from 'template' to 'templates' but forgot to rename it in the rng file. Since that commit templates in calendar views are not working. This commit fixes this issue. closes odoo/odoo#28601 --- odoo/addons/base/rng/calendar_view.rng | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/odoo/addons/base/rng/calendar_view.rng b/odoo/addons/base/rng/calendar_view.rng index 949c3f48318..500a61b3389 100644 --- a/odoo/addons/base/rng/calendar_view.rng +++ b/odoo/addons/base/rng/calendar_view.rng @@ -32,7 +32,7 @@ - + From 8f99013d01682b9b1f2399a363023d6fa8f8650d Mon Sep 17 00:00:00 2001 From: Sanjay Jamod Date: Wed, 14 Nov 2018 06:00:04 +0000 Subject: [PATCH 31/39] [FIX] website: method should be called with action not with self to avoid 'Expected singleton error' OPW: 1909205 closes odoo/odoo#28648 --- addons/website/models/ir_actions.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/website/models/ir_actions.py b/addons/website/models/ir_actions.py index f26d6263004..4add5587d7f 100644 --- a/addons/website/models/ir_actions.py +++ b/addons/website/models/ir_actions.py @@ -38,7 +38,7 @@ class ServerAction(models.Model): def _get_website_url(self): for action in self: if action.state == 'code' and action.website_published: - action.website_url = self._compute_website_url(action.website_path, action.xml_id) + action.website_url = action._compute_website_url(action.website_path, action.xml_id) @api.model def _get_eval_context(self, action): From c70bdd0e4e807d5a218b3b389e4573fe505f92e2 Mon Sep 17 00:00:00 2001 From: "Lucas Perais (lpe)" Date: Tue, 13 Nov 2018 11:15:24 +0000 Subject: [PATCH 32/39] [FIX] account: do not check for company logo when printing reports Have a company that do not have a logo. Try to print a "PDF report" from the accounting module Before this commit, the simple company form popped up with the purpose of force setting a company logo After this commit, we assume it is not necessary to have a company logo on the reports Note, because of 733ce266ef793652f5958c24e2a8a6f443432552, we cannot do a save and print OPW 1904764 closes odoo/odoo#28617 --- addons/account/wizard/account_report_common.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/account/wizard/account_report_common.py b/addons/account/wizard/account_report_common.py index f7cba985485..58090fdde79 100644 --- a/addons/account/wizard/account_report_common.py +++ b/addons/account/wizard/account_report_common.py @@ -36,4 +36,4 @@ class AccountCommonReport(models.TransientModel): data['form'] = self.read(['date_from', 'date_to', 'journal_ids', 'target_move'])[0] used_context = self._build_contexts(data) data['form']['used_context'] = dict(used_context, lang=self.env.context.get('lang') or 'en_US') - return self._print_report(data) + return self.with_context(discard_logo_check=True)._print_report(data) From 069c2f230476c8b47cebc0afe5a29893a9ae39dc Mon Sep 17 00:00:00 2001 From: qdp-odoo Date: Fri, 9 Nov 2018 15:25:54 +0100 Subject: [PATCH 33/39] [FIX] account: fix invoice access rights removed the access right that was granting the read access on invoices to any internal user, because there's no reason to do so. Fixes #28486 --- addons/account/security/ir.model.access.csv | 2 -- 1 file changed, 2 deletions(-) diff --git a/addons/account/security/ir.model.access.csv b/addons/account/security/ir.model.access.csv index f9d21696d8f..96251b2f451 100644 --- a/addons/account/security/ir.model.access.csv +++ b/addons/account/security/ir.model.access.csv @@ -36,8 +36,6 @@ access_account_journal_invoice,account.journal invoice,model_account_journal,acc access_account_invoice_group_invoice,account.invoice group invoice,model_account_invoice,account.group_account_invoice,1,1,1,1 access_res_currency_account_manager,res.currency account manager,base.model_res_currency,group_account_manager,1,1,1,1 access_res_currency_rate_account_manager,res.currency.rate account manager,base.model_res_currency_rate,group_account_manager,1,1,1,1 -access_account_invoice_user,account.invoice user,model_account_invoice,base.group_user,1,0,0,0 -access_account_invoice_user,account.invoice.line user,model_account_invoice_line,base.group_user,1,0,0,0 access_account_payment_term_partner_manager,account.payment.term partner manager,model_account_payment_term,base.group_user,1,0,0,0 access_account_payment_term_line_partner_manager,account.payment.term.line partner manager,model_account_payment_term_line,base.group_user,1,0,0,0 access_account_fiscal_position_product_manager,account.fiscal.position account.manager,model_account_fiscal_position,account.group_account_manager,1,1,1,1 From 0db2d4b3071fc779f9931efdb0002258232dcf0a Mon Sep 17 00:00:00 2001 From: Gert Pellin Date: Mon, 12 Nov 2018 15:57:19 +0100 Subject: [PATCH 34/39] [FIX] point_of_sale: order selector buttons On to many open orders the + and - buttons will be pushed out of view. This makes it impossible to close orders without checking out. --- addons/point_of_sale/static/src/css/pos.css | 2 ++ 1 file changed, 2 insertions(+) diff --git a/addons/point_of_sale/static/src/css/pos.css b/addons/point_of_sale/static/src/css/pos.css index 0673494853c..5cc01acc0ff 100644 --- a/addons/point_of_sale/static/src/css/pos.css +++ b/addons/point_of_sale/static/src/css/pos.css @@ -436,6 +436,8 @@ td { display: flex; -webkit-flex: 1; flex: 1; + max-width: -moz-available; + max-width: -webkit-fill-available; } .pos .orders { display: -webkit-flex; From 8cdfe1d8fe09b4f5bf808fc38ac812780e807c40 Mon Sep 17 00:00:00 2001 From: RomainLibert Date: Wed, 14 Nov 2018 12:59:10 +0100 Subject: [PATCH 35/39] [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 --- addons/product/report/product_pricelist.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/product/report/product_pricelist.py b/addons/product/report/product_pricelist.py index 56027e7ffe4..4009999f4d2 100644 --- a/addons/product/report/product_pricelist.py +++ b/addons/product/report/product_pricelist.py @@ -16,7 +16,7 @@ class report_product_pricelist(models.AbstractModel): quantities = self._get_quantity(data) docargs = { 'doc_ids': data.get('ids', data.get('active_ids')), - 'doc_model': 'hr.contribution.register', + 'doc_model': 'product.pricelist', 'docs': products, 'data': dict( data, From d5a540f3ba91bcb855d489b7b5fb312b4e7c221b Mon Sep 17 00:00:00 2001 From: Sebastien LANGE Date: Wed, 14 Nov 2018 16:31:16 +0000 Subject: [PATCH 36/39] [CLA] Subteno IT --- doc/cla/corporate/subteno-it.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 doc/cla/corporate/subteno-it.md diff --git a/doc/cla/corporate/subteno-it.md b/doc/cla/corporate/subteno-it.md new file mode 100644 index 00000000000..8bcf028ec2d --- /dev/null +++ b/doc/cla/corporate/subteno-it.md @@ -0,0 +1,16 @@ +France, 2018-11-14 + +Subteno IT agrees to the terms of the Odoo Corporate Contributor License +Agreement v1.0. + +I declare that I am authorized and able to make this agreement and sign this +declaration. + +Signed, + +Sébastien LANGE sebastien.lange@subteno-it.fr https://github.com/sla-subteno-it + +List of contributors: + +Christian LECOUFLE christian.lecoufle@subteno-it.fr https://github.com/cle-subteno-it +Vincent COFFIN vincent.coffin@subteno-it.fr https://github.com/vco-subteno-it From 9148d86f35fe99c0af21ade9d497e8534510aac6 Mon Sep 17 00:00:00 2001 From: Goffin Simon Date: Wed, 14 Nov 2018 12:30:25 +0000 Subject: [PATCH 37/39] [FIX] sale_stock: Decreasing ordered quantity on a SO Steps to reproduce the bug: - Set decimal precision to 7 for products. - Order 2.000000 of a product. - Deliver 2.6791200 of the product. - Go back to the Sales order and change the ordered quantity to 2.6791200. Bug: A UserError was raised: "You cannot decrease the ordered quantity below the delivered quantity." opw:1904580 closes odoo/odoo#28674 --- addons/sale_stock/models/sale_order.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/addons/sale_stock/models/sale_order.py b/addons/sale_stock/models/sale_order.py index de5cb54851c..da048baa577 100644 --- a/addons/sale_stock/models/sale_order.py +++ b/addons/sale_stock/models/sale_order.py @@ -347,7 +347,8 @@ class SaleOrderLine(models.Model): return is_available def _update_line_quantity(self, values): - if self.mapped('qty_delivered') and values['product_uom_qty'] < max(self.mapped('qty_delivered')): + precision = self.env['decimal.precision'].precision_get('Product Unit of Measure') + if self.mapped('qty_delivered') and float_compare(values['product_uom_qty'], max(self.mapped('qty_delivered')), precision_digits=precision) == -1: raise UserError('You cannot decrease the ordered quantity below the delivered quantity.\n' 'Create a return first.') for line in self: From 8a9569b31e503562c046722901dbc9c51e7b5118 Mon Sep 17 00:00:00 2001 From: mao-odoo Date: Thu, 15 Nov 2018 13:22:39 +0100 Subject: [PATCH 38/39] [FIX] auth_signup: Error when sending quotation Fine tuning of this commit:https://github.com/odoo/odoo/commit/7501691da9a9dae832b7d6e78c6a5f57fc983b5c Fields signup_token, signup_type, signup_expiration are protected When sending a quotation (mail template 'Sales Order - Send by Email'): the token needs to be read (and sometimes written) opw:1907157 --- addons/auth_signup/models/res_partner.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/addons/auth_signup/models/res_partner.py b/addons/auth_signup/models/res_partner.py index 2e40558617a..60e4f068331 100644 --- a/addons/auth_signup/models/res_partner.py +++ b/addons/auth_signup/models/res_partner.py @@ -59,17 +59,17 @@ class ResPartner(models.Model): for partner in self: # when required, make sure the partner has a valid signup token if self.env.context.get('signup_valid') and not partner.user_ids: - partner.signup_prepare() + partner.sudo().signup_prepare() route = 'login' # the parameters to encode for the query query = dict(db=self.env.cr.dbname) - signup_type = self.env.context.get('signup_force_type_in_url', partner.signup_type or '') + signup_type = self.env.context.get('signup_force_type_in_url', partner.sudo().signup_type or '') if signup_type: route = 'reset_password' if signup_type == 'reset' else signup_type - if partner.signup_token and signup_type: - query['token'] = partner.signup_token + if partner.sudo().signup_token and signup_type: + query['token'] = partner.sudo().signup_token elif partner.user_ids: query['login'] = partner.user_ids[0].login else: From 55104b915e59780d4b7ffffbc6a697a4539948e8 Mon Sep 17 00:00:00 2001 From: qsm-odoo Date: Wed, 14 Nov 2018 17:43:25 +0100 Subject: [PATCH 39/39] [FIX] website_event: restore event list layout Commit https://github.com/odoo/odoo/commit/b43364af7258e45ad846fbbf1f375ad26e58eb0d introduced a row in a row. On a standard database, the bug is invisible. When the user wants to edit that event list page, the right column... is not on the right anymore. Note: in 12.0, thanks to BS4, the bug was revealed even more as even on a standard non-edited database, the bug is visible. Closes https://github.com/odoo/odoo/pull/28693 --- addons/website_event/views/website_event_templates.xml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/addons/website_event/views/website_event_templates.xml b/addons/website_event/views/website_event_templates.xml index 427fde46ca6..2ababc9cb85 100644 --- a/addons/website_event/views/website_event_templates.xml +++ b/addons/website_event/views/website_event_templates.xml @@ -79,14 +79,14 @@ -
-
- -
-
+
+
+ +
+