summaryrefslogtreecommitdiff
path: root/addons
diff options
context:
space:
mode:
authorChristophe Simonis <chs@odoo.com>2018-11-15 18:15:47 +0100
committerChristophe Simonis <chs@odoo.com>2018-11-15 18:15:47 +0100
commit3c78026dc0fa90cfe19ef9d481c6ee256a477e2d (patch)
tree67bc97dce1fef2a3bcebf0c2bcb708c18cf7da18 /addons
parentca2b46c2d13068f322b93397a8e0acd4a7000303 (diff)
parent55104b915e59780d4b7ffffbc6a697a4539948e8 (diff)
[MERGE] forward port branch saas-14 up to 55104b915e5
Diffstat (limited to 'addons')
-rw-r--r--addons/account/report/account_aged_partner_balance.py21
-rw-r--r--addons/account/security/ir.model.access.csv2
-rw-r--r--addons/account_asset/views/account_asset_views.xml8
-rw-r--r--addons/auth_signup/models/res_partner.py8
-rw-r--r--addons/google_calendar/views/res_config_views.xml2
-rw-r--r--addons/mrp/report/mrp_bom_cost_report_templates.xml2
-rw-r--r--addons/point_of_sale/static/src/css/pos.css2
-rw-r--r--addons/pos_restaurant/static/src/js/multiprint.js6
-rw-r--r--addons/product/report/product_pricelist.py2
-rw-r--r--addons/sale/models/sale.py3
-rw-r--r--addons/sale_margin/models/sale_order.py4
-rw-r--r--addons/website_event/views/event_templates.xml10
12 files changed, 36 insertions, 34 deletions
diff --git a/addons/account/report/account_aged_partner_balance.py b/addons/account/report/account_aged_partner_balance.py
index f14248ff6a3..38b7c88dff3 100644
--- a/addons/account/report/account_aged_partner_balance.py
+++ b/addons/account/report/account_aged_partner_balance.py
@@ -31,7 +31,10 @@ class ReportAgedPartnerBalance(models.AbstractModel):
res = []
total = []
cr = self.env.cr
- company_ids = self.env.context.get('company_ids', (self.env.user.company_id.id,))
+ user_company = self.env.user.company_id
+ user_currency = user_company.currency_id
+ ResCurrency = self.env['res.currency'].with_context(date=date_from)
+ company_ids = self._context.get('company_ids') or [user_company.id]
move_state = ['draft', 'posted']
if target_move == 'posted':
move_state = ['posted']
@@ -88,15 +91,15 @@ class ReportAgedPartnerBalance(models.AbstractModel):
partner_id = line.partner_id.id or False
if partner_id not in undue_amounts:
undue_amounts[partner_id] = 0.0
- line_amount = line.balance
- if line.balance == 0:
+ line_amount = ResCurrency._compute(line.company_id.currency_id, user_currency, line.balance)
+ if user_currency.is_zero(line_amount):
continue
for partial_line in line.matched_debit_ids:
if partial_line.create_date[:10] <= date_from:
- line_amount += partial_line.amount
+ line_amount += ResCurrency._compute(partial_line.company_id.currency_id, user_currency, partial_line.amount)
for partial_line in line.matched_credit_ids:
if partial_line.create_date[:10] <= date_from:
- line_amount -= partial_line.amount
+ line_amount -= ResCurrency._compute(partial_line.company_id.currency_id, user_currency, partial_line.amount)
if not self.env.user.company_id.currency_id.is_zero(line_amount):
undue_amounts[partner_id] += line_amount
lines[partner_id].append({
@@ -140,15 +143,15 @@ class ReportAgedPartnerBalance(models.AbstractModel):
partner_id = line.partner_id.id or False
if partner_id not in partners_amount:
partners_amount[partner_id] = 0.0
- line_amount = line.balance
- if line.balance == 0:
+ line_amount = ResCurrency._compute(line.company_id.currency_id, user_currency, line.balance)
+ if user_currency.is_zero(line_amount):
continue
for partial_line in line.matched_debit_ids:
if partial_line.create_date[:10] <= date_from:
- line_amount += partial_line.amount
+ line_amount += ResCurrency._compute(partial_line.company_id.currency_id, user_currency, partial_line.amount)
for partial_line in line.matched_credit_ids:
if partial_line.create_date[:10] <= date_from:
- line_amount -= partial_line.amount
+ line_amount -= ResCurrency._compute(partial_line.company_id.currency_id, user_currency, partial_line.amount)
if not self.env.user.company_id.currency_id.is_zero(line_amount):
partners_amount[partner_id] += line_amount
diff --git a/addons/account/security/ir.model.access.csv b/addons/account/security/ir.model.access.csv
index a0955a5482c..494ae2b3636 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
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 @@
<label for="account_asset_id" attrs="{'invisible': [('type','!=','purchase')]}"/>
<label for="account_asset_id" string="Deferred Revenue Account" attrs="{'invisible': [('type','!=','sale')]}"/>
</div>
- <field name="account_asset_id" nolabel="1" attrs="{'invisible': [('type','=', False)]}"/>
+ <field name="account_asset_id" nolabel="1" attrs="{'invisible': [('type','=', False)]}" domain="[('company_id', '=', company_id)]"/>
<div>
<label for="account_depreciation_id" attrs="{'invisible': [('type','!=','purchase')]}"/>
<label for="account_depreciation_id" string="Recognition Income Account" attrs="{'invisible': [('type','!=','sale')]}"/>
</div>
- <field name="account_depreciation_id" nolabel="1"/>
+ <field name="account_depreciation_id" nolabel="1" domain="[('company_id', '=', company_id)]"/>
<div>
<label for="account_depreciation_expense_id" attrs="{'invisible': [('type','!=','purchase')]}"/>
<label for="account_depreciation_expense_id" string="Recognition Account" attrs="{'invisible': [('type','!=','sale')]}"/>
</div>
- <field name="account_depreciation_expense_id" nolabel="1"/>
- <field name="account_analytic_id" groups="analytic.group_analytic_accounting"/>
+ <field name="account_depreciation_expense_id" nolabel="1" domain="[('company_id', '=', company_id)]"/>
+ <field name="account_analytic_id" domain="[('company_id', '=', company_id)]" groups="analytic.group_analytic_accounting"/>
</group>
<group string="Periodicity">
<field name="method_time" string="Time Method Based On" widget="radio" attrs="{'invisible': [('type','!=','purchase')]}"/>
diff --git a/addons/auth_signup/models/res_partner.py b/addons/auth_signup/models/res_partner.py
index 1f79b89e992..3fa3d221cbc 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:
diff --git a/addons/google_calendar/views/res_config_views.xml b/addons/google_calendar/views/res_config_views.xml
index 6653c9ba3cd..c69b7d56393 100644
--- a/addons/google_calendar/views/res_config_views.xml
+++ b/addons/google_calendar/views/res_config_views.xml
@@ -13,7 +13,7 @@
<label for="cal_client_secret" string="Client Secret" class="col-xs-3 col-md-3 o_light_label"/>
<field name="cal_client_secret" password="True" nolabel="1"/>
</div>
- <a href="https://www.odoo.com/documentation/user/online/crm/calendar/google_calendar_credentials.html" class="oe-link" target="_blank"><i class="fa fa-fw fa-arrow-right"/>Tutorial</a>
+ <a href="https://www.odoo.com/documentation/user/10.0/online/crm/calendar/google_calendar_credentials.html" class="oe-link" target="_blank"><i class="fa fa-fw fa-arrow-right"/>Tutorial</a>
</div>
</div>
</field>
diff --git a/addons/mrp/report/mrp_bom_cost_report_templates.xml b/addons/mrp/report/mrp_bom_cost_report_templates.xml
index c81bb2c1b9d..ee64891652e 100644
--- a/addons/mrp/report/mrp_bom_cost_report_templates.xml
+++ b/addons/mrp/report/mrp_bom_cost_report_templates.xml
@@ -33,7 +33,7 @@
<span t-field="bom_line['product_id'].default_code"/>
</td>
<td colspan="3">
- <span t-att-res-id="bom_line['product_id'].id" res-model="product.product" view-type="form" t-esc="bom_line['product_id'].name"/>
+ <span t-att-res-id="bom_line['product_id'].id" res-model="product.product" view-type="form" t-esc="bom_line['product_id'].display_name"/>
</td>
<td class="text-right">
<span t-esc="bom_line['product_uom_qty']"/> <span t-esc="bom_line['product_uom'].name" groups="product.group_uom"/>
diff --git a/addons/point_of_sale/static/src/css/pos.css b/addons/point_of_sale/static/src/css/pos.css
index 61b50830617..d4d48d1578a 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;
diff --git a/addons/pos_restaurant/static/src/js/multiprint.js b/addons/pos_restaurant/static/src/js/multiprint.js
index 5270f103c48..d8b576cd171 100644
--- a/addons/pos_restaurant/static/src/js/multiprint.js
+++ b/addons/pos_restaurant/static/src/js/multiprint.js
@@ -137,8 +137,10 @@ models.Orderline = models.Orderline.extend({
}
},
set_dirty: function(dirty) {
- this.mp_dirty = dirty;
- this.trigger('change',this);
+ if (this.mp_dirty !== dirty) {
+ this.mp_dirty = dirty;
+ this.trigger('change', this);
+ }
},
get_line_diff_hash: function(){
if (this.get_note()) {
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,
diff --git a/addons/sale/models/sale.py b/addons/sale/models/sale.py
index 97ebacb14f6..5fe5d2ba3df 100644
--- a/addons/sale/models/sale.py
+++ b/addons/sale/models/sale.py
@@ -374,10 +374,11 @@ class SaleOrder(models.Model):
raise UserError(_('There is no invoicable line.'))
for invoice in invoices.values():
+ invoice.compute_taxes()
if not invoice.invoice_line_ids:
raise UserError(_('There is no invoicable line.'))
# If invoice is negative, do a refund invoice instead
- if invoice.amount_untaxed < 0:
+ if invoice.amount_total < 0:
invoice.type = 'out_refund'
for line in invoice.invoice_line_ids:
line.quantity = -line.quantity
diff --git a/addons/sale_margin/models/sale_order.py b/addons/sale_margin/models/sale_order.py
index fe788d24bba..56e11b64e53 100644
--- a/addons/sale_margin/models/sale_order.py
+++ b/addons/sale_margin/models/sale_order.py
@@ -60,10 +60,6 @@ class SaleOrderLine(models.Model):
for line in self:
currency = line.order_id.pricelist_id.currency_id
price = line.purchase_price
- if not price:
- from_cur = line.env.user.company_id.currency_id.with_context(date=line.order_id.date_order)
- price = from_cur.compute(line.product_id.standard_price, currency, round=False)
-
line.margin = currency.round(line.price_subtotal - (price * line.product_uom_qty))
diff --git a/addons/website_event/views/event_templates.xml b/addons/website_event/views/event_templates.xml
index b93fa1c2183..29881af3ecf 100644
--- a/addons/website_event/views/event_templates.xml
+++ b/addons/website_event/views/event_templates.xml
@@ -81,14 +81,14 @@
</li>
</ul>
</div>
- <div class="row">
- <div class="col-sm-6 col-xs-offset-3">
- <t t-call="website.pager"/>
- </div>
- </div>
<div class="col-md-3 oe_structure" id="right_column">
</div>
</div>
+ <div class="row">
+ <div class="col-sm-6 col-xs-offset-3">
+ <t t-call="website.pager"/>
+ </div>
+ </div>
</div>
<div class="oe_structure"/>
</div>