diff options
| author | Christophe Simonis <chs@odoo.com> | 2018-11-15 18:57:09 +0100 |
|---|---|---|
| committer | Christophe Simonis <chs@odoo.com> | 2018-11-15 18:57:09 +0100 |
| commit | 468dab6748ad43865567444380abe52fb4c7a56d (patch) | |
| tree | 5b69509b1edb8331ebbc34b0e6dfb1ecda5acc54 /addons | |
| parent | 9148d86f35fe99c0af21ade9d497e8534510aac6 (diff) | |
| parent | 3c78026dc0fa90cfe19ef9d481c6ee256a477e2d (diff) | |
[MERGE] forward port branch saas-15 up to 3c78026dc0f
Diffstat (limited to 'addons')
| -rw-r--r-- | addons/account/report/account_aged_partner_balance.py | 21 | ||||
| -rw-r--r-- | addons/account/security/ir.model.access.csv | 2 | ||||
| -rw-r--r-- | addons/account_asset/views/account_asset_views.xml | 8 | ||||
| -rw-r--r-- | addons/auth_signup/models/res_partner.py | 8 | ||||
| -rw-r--r-- | addons/mrp/report/mrp_bom_cost_report_templates.xml | 2 | ||||
| -rw-r--r-- | addons/point_of_sale/static/src/css/pos.css | 2 | ||||
| -rw-r--r-- | addons/pos_restaurant/static/src/js/multiprint.js | 6 | ||||
| -rw-r--r-- | addons/product/report/product_pricelist.py | 2 | ||||
| -rw-r--r-- | addons/sale/models/sale.py | 3 | ||||
| -rw-r--r-- | addons/sale_margin/models/sale_order.py | 4 | ||||
| -rw-r--r-- | addons/website_event/views/event_templates.xml | 10 |
11 files changed, 35 insertions, 33 deletions
diff --git a/addons/account/report/account_aged_partner_balance.py b/addons/account/report/account_aged_partner_balance.py index 9f84114f173..2aed9f443c0 100644 --- a/addons/account/report/account_aged_partner_balance.py +++ b/addons/account/report/account_aged_partner_balance.py @@ -42,7 +42,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'] @@ -99,15 +102,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.max_date <= 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.max_date <= 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({ @@ -151,15 +154,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.max_date <= 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.max_date <= 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 8a9aad92bd9..5fa3604a34b 100644 --- a/addons/account/security/ir.model.access.csv +++ b/addons/account/security/ir.model.access.csv @@ -39,8 +39,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_invoice_portal,account.invoice.portal,account.model_account_invoice,base.group_portal,1,0,0,0 access_account_invoice_line_portal,account.invoice.line.portal,account.model_account_invoice_line,base.group_portal,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 diff --git a/addons/account_asset/views/account_asset_views.xml b/addons/account_asset/views/account_asset_views.xml index 1f452d68960..481ebbe9970 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 8ff7b8ce91c..91cd8d5e3e8 100644 --- a/addons/auth_signup/models/res_partner.py +++ b/addons/auth_signup/models/res_partner.py @@ -58,17 +58,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/mrp/report/mrp_bom_cost_report_templates.xml b/addons/mrp/report/mrp_bom_cost_report_templates.xml index 225c3dca5d8..e76affad3b5 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']" t-esc-options='{"widget": "float", "decimal_precision": "Product Unit of Measure"}'/> <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 599d8c23d31..ec28fb6fa15 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 738b13d9362..7e7cc7a8bfd 100644 --- a/addons/pos_restaurant/static/src/js/multiprint.js +++ b/addons/pos_restaurant/static/src/js/multiprint.js @@ -139,8 +139,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 91f72d6cadd..c0bd5138fab 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) return { '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 a2148cc9985..53614f0e78e 100644 --- a/addons/sale/models/sale.py +++ b/addons/sale/models/sale.py @@ -443,10 +443,11 @@ class SaleOrder(models.Model): raise UserError(_('There is no invoiceable line.')) for invoice in invoices.values(): + invoice.compute_taxes() if not invoice.invoice_line_ids: raise UserError(_('There is no invoiceable 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 2aac5cb9936..40e28d751b1 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 0a64a7430ca..5e5f4025c9d 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> |
