Skip to content

Commit

Permalink
[MERGE] forward port branch saas-15 up to 9cfd4a5
Browse files Browse the repository at this point in the history
  • Loading branch information
KangOl committed Feb 22, 2018
2 parents 5ce76a0 + 9cfd4a5 commit e598743
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 10 deletions.
5 changes: 5 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ include README.md
recursive-include odoo *.css
recursive-include odoo *.csv
recursive-include odoo *.doc
recursive-include odoo *.docx
recursive-include odoo *.eml
recursive-include odoo *.eot
recursive-include odoo *.gif
Expand All @@ -16,6 +17,8 @@ recursive-include odoo *.less
recursive-include odoo *.md
recursive-include odoo *.mp3
recursive-include odoo *.ogg
recursive-include odoo *.ods
recursive-include odoo *.odt
recursive-include odoo *.otf
recursive-include odoo *.pdf
recursive-include odoo *.png
Expand All @@ -35,8 +38,10 @@ recursive-include odoo *.wsdl
recursive-include odoo *.xls
recursive-include odoo *.xsd
recursive-include odoo *.xsl
recursive-include odoo *.xlsx
recursive-include odoo *.xml
recursive-include odoo *.yml
recursive-include odoo *.zip
recursive-include odoo/addons/l10n_mx_edi *.xslt *.key *.cer *.txt
recursive-include odoo/addons/l10n_mx_reports *.xslt
recursive-exclude * *.py[co]
Expand Down
2 changes: 1 addition & 1 deletion addons/purchase/views/account_invoice_views.xml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
<field name="inherit_id" ref="account.invoice_supplier_form"/>
<field name="arch" type="xml">
<field name="reference" position="after" >
<field name="purchase_id" attrs="{'readonly': [('state','not in',['draft'])], 'invisible': [('state', '=', 'purchase')]}" class="oe_edit_only"
<field name="purchase_id" attrs="{'readonly': [('state','not in',['draft'])], 'invisible': ['|', ('state', '=', 'purchase'), ('type', '=', 'in_refund')]}" class="oe_edit_only"
options="{'no_create': True}" context="{'show_total_amount': True}"/>
</field>
<xpath expr="//field[@name='invoice_line_ids']/tree/field[@name='company_id']" position="after">
Expand Down
2 changes: 1 addition & 1 deletion addons/resource/models/resource.py
Original file line number Diff line number Diff line change
Expand Up @@ -723,7 +723,7 @@ class ResourceCalendarLeaves(models.Model):
date_from = fields.Datetime('Start Date', required=True)
date_to = fields.Datetime('End Date', required=True)
tz = fields.Selection(
_tz_get, string='Timezone', default=lambda self: self._context.get('tz', self.env.user.tz or 'UTC'),
_tz_get, string='Timezone', default=lambda self: self._context.get('tz') or self.env.user.tz or 'UTC',
help="Timezone used when encoding the leave. It is used to correctly "
"localize leave hours when computing time intervals.")
resource_id = fields.Many2one(
Expand Down
17 changes: 9 additions & 8 deletions addons/website_quote/models/sale_order.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,15 @@ def _get_default_template(self):
return template and template.active and template or False

def _get_default_online_payment(self):
return 1 if self.env['ir.config_parameter'].sudo().get_param('sale.sale_portal_confirmation_options', default='none') == 'pay' else 0
default_template = self._get_default_template_id()
if self.template_id:
return self.template_id.require_payment
elif default_template:
return default_template.require_payment
elif self.env['ir.config_parameter'].sudo().get_param('sale.sale_portal_confirmation_options', default='none') == 'pay':
return 1
else:
return 0

template_id = fields.Many2one(
'sale.quote.template', 'Quotation Template',
Expand All @@ -70,16 +78,9 @@ def _get_default_online_payment(self):
require_payment = fields.Selection([
(0, 'Online Signature'),
(1, 'Online Payment')], default=_get_default_online_payment, string='Confirmation Mode',
compute='_compute_require_payment', store=True,
help="Choose how you want to confirm an order to launch the delivery process. You can either "
"request a digital signature or an upfront payment. With a digital signature, you can "
"request the payment when issuing the invoice.")
@api.one
@api.depends('template_id')
def _compute_require_payment(self):
# Do not overwrite if the field is already set
if self.template_id and (self.require_payment is None or self.require_payment is False):
self.require_payment = self.template_id.require_payment

@api.multi
def copy(self, default=None):
Expand Down
11 changes: 11 additions & 0 deletions doc/cla/individual/novawish.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
Vietnam, 2018-02-10

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,

Duc Dao duc.dd@komit-consulting.com https://github.com/novawish

0 comments on commit e598743

Please sign in to comment.