From 54d1b38844a79724a77268dc577b771b8c9f6321 Mon Sep 17 00:00:00 2001 From: "Lucas Perais (lpe)" Date: Wed, 16 May 2018 14:46:37 +0200 Subject: [PATCH 01/48] [FIX] point_of_sale: repair cashier from localStorage on refresh page open a pos, change cashier hit F5 Before this commit, the previous user was set as cashier, forgetting about the change we made This was because of two things: - The original fix to do just this use case was pushed in v9.0 as e14ab69 - In v10.0 the commit 475027b (For v11.0: a9caef0) Was intended to update the res.users objects at their loading to ensure that their access rights were loaded too But it did this using the wrong condition After this commit, it reworks fine OPW 1844006 related #24762 closes #24764 --- addons/point_of_sale/static/src/js/models.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/addons/point_of_sale/static/src/js/models.js b/addons/point_of_sale/static/src/js/models.js index 37c115973c4..7cbef6c99dc 100644 --- a/addons/point_of_sale/static/src/js/models.js +++ b/addons/point_of_sale/static/src/js/models.js @@ -255,6 +255,7 @@ exports.PosModel = Backbone.Model.extend({ // we attribute a role to the user, 'cashier' or 'manager', depending // on the group the user belongs. var pos_users = []; + var current_cashier = self.get_cashier(); for (var i = 0; i < users.length; i++) { var user = users[i]; for (var j = 0; j < user.groups_id.length; j++) { @@ -272,6 +273,8 @@ exports.PosModel = Backbone.Model.extend({ // replace the current user with its updated version if (user.id === self.user.id) { self.user = user; + } + if (user.id === current_cashier.id) { self.set_cashier(user); } } From cd26eb8e7c3b6062c0c52888fcee0e25d3573728 Mon Sep 17 00:00:00 2001 From: "Lucas Perais (lpe)" Date: Tue, 15 May 2018 13:24:25 +0200 Subject: [PATCH 02/48] [FIX] l10n_fr_fec: EcritureLib should not be empty Make an account move with two move lines. In those lines' label, just hit the space bar, and post your entry. Now, get the FEC report. Before this commit, the EcritureLib field was empty After, it has the value '/' closes #24734 --- addons/l10n_fr_fec/wizard/fec.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/addons/l10n_fr_fec/wizard/fec.py b/addons/l10n_fr_fec/wizard/fec.py index 673b450b789..2d159f96d86 100644 --- a/addons/l10n_fr_fec/wizard/fec.py +++ b/addons/l10n_fr_fec/wizard/fec.py @@ -288,7 +288,9 @@ class AccountFrFec(models.TransientModel): END AS PieceRef, TO_CHAR(am.date, 'YYYYMMDD') AS PieceDate, - CASE WHEN aml.name IS NULL THEN '/' ELSE replace(aml.name, '|', '/') END AS EcritureLib, + CASE WHEN aml.name IS NULL THEN '/' + WHEN aml.name SIMILAR TO '[\t|\s|\n]*' THEN '/' + ELSE replace(aml.name, '|', '/') END AS EcritureLib, replace(CASE WHEN aml.debit = 0 THEN '0,00' ELSE to_char(aml.debit, '000000000000000D99') END, '.', ',') AS Debit, replace(CASE WHEN aml.credit = 0 THEN '0,00' ELSE to_char(aml.credit, '000000000000000D99') END, '.', ',') AS Credit, CASE WHEN rec.name IS NULL THEN '' ELSE rec.name END AS EcritureLet, From a16114efb43da7a14113b061b2ed0f110b668c74 Mon Sep 17 00:00:00 2001 From: Goffin Simon Date: Wed, 16 May 2018 16:41:07 +0200 Subject: [PATCH 03/48] [FIX] mrp: Two fields with the same label on stock.move The field quantity_done_store had the same label as the field product_uom_qty on model "stock.move" and there were confusions in the pivot view of "stock.move". opw:1841097 --- addons/mrp/i18n/mrp.pot | 5 +++++ addons/mrp/models/stock_move.py | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/addons/mrp/i18n/mrp.pot b/addons/mrp/i18n/mrp.pot index f5d87479f26..ffa62334b2a 100644 --- a/addons/mrp/i18n/mrp.pot +++ b/addons/mrp/i18n/mrp.pot @@ -2161,6 +2161,11 @@ msgstr "" msgid "Quantity To Produce" msgstr "" +#. module: mrp +#: model:ir.model.fields,field_description:mrp.field_stock_move_quantity_done_store +msgid "Quantity done store" +msgstr "" + #. module: mrp #: model:ir.model.fields,field_description:mrp.field_mrp_routing_workcenter_batch_size msgid "Quantity to Process" diff --git a/addons/mrp/models/stock_move.py b/addons/mrp/models/stock_move.py index c831f49d63d..8fb99e526e9 100644 --- a/addons/mrp/models/stock_move.py +++ b/addons/mrp/models/stock_move.py @@ -91,7 +91,7 @@ class StockMove(models.Model): quantity_available = fields.Float( 'Quantity Available', compute="_qty_available", digits=dp.get_precision('Product Unit of Measure')) - quantity_done_store = fields.Float('Quantity', digits=0) + quantity_done_store = fields.Float('Quantity done store', digits=0) quantity_done = fields.Float( 'Quantity', compute='_qty_done_compute', inverse='_qty_done_set', digits=dp.get_precision('Product Unit of Measure')) From f8d0efee9223eda3bee310e722a74e6a2c48da57 Mon Sep 17 00:00:00 2001 From: Denis Ledoux Date: Thu, 17 May 2018 14:23:23 +0200 Subject: [PATCH 04/48] [FIX] stock: use product qty decimal accuracy in Picking Operations Since revision f6144fe1f36ad44affff785d0e9c2c32d37a8963, the decimal accuracy for the product quantity in the picking operations report was no longer applied, leading to display a bunch of numbers after the comma in some cases. e.g. 15404.000000000002 Unit(s) opw-1846723 --- addons/stock/report/report_stockpicking_operations.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/stock/report/report_stockpicking_operations.xml b/addons/stock/report/report_stockpicking_operations.xml index cbb472a946f..836e0d0e843 100644 --- a/addons/stock/report/report_stockpicking_operations.xml +++ b/addons/stock/report/report_stockpicking_operations.xml @@ -98,7 +98,7 @@ - + From eac4c0badf611820d5af927ea05beaf4752dbebe Mon Sep 17 00:00:00 2001 From: Goffin Simon Date: Thu, 17 May 2018 11:08:39 +0200 Subject: [PATCH 05/48] [FIX] purchase: Print RFQ and status does not change Due to this commit: 98cb4719dbe90dbe980be4ad98f22fe155c2dae1 When printing a RFQ, the status of the quotation didn't change in SENT. opw:1849139 --- addons/purchase/models/purchase.py | 1 + 1 file changed, 1 insertion(+) diff --git a/addons/purchase/models/purchase.py b/addons/purchase/models/purchase.py index f97c8cf7b75..12d20e7a186 100644 --- a/addons/purchase/models/purchase.py +++ b/addons/purchase/models/purchase.py @@ -323,6 +323,7 @@ class PurchaseOrder(models.Model): @api.multi def print_quotation(self): + self.write({'state': "sent"}) return self.env.ref('purchase.report_purchase_quotation').report_action(self) @api.multi From 4e71bd5caf741b8b45b037fc8b4222927801ff18 Mon Sep 17 00:00:00 2001 From: Josse Colpaert Date: Tue, 15 May 2018 17:27:30 +0200 Subject: [PATCH 06/48] [FIX] stock: customer/vendor location empty When creating a new company, the fields customer/vendor location were empty. Now, these fields are set with the internal transit location for the company of the partner and set with Partners Locations/Customers and Partners Locations/Vendors for the other companies. opw:1845753 --- addons/stock/data/stock_data.yml | 5 +++-- addons/stock/models/res_company.py | 4 ++-- addons/stock/models/stock_warehouse.py | 3 ++- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/addons/stock/data/stock_data.yml b/addons/stock/data/stock_data.yml index bf419b360fc..30289281762 100644 --- a/addons/stock/data/stock_data.yml +++ b/addons/stock/data/stock_data.yml @@ -1,8 +1,6 @@ - !python {model: res.partner, id: base.main_partner}: | main_warehouse = self.env['stock.warehouse'].browse(ref('warehouse0')) - self.write({'property_stock_customer':main_warehouse.lot_stock_id.id}) - - !python {model: ir.model.data, id: False}: | main_warehouse = self.env['stock.warehouse'].browse(ref('warehouse0')) @@ -30,4 +28,7 @@ companies = self.search([('internal_transit_location_id', '=', False)]) for company in companies: company.create_transit_location() + internal_transit = company.internal_transit_location_id.id + warehouses = self.env['stock.warehouse'].search([('partner_id', '=', company.partner_id.id)]) + warehouses.mapped('partner_id').with_context(force_company=company.id).write({'property_stock_customer': internal_transit, 'property_stock_supplier': internal_transit}) diff --git a/addons/stock/models/res_company.py b/addons/stock/models/res_company.py index 5308392de51..94a7b58b711 100644 --- a/addons/stock/models/res_company.py +++ b/addons/stock/models/res_company.py @@ -32,8 +32,8 @@ class Company(models.Model): def create(self, vals): company = super(Company, self).create(vals) - # multi-company rules prevents creating warehouse and sub-locations + company.create_transit_location() + # mutli-company rules prevents creating warehouse and sub-locations self.env['stock.warehouse'].check_access_rights('create') self.env['stock.warehouse'].sudo().create({'name': company.name, 'code': company.name[:5], 'company_id': company.id, 'partner_id': company.partner_id.id}) - company.create_transit_location() return company diff --git a/addons/stock/models/stock_warehouse.py b/addons/stock/models/stock_warehouse.py index dd8d2a09d07..661628b2132 100644 --- a/addons/stock/models/stock_warehouse.py +++ b/addons/stock/models/stock_warehouse.py @@ -178,9 +178,10 @@ class Warehouse(models.Model): ResCompany = self.env['res.company'] if company_id: transit_loc = ResCompany.browse(company_id).internal_transit_location_id.id + self.env['res.partner'].browse(partner_id).with_context(force_company=company_id).write({'property_stock_customer': transit_loc, 'property_stock_supplier': transit_loc}) else: transit_loc = ResCompany._company_default_get('stock.warehouse').internal_transit_location_id.id - self.env['res.partner'].browse(partner_id).write({'property_stock_customer': transit_loc, 'property_stock_supplier': transit_loc}) + self.env['res.partner'].browse(partner_id).write({'property_stock_customer': transit_loc, 'property_stock_supplier': transit_loc}) def create_sequences_and_picking_types(self): IrSequenceSudo = self.env['ir.sequence'].sudo() From 866d1e71900fc395a50340dc2ecc645782ad24c5 Mon Sep 17 00:00:00 2001 From: Fabien Meghazi Date: Thu, 17 May 2018 12:51:29 +0200 Subject: [PATCH 07/48] [FIX] server: fix support for systemd socket activation in threaded server This patches fixes the untested and broken draft of inetd and systemd activation support in the threaded server. This patch also fixes the loss of the process environment in the `_reexec()` function when Odoo is respawning during the following events: - SIGHUP signal is received - one click install has been triggered - code reload needed when using `--dev=reload` --- openerp/service/server.py | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/openerp/service/server.py b/openerp/service/server.py index c3baace20dc..af01ea9d54f 100644 --- a/openerp/service/server.py +++ b/openerp/service/server.py @@ -91,9 +91,6 @@ class RequestHandler(werkzeug.serving.WSGIRequestHandler): me = threading.currentThread() me.name = 'openerp.service.http.request.%s' % (me.ident,) -# _reexec() should set LISTEN_* to avoid connection refused during reload time. It -# should also work with systemd socket activation. This is currently untested -# and not yet used. class ThreadedWSGIServerReloadable(LoggingBaseWSGIServerMixIn, werkzeug.serving.ThreadedWSGIServer): """ werkzeug Threaded WSGI Server patched to allow reusing a listen socket @@ -105,14 +102,15 @@ class ThreadedWSGIServerReloadable(LoggingBaseWSGIServerMixIn, werkzeug.serving. handler=RequestHandler) def server_bind(self): - envfd = os.environ.get('LISTEN_FDS') - if envfd and os.environ.get('LISTEN_PID') == str(os.getpid()): + SD_LISTEN_FDS_START = 3 + if os.environ.get('LISTEN_FDS') == '1' and os.environ.get('LISTEN_PID') == str(os.getpid()): self.reload_socket = True - self.socket = socket.fromfd(int(envfd), socket.AF_INET, socket.SOCK_STREAM) - # should we os.close(int(envfd)) ? it seem python duplicate the fd. + self.socket = socket.fromfd(SD_LISTEN_FDS_START, socket.AF_INET, socket.SOCK_STREAM) + _logger.info('HTTP service (werkzeug) running through socket activation') else: self.reload_socket = False super(ThreadedWSGIServerReloadable, self).server_bind() + _logger.info('HTTP service (werkzeug) running on %s:%s', self.server_name, self.server_port) def server_activate(self): if not self.reload_socket: @@ -254,7 +252,6 @@ class ThreadedServer(CommonServer): t = threading.Thread(target=self.http_thread, name="openerp.service.httpd") t.setDaemon(True) t.start() - _logger.info('HTTP service (werkzeug) running on %s:%s', self.interface, self.port) def start(self, stop=False): _logger.debug("Setting signal handlers") @@ -853,7 +850,8 @@ def _reexec(updated_modules=None): args += ["-u", ','.join(updated_modules)] if not args or args[0] != exe: args.insert(0, exe) - os.execv(sys.executable, args) + # We should keep the LISTEN_* environment variabled in order to support socket activation on reexec + os.execve(sys.executable, args, os.environ) def load_test_file_yml(registry, test_file): with registry.cursor() as cr: From 10ac023707b926eb3580dc517de11002a9abd223 Mon Sep 17 00:00:00 2001 From: "Ignacio Ibeas - Acysos S.L" Date: Sat, 12 May 2018 21:31:23 +0200 Subject: [PATCH 08/48] [ADD] l10n_es: special taxes for agriculture, ranching and fishing --- addons/l10n_es/__manifest__.py | 1 + .../account_fiscal_position_template_data.xml | 32 +++++++++++++++++++ addons/l10n_es/data/account_tax_data.xml | 13 ++++++++ 3 files changed, 46 insertions(+) diff --git a/addons/l10n_es/__manifest__.py b/addons/l10n_es/__manifest__.py index fa6445e3685..02cd041f9e8 100644 --- a/addons/l10n_es/__manifest__.py +++ b/addons/l10n_es/__manifest__.py @@ -3,6 +3,7 @@ # List of contributors: # Jordi Esteve +# Ignacio Ibeas # Dpto. Consultoría Grupo Opentia # Pedro M. Baeza # Carlos Liébana diff --git a/addons/l10n_es/data/account_fiscal_position_template_data.xml b/addons/l10n_es/data/account_fiscal_position_template_data.xml index 49beed9d022..eef1bd1ac03 100644 --- a/addons/l10n_es/data/account_fiscal_position_template_data.xml +++ b/addons/l10n_es/data/account_fiscal_position_template_data.xml @@ -113,6 +113,16 @@ + + REAGYP - Agricultura + + + + + REAGYP - Ganadería y pesca + + + @@ -2889,6 +2899,28 @@ + + + + + + + + + + + + + + + + + + + + + + diff --git a/addons/l10n_es/data/account_tax_data.xml b/addons/l10n_es/data/account_tax_data.xml index d07503b0b88..327144f6fe1 100644 --- a/addons/l10n_es/data/account_tax_data.xml +++ b/addons/l10n_es/data/account_tax_data.xml @@ -1044,6 +1044,18 @@ + + P_IVA105_GAN + purchase + + 10,5% IVA Soportado régimen ganadero o pesca + + + + percent + + + S_IVA0_E sale @@ -1330,6 +1342,7 @@ + percent From 794df3cadfcac7c54708f1ec837c3c19c4fd4394 Mon Sep 17 00:00:00 2001 From: "Ignacio Ibeas - Acysos S.L" Date: Sat, 12 May 2018 21:41:49 +0200 Subject: [PATCH 09/48] [CLA] Acysos S.L. --- doc/cla/corporate/acysos.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 doc/cla/corporate/acysos.md diff --git a/doc/cla/corporate/acysos.md b/doc/cla/corporate/acysos.md new file mode 100644 index 00000000000..ed1e556d19a --- /dev/null +++ b/doc/cla/corporate/acysos.md @@ -0,0 +1,16 @@ +Spain, 2018-05-12 + +Acysos S.L. 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, + +Ignacio Ibeas ignacio@acysos.com https://github.com/acysos + +List of contributors: + +Ignacio Ibeas ignacio@acysos.com https://github.com/acysos +Alex Ezquebo alexander@acysos.com https://github.com/acysos From cc878d029a2e892303d0e828ba07c70774299e40 Mon Sep 17 00:00:00 2001 From: Nicolas Martinelli Date: Thu, 17 May 2018 13:34:29 +0200 Subject: [PATCH 10/48] [FIX] website_sale_delivery: remove error - Set up as a shipper with the highest priority one which will cause an error (e.g. service not available for customer address) - Order a product on eCommerce, go to Payment page - The error "Ouch, you cannot choose this carrier!" - Change shipper to one which doesn't cause an issue The error is still displayed. The error is displayed at first rendering of the page, but never re-evaluated afterwards. There is no other choice than removing it. Anyway, in the opposite case (default shipper is OK, and then select one which causes an error) the error doesn't appears. opw-1838765 --- addons/website_sale_delivery/controllers/main.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/addons/website_sale_delivery/controllers/main.py b/addons/website_sale_delivery/controllers/main.py index 56ef9c451f2..b276539ae88 100644 --- a/addons/website_sale_delivery/controllers/main.py +++ b/addons/website_sale_delivery/controllers/main.py @@ -46,9 +46,6 @@ class WebsiteSaleDelivery(WebsiteSale): has_stockable_products = any(line.product_id.type in ['consu', 'product'] for line in order.order_line) if has_stockable_products: if order.carrier_id and not order.delivery_rating_success: - values['errors'].append( - (_("Ouch, you cannot choose this carrier!"), - _("%s does not ship to your address, please choose another one.\n(Error: %s)" % (order.carrier_id.name, order.delivery_message)))) order._remove_delivery_line() delivery_carriers = order._get_delivery_methods() From 3bf8e753791c9106849159310aaf842733b79769 Mon Sep 17 00:00:00 2001 From: Nicolas Martinelli Date: Thu, 17 May 2018 13:43:51 +0200 Subject: [PATCH 11/48] [FIX] website_sale_delivery: display delivery price - Set up as a shipper with the highest priority one which will cause an error (e.g. service not available for customer address) - Order a product on eCommerce, go to Payment page - The 'Delivery' amount (next to the total/subtotal) is not displayed - Change shipper to one which doesn't cause an issue The 'Delivery' amount is still not displayed. The amount is displayed if there is no issue at first rendering of the page, but never re-evaluated afterwards. The 'Delivery' amount is now displayed if there is a shipper on the order. opw-1838765 --- .../views/website_sale_delivery_templates.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/website_sale_delivery/views/website_sale_delivery_templates.xml b/addons/website_sale_delivery/views/website_sale_delivery_templates.xml index 29b5ae4d1d1..8b8aef3e478 100644 --- a/addons/website_sale_delivery/views/website_sale_delivery_templates.xml +++ b/addons/website_sale_delivery/views/website_sale_delivery_templates.xml @@ -3,7 +3,7 @@