diff --git a/.gitmodules b/.gitmodules
index dc3dece0..3e7cb0c7 100644
--- a/.gitmodules
+++ b/.gitmodules
@@ -9,6 +9,12 @@
path = external/hibou-oca/sale-workflow
url = https://github.com/hibou-io/oca-sale-workflow.git
branch = 12.0
+[submodule "external/hibou-oca/social"]
+ path = external/hibou-oca/social
+ url = https://github.com/hibou-io/oca-social
+[submodule "external/camptocamp-cloud-platform"]
+ path = external/camptocamp-cloud-platform
+ url = https://github.com/hibou-io/camptocamp-cloud-platform
[submodule "external/hibou-oca/queue"]
path = external/hibou-oca/queue
url = https://github.com/hibou-io/oca-queue.git
@@ -27,9 +33,3 @@
[submodule "external/hibou-oca/stock-logistics-warehouse"]
path = external/hibou-oca/stock-logistics-warehouse
url = https://github.com/hibou-io/oca-stock-logistics-warehouse.git
-[submodule "external/hibou-oca/social"]
- path = external/hibou-oca/social
- url = https://github.com/hibou-io/oca-social
-[submodule "external/camptocamp-cloud-platform"]
- path = external/camptocamp-cloud-platform
- url = https://github.com/hibou-io/camptocamp-cloud-platform
diff --git a/Dockerfile b/Dockerfile
index 8befae1e..ab5d9837 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -1,9 +1,5 @@
FROM hibou/hibou-odoo:12.0
-USER 0
-RUN pip install cachetools==2.1.0 pycrypto
-USER 104
-
COPY --chown=104 . /opt/odoo/hibou-suite
RUN rm /etc/odoo/odoo.conf \
&& cp /opt/odoo/hibou-suite/debian/odoo.conf /etc/odoo/odoo.conf \
diff --git a/Dockerfile-GitLab b/Dockerfile-GitLab
index 2059c4be..17df09f1 100644
--- a/Dockerfile-GitLab
+++ b/Dockerfile-GitLab
@@ -1,9 +1,5 @@
FROM registry.gitlab.com/hibou-io/hibou-odoo/odoo:RELEASE
-USER 0
-RUN pip install cachetools==2.1.0 pycrypto
-USER 104
-
COPY --chown=104 . /opt/odoo/hibou-suite
RUN rm /etc/odoo/odoo.conf \
&& cp /opt/odoo/hibou-suite/debian/odoo.conf /etc/odoo/odoo.conf \
diff --git a/connector_opencart/__manifest__.py b/connector_opencart/__manifest__.py
index ce265249..750f30c6 100644
--- a/connector_opencart/__manifest__.py
+++ b/connector_opencart/__manifest__.py
@@ -17,6 +17,7 @@
'license': 'AGPL-3',
'website': 'https://hibou.io',
'data': [
+ 'data/connector_opencart_data.xml',
'security/ir.model.access.csv',
'views/delivery_views.xml',
'views/opencart_backend_views.xml',
diff --git a/connector_opencart/data/connector_opencart_data.xml b/connector_opencart/data/connector_opencart_data.xml
index fef62b5b..b575ec5d 100644
--- a/connector_opencart/data/connector_opencart_data.xml
+++ b/connector_opencart/data/connector_opencart_data.xml
@@ -4,13 +4,13 @@
Opencart - Import Sales Orders
-
+
code
1
- days
+ hours
-1
-
+
model._scheduler_import_sale_orders()
@@ -27,26 +27,7 @@ Check your taxes and fiscal positions configuration and correct them if necessar
30
sale.order
sale
- if sale.opencart_bind_ids and abs(sale.amount_total - sale.opencart_bind_ids[0].total_amount) >= 0.01:
- failed = True
-
-
-
-
- Total Tax Amount differs from Opencart
- The tax amount computed in Odoo doesn't match with the tax amount in Opencart.
-
-Cause:
-The taxes are probably different between Odoo and Opencart. A fiscal position could have changed the final price.
-
-Resolution:
-Check your taxes and fiscal positions configuration and correct them if necessary.
- 30
- sale.order
- sale
- # By default, a cent of difference for the tax amount is allowed, feel free to customise it in your own module
-if sale.opencart_bind_ids and abs(sale.amount_tax - sale.opencart_bind_ids[0].total_amount_tax) > 0.01:
- failed = True
+ failed = sale.opencart_bind_ids and abs(sale.amount_total - sale.opencart_bind_ids[0].total_amount) >= 0.01
diff --git a/connector_opencart/models/sale_order/importer.py b/connector_opencart/models/sale_order/importer.py
index 42813627..0ff32f0d 100644
--- a/connector_opencart/models/sale_order/importer.py
+++ b/connector_opencart/models/sale_order/importer.py
@@ -2,6 +2,7 @@
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from copy import deepcopy, copy
+from html import unescape
from odoo import fields, _
from odoo.addons.component.core import Component
@@ -65,14 +66,14 @@ class SaleOrderImportMapper(Component):
record = map_record.source
line_builder = self.component(usage='order.line.builder.shipping')
- line_builder.price_unit = 0.0
+ line_builder.price_unit = record.get('shipping_exclude_tax', 0.0)
if values.get('carrier_id'):
carrier = self.env['delivery.carrier'].browse(values['carrier_id'])
line_builder.product = carrier.product_id
+ line = (0, 0, line_builder.get_line())
+ values['order_line'].append(line)
- line = (0, 0, line_builder.get_line())
- values['order_line'].append(line)
return values
def finalize(self, map_record, values):
@@ -120,9 +121,8 @@ class SaleOrderImportMapper(Component):
[('name', '=', record_method)],
limit=1,
)
- assert method, ("method %s should exist because the import fails "
- "in SaleOrderImporter._before_import when it is "
- " missing" % record_method)
+ if not method:
+ raise ValueError('Payment Mode named "%s", cannot be found.' % (record_method, ))
return {'payment_mode_id': method.id}
@mapping
@@ -138,8 +138,11 @@ class SaleOrderImportMapper(Component):
return {'warehouse_id': warehouse.id}
@mapping
- def shipping_method(self, record):
- method = record['shipping_method'] or ''
+ def shipping_code(self, record):
+ method = record.get('shipping_code') or record.get('shipping_method')
+ if not method:
+ return {'carrier_id': False}
+
carrier_domain = [('opencart_code', '=', method.strip())]
company = self.options.store.company_id or self.backend_record.company_id
if company:
@@ -148,8 +151,8 @@ class SaleOrderImportMapper(Component):
]
carrier = self.env['delivery.carrier'].search(carrier_domain, limit=1)
if not carrier:
- raise ValueError('Delivery Carrier for methodCode "%s", cannot be found.' % (method, ))
- return {'carrier_id': carrier.id, 'shipping_method_code': method}
+ raise ValueError('Delivery Carrier for method Code "%s", cannot be found.' % (method, ))
+ return {'carrier_id': carrier.id}
@mapping
def company_id(self, record):
@@ -328,7 +331,6 @@ class SaleOrderLineImportMapper(Component):
direct = [('quantity', 'product_uom_qty'),
('price', 'price_unit'),
- ('name', 'name'),
('order_product_id', 'external_id'),
]
@@ -340,13 +342,17 @@ class SaleOrderLineImportMapper(Component):
reference = record['model']
values = {
'default_code': reference,
- 'name': record.get('name', reference),
+ 'name': unescape(record.get('name', reference)), # unknown if other fields, but have observed " in product names
'type': 'product',
'list_price': record.get('price', 0.0),
'categ_id': self.backend_record.product_categ_id.id,
}
return self._finalize_product_values(record, values)
+ @mapping
+ def name(self, record):
+ return unescape(record['name'])
+
@mapping
def product_id(self, record):
reference = record['model']
diff --git a/hr_expense_vendor/models/hr_expense.py b/hr_expense_vendor/models/hr_expense.py
index f30ae71d..9a2a54bf 100644
--- a/hr_expense_vendor/models/hr_expense.py
+++ b/hr_expense_vendor/models/hr_expense.py
@@ -15,7 +15,7 @@ class HRExpense(models.Model):
raise ValidationError('You must have an assigned vendor to process a Company Paid Expense')
move_line_values = move_line_values_by_expense[expense.id]
for line_values in move_line_values:
- new_name = expense.name.split('\n')[0][:64] + (' - ' + str(self.reference) if self.reference else '')
+ new_name = expense.name.split('\n')[0][:64] + (' - ' + str(expense.reference) if expense.reference else '')
line_values['name'] = new_name[:64]
line_values['partner_id'] = expense.vendor_id.id
return move_line_values_by_expense