[MERGE] forward port branch saas-14 up to 55104b915e

This commit is contained in:
Christophe Simonis
2018-11-15 18:15:47 +01:00
14 changed files with 62 additions and 34 deletions
@@ -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
@@ -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
1 id name model_id:id group_id:id perm_read perm_write perm_create perm_unlink
36 access_account_invoice_group_invoice account.invoice group invoice model_account_invoice account.group_account_invoice 1 1 1 1
37 access_res_currency_account_manager res.currency account manager base.model_res_currency group_account_manager 1 1 1 1
38 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
39 access_account_payment_term_partner_manager account.payment.term partner manager model_account_payment_term base.group_user 1 0 0 0
40 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
41 access_account_fiscal_position_product_manager account.fiscal.position account.manager model_account_fiscal_position account.group_account_manager 1 1 1 1
@@ -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')]}"/>
+4 -4
View File
@@ -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:
@@ -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>
@@ -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"/>
@@ -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;
@@ -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()) {
+1 -1
View File
@@ -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,
+2 -1
View File
@@ -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
-4
View File
@@ -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))
@@ -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>
+15
View File
@@ -0,0 +1,15 @@
Belgium, 2018-11-05
Okia SPRL 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,
Sylvain Van Hoof sylvain@okia.be https://github.com/sylvainvh
List of contributors:
Sylvain Van Hoof sylvain@okia.be https://github.com/sylvainvh
+11
View File
@@ -0,0 +1,11 @@
Spain, 2018-10-17
I hereby agree to the terms of the Odoo Individual Contributor License
Agreement v1.0.
I declare that I am authorized and able to make this agreement and sign this
declaration.
Signed,
Ugaitz Olaizola Arbelaitz uolaizola@binovo.es