[MERGE] forward port branch saas-14 up to 78dced6bc2
This commit is contained in:
@@ -1088,6 +1088,11 @@ class AccountMoveLine(models.Model):
|
||||
account_move_line.payment_id.write({'invoice_ids': [(3, invoice.id, None)]})
|
||||
rec_move_ids += account_move_line.matched_debit_ids
|
||||
rec_move_ids += account_move_line.matched_credit_ids
|
||||
if self.env.context.get('invoice_id'):
|
||||
current_invoice = self.env['account.invoice'].browse(self.env.context['invoice_id'])
|
||||
rec_move_ids = rec_move_ids.filtered(
|
||||
lambda r: (r.debit_move_id + r.credit_move_id) & current_invoice.move_id.line_ids
|
||||
)
|
||||
return rec_move_ids.unlink()
|
||||
|
||||
####################################################
|
||||
|
||||
@@ -620,3 +620,39 @@ class TestReconciliation(AccountingTestCase):
|
||||
# Checking if the direction of the move is correct
|
||||
full_rec_payable = full_rec_move.line_ids.filtered(lambda l: l.account_id == self.account_rsa)
|
||||
self.assertEqual(full_rec_payable.balance, 18.75)
|
||||
|
||||
def test_unreconcile(self):
|
||||
# Use case:
|
||||
# 2 invoices paid with a single payment. Unreconcile the payment with one invoice, the
|
||||
# other invoice should remain reconciled.
|
||||
inv1 = self.create_invoice(invoice_amount=10, currency_id=self.currency_usd_id)
|
||||
inv2 = self.create_invoice(invoice_amount=20, currency_id=self.currency_usd_id)
|
||||
payment = self.env['account.payment'].create({
|
||||
'payment_type': 'inbound',
|
||||
'payment_method_id': self.env.ref('account.account_payment_method_manual_in').id,
|
||||
'partner_type': 'customer',
|
||||
'partner_id': self.partner_agrolait_id,
|
||||
'amount': 100,
|
||||
'currency_id': self.currency_usd_id,
|
||||
'journal_id': self.bank_journal_usd.id,
|
||||
})
|
||||
payment.post()
|
||||
credit_aml = payment.move_line_ids.filtered('credit')
|
||||
|
||||
# Check residual before assignation
|
||||
self.assertAlmostEquals(inv1.residual, 10)
|
||||
self.assertAlmostEquals(inv2.residual, 20)
|
||||
|
||||
# Assign credit and residual
|
||||
inv1.assign_outstanding_credit(credit_aml.id)
|
||||
inv2.assign_outstanding_credit(credit_aml.id)
|
||||
self.assertAlmostEquals(inv1.residual, 0)
|
||||
self.assertAlmostEquals(inv2.residual, 0)
|
||||
|
||||
# Unreconcile one invoice at a time and check residual
|
||||
credit_aml.with_context(invoice_id=inv1.id).remove_move_reconcile()
|
||||
self.assertAlmostEquals(inv1.residual, 10)
|
||||
self.assertAlmostEquals(inv2.residual, 0)
|
||||
credit_aml.with_context(invoice_id=inv2.id).remove_move_reconcile()
|
||||
self.assertAlmostEquals(inv1.residual, 10)
|
||||
self.assertAlmostEquals(inv2.residual, 20)
|
||||
|
||||
@@ -204,8 +204,6 @@
|
||||
<group>
|
||||
<field name="name" string="Opportunity Title" placeholder="e.g. Customer Deal"/>
|
||||
<field name="partner_id" domain="[('customer', '=', True)]" context="{'search_default_customer': 1}"/>
|
||||
<field name="email_from" invisible="1"/>
|
||||
<field name="phone" invisible="1"/>
|
||||
<label for="planned_revenue"/>
|
||||
<div class="o_row">
|
||||
<field name="planned_revenue"/>
|
||||
@@ -218,6 +216,19 @@
|
||||
<button string="Create" name="close_dialog" type="object" class="btn-primary"/>
|
||||
<button string="Discard" class="btn-default" special="cancel"/>
|
||||
</footer>
|
||||
<field name="partner_name" invisible="1"/>
|
||||
<field name="contact_name" invisible="1"/>
|
||||
<field name="title" invisible="1"/>
|
||||
<field name="street" invisible="1"/>
|
||||
<field name="street2" invisible="1"/>
|
||||
<field name="city" invisible="1"/>
|
||||
<field name="state_id" invisible="1"/>
|
||||
<field name="country_id" invisible="1"/>
|
||||
<field name="email_from" invisible="1"/>
|
||||
<field name="phone" invisible="1"/>
|
||||
<field name="mobile" invisible="1"/>
|
||||
<field name="zip" invisible="1"/>
|
||||
<field name="function" invisible="1"/>
|
||||
</sheet>
|
||||
</form>
|
||||
</field>
|
||||
|
||||
@@ -604,7 +604,7 @@ msgstr "Bankverbindlichkeiten"
|
||||
#: model:account.account,name:l10n_ch.1_ch_coa_2160
|
||||
#: model:account.account.template,name:l10n_ch.ch_coa_2160
|
||||
msgid "Dettes envers l'actionnaire"
|
||||
msgstr ""
|
||||
msgstr "Gesellschafterverbindlichkeiten"
|
||||
|
||||
#. module: l10n_ch
|
||||
#: model:account.account,name:l10n_ch.1_ch_coa_3806
|
||||
@@ -612,7 +612,7 @@ msgstr ""
|
||||
#: model:account.account.template,name:l10n_ch.ch_coa_3806
|
||||
#: model:account.account.template,name:l10n_ch.ch_coa_4906
|
||||
msgid "Différences de change"
|
||||
msgstr ""
|
||||
msgstr "Währungsdifferenzen"
|
||||
|
||||
#. module: l10n_ch
|
||||
#: model:account.account,name:l10n_ch.1_ch_coa_2261
|
||||
@@ -624,7 +624,7 @@ msgstr "Beschlossene Ausschüttungen"
|
||||
#: model:account.account,name:l10n_ch.1_ch_coa_4071
|
||||
#: model:account.account.template,name:l10n_ch.ch_coa_4071
|
||||
msgid "Droits de douanes à l'importation"
|
||||
msgstr ""
|
||||
msgstr "Einfuhrzölle"
|
||||
|
||||
#. module: l10n_ch
|
||||
#: model:account.account,name:l10n_ch.1_ch_coa_1109
|
||||
@@ -648,7 +648,7 @@ msgstr "Abrechnungskonto MWST"
|
||||
#: model:account.account,name:l10n_ch.1_ch_coa_4009
|
||||
#: model:account.account.template,name:l10n_ch.ch_coa_4009
|
||||
msgid "Déductions obtenues sur achats"
|
||||
msgstr ""
|
||||
msgstr "Einkaufsrabatte"
|
||||
|
||||
#. module: l10n_ch
|
||||
#: model:account.account,name:l10n_ch.1_ch_coa_3009
|
||||
@@ -714,7 +714,7 @@ msgstr "Unterhalt, Reparaturen, Ersatz mobile Sachanlagen"
|
||||
#: model:account.account,name:l10n_ch.1_ch_coa_1570
|
||||
#: model:account.account.template,name:l10n_ch.ch_coa_1570
|
||||
msgid "Equipements et Installations"
|
||||
msgstr ""
|
||||
msgstr "Feste Einrichtungen und Installationen"
|
||||
|
||||
#. module: l10n_ch
|
||||
#: model:account.account,name:l10n_ch.1_ch_coa_3800
|
||||
@@ -722,7 +722,7 @@ msgstr ""
|
||||
#: model:account.account.template,name:l10n_ch.ch_coa_3800
|
||||
#: model:account.account.template,name:l10n_ch.ch_coa_4900
|
||||
msgid "Escomptes"
|
||||
msgstr ""
|
||||
msgstr "Erlösminderungen"
|
||||
|
||||
#. module: l10n_ch
|
||||
#: model:account.account,name:l10n_ch.1_ch_coa_4530
|
||||
@@ -734,31 +734,31 @@ msgstr "Benzin"
|
||||
#: model:account.account,name:l10n_ch.1_ch_coa_3804
|
||||
#: model:account.account.template,name:l10n_ch.ch_coa_3804
|
||||
msgid "Frais d'encaissement"
|
||||
msgstr "Frais d'encaissement"
|
||||
msgstr "Inkassoaufwand"
|
||||
|
||||
#. module: l10n_ch
|
||||
#: model:account.account,name:l10n_ch.1_ch_coa_3807
|
||||
#: model:account.account.template,name:l10n_ch.ch_coa_3807
|
||||
msgid "Frais d'expédition"
|
||||
msgstr "Frais d'expédition"
|
||||
msgstr "Versandkosten"
|
||||
|
||||
#. module: l10n_ch
|
||||
#: model:account.account,name:l10n_ch.1_ch_coa_4072
|
||||
#: model:account.account.template,name:l10n_ch.ch_coa_4072
|
||||
msgid "Frais de transport à l'achat"
|
||||
msgstr "Frais de transport à l'achat"
|
||||
msgstr "Transportkosten"
|
||||
|
||||
#. module: l10n_ch
|
||||
#: model:account.account,name:l10n_ch.1_ch_coa_4070
|
||||
#: model:account.account.template,name:l10n_ch.ch_coa_4070
|
||||
msgid "Frêts à l'achat"
|
||||
msgstr ""
|
||||
msgstr "Frachtkosten"
|
||||
|
||||
#. module: l10n_ch
|
||||
#: model:account.account,name:l10n_ch.1_ch_coa_4510
|
||||
#: model:account.account.template,name:l10n_ch.ch_coa_4510
|
||||
msgid "Gaz"
|
||||
msgstr "Gaz"
|
||||
msgstr "Gas"
|
||||
|
||||
#. module: l10n_ch
|
||||
#: model:account.account,name:l10n_ch.1_ch_coa_1770
|
||||
@@ -992,7 +992,7 @@ msgstr "Beteiligungen"
|
||||
#: model:account.account,name:l10n_ch.1_ch_coa_4086
|
||||
#: model:account.account.template,name:l10n_ch.ch_coa_4086
|
||||
msgid "Pertes de matières"
|
||||
msgstr ""
|
||||
msgstr "Warenschwund"
|
||||
|
||||
#. module: l10n_ch
|
||||
#: model:account.account,name:l10n_ch.1_ch_coa_3805
|
||||
@@ -1125,13 +1125,13 @@ msgstr "Werbeaufwand"
|
||||
#: model:account.account,name:l10n_ch.1_ch_coa_3801
|
||||
#: model:account.account.template,name:l10n_ch.ch_coa_3801
|
||||
msgid "Rabais et réduction de prix"
|
||||
msgstr ""
|
||||
msgstr "Rabatte und Preisreduktionen"
|
||||
|
||||
#. module: l10n_ch
|
||||
#: model:account.account,name:l10n_ch.1_ch_coa_4901
|
||||
#: model:account.account.template,name:l10n_ch.ch_coa_4901
|
||||
msgid "Rabais et réductions de prix"
|
||||
msgstr ""
|
||||
msgstr "Rabatte und Preisreduktionen"
|
||||
|
||||
#. module: l10n_ch
|
||||
#: model:account.account,name:l10n_ch.1_ch_coa_3802
|
||||
@@ -1139,7 +1139,7 @@ msgstr ""
|
||||
#: model:account.account.template,name:l10n_ch.ch_coa_3802
|
||||
#: model:account.account.template,name:l10n_ch.ch_coa_4092
|
||||
msgid "Ristournes"
|
||||
msgstr ""
|
||||
msgstr "Rückvergütungen"
|
||||
|
||||
#. module: l10n_ch
|
||||
#: model:account.account,name:l10n_ch.1_ch_coa_2940
|
||||
@@ -1473,13 +1473,13 @@ msgstr "Wertschriften"
|
||||
#: model:account.account,name:l10n_ch.1_transfer_account_id
|
||||
#: model:account.account.template,name:l10n_ch.transfer_account_id
|
||||
msgid "Transferts internes"
|
||||
msgstr ""
|
||||
msgstr "Interne Verrechnungen"
|
||||
|
||||
#. module: l10n_ch
|
||||
#: model:account.account,name:l10n_ch.1_ch_coa_1280
|
||||
#: model:account.account.template,name:l10n_ch.ch_coa_1280
|
||||
msgid "Travaux en cours"
|
||||
msgstr "Unfertige Erzeugnisse"
|
||||
msgstr "Nicht fakturierte Dienstleistungen"
|
||||
|
||||
#. module: l10n_ch
|
||||
#: model:account.account,name:l10n_ch.1_ch_coa_3940
|
||||
@@ -1491,19 +1491,19 @@ msgstr "Bestandesänderungen nicht fakturierte Dienstleistungen"
|
||||
#: model:account.account,name:l10n_ch.1_ch_coa_1287
|
||||
#: model:account.account.template,name:l10n_ch.ch_coa_1287
|
||||
msgid "Variation de la valeur des travaux en cours"
|
||||
msgstr ""
|
||||
msgstr "Bestandesänderungen nicht fakturierte Dienstleistungen"
|
||||
|
||||
#. module: l10n_ch
|
||||
#: model:account.account,name:l10n_ch.1_ch_coa_1277
|
||||
#: model:account.account.template,name:l10n_ch.ch_coa_1277
|
||||
msgid "Variation de stock produits semi-ouvrés"
|
||||
msgstr ""
|
||||
msgstr "Bestandesänderungen unfertige Erzeugnisse"
|
||||
|
||||
#. module: l10n_ch
|
||||
#: model:account.account,name:l10n_ch.1_ch_coa_1267
|
||||
#: model:account.account.template,name:l10n_ch.ch_coa_1267
|
||||
msgid "Variation de stocks de produits finis"
|
||||
msgstr ""
|
||||
msgstr "Bestandesänderungen fertige Erzeugnisse"
|
||||
|
||||
#. module: l10n_ch
|
||||
#: model:account.account,name:l10n_ch.1_ch_coa_1207
|
||||
@@ -1511,13 +1511,13 @@ msgstr ""
|
||||
#: model:account.account.template,name:l10n_ch.ch_coa_1207
|
||||
#: model:account.account.template,name:l10n_ch.ch_coa_4800
|
||||
msgid "Variation des stocks de marchandises"
|
||||
msgstr ""
|
||||
msgstr "Bestandesänderungen Handelsware"
|
||||
|
||||
#. module: l10n_ch
|
||||
#: model:account.account,name:l10n_ch.1_ch_coa_4801
|
||||
#: model:account.account.template,name:l10n_ch.ch_coa_4801
|
||||
msgid "Variation des stocks de matières premières"
|
||||
msgstr ""
|
||||
msgstr "Bestandesänderungen Rohstoffe"
|
||||
|
||||
#. module: l10n_ch
|
||||
#: model:account.account,name:l10n_ch.1_ch_coa_3901
|
||||
@@ -1535,7 +1535,7 @@ msgstr "Bestandesänderungen unfertige Erzeugnisse"
|
||||
#: model:account.account,name:l10n_ch.1_ch_coa_1217
|
||||
#: model:account.account.template,name:l10n_ch.ch_coa_1217
|
||||
msgid "Variation des stocks des matières premières"
|
||||
msgstr ""
|
||||
msgstr "Bestandesänderungen Rohstoffe"
|
||||
|
||||
#. module: l10n_ch
|
||||
#: model:account.account,name:l10n_ch.1_ch_coa_4008
|
||||
@@ -1543,7 +1543,7 @@ msgstr ""
|
||||
#: model:account.account.template,name:l10n_ch.ch_coa_4008
|
||||
#: model:account.account.template,name:l10n_ch.ch_coa_4080
|
||||
msgid "Variations de stocks"
|
||||
msgstr ""
|
||||
msgstr "Inventurdifferenzen"
|
||||
|
||||
#. module: l10n_ch
|
||||
#: model:account.account,name:l10n_ch.1_ch_coa_3200
|
||||
|
||||
@@ -720,6 +720,8 @@ class MassMailing(models.Model):
|
||||
def _process_mass_mailing_queue(self):
|
||||
mass_mailings = self.search([('state', 'in', ('in_queue', 'sending')), '|', ('schedule_date', '<', fields.Datetime.now()), ('schedule_date', '=', False)])
|
||||
for mass_mailing in mass_mailings:
|
||||
user = mass_mailing.write_uid or self.env.user
|
||||
mass_mailing = mass_mailing.with_context(**user.sudo(user=user).context_get())
|
||||
if len(mass_mailing.get_remaining_recipients()) > 0:
|
||||
mass_mailing.state = 'sending'
|
||||
mass_mailing.send_mail()
|
||||
|
||||
@@ -346,7 +346,7 @@ class PricelistItem(models.Model):
|
||||
'product.category', 'Product Category', ondelete='cascade',
|
||||
help="Specify a product category if this rule only applies to products belonging to this category or its children categories. Keep empty otherwise.")
|
||||
min_quantity = fields.Integer(
|
||||
'Min. Quantity', default=1,
|
||||
'Min. Quantity', default=0,
|
||||
help="For the rule to apply, bought/sold quantity must be greater "
|
||||
"than or equal to the minimum quantity specified in this field.\n"
|
||||
"Expressed in the default unit of measure of the product.")
|
||||
|
||||
@@ -1177,5 +1177,6 @@ class MailComposeMessage(models.TransientModel):
|
||||
@api.multi
|
||||
def send_mail(self, auto_commit=False):
|
||||
if self._context.get('default_model') == 'purchase.order' and self._context.get('default_res_id'):
|
||||
self = self.with_context(mail_post_autofollow=True)
|
||||
self.mail_purchase_order_on_send()
|
||||
return super(MailComposeMessage, self.with_context(mail_post_autofollow=True)).send_mail(auto_commit=auto_commit)
|
||||
return super(MailComposeMessage, self).send_mail(auto_commit=auto_commit)
|
||||
|
||||
@@ -53,20 +53,19 @@
|
||||
<thead>
|
||||
<tr>
|
||||
<th><strong>Product</strong></th>
|
||||
<th><strong>Ordered Quantity</strong></th>
|
||||
<th><strong>Quantity</strong></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr t-foreach="o.move_lines" t-as="move">
|
||||
<td><span t-field="move.product_id"/></td>
|
||||
<td>
|
||||
<span t-field="move.ordered_qty"/>
|
||||
<span t-field="move.product_uom_qty"/>
|
||||
<span t-field="move.product_uom"/>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<t t-set="backorder" t-value="False"/>
|
||||
<table class="table table-condensed mt48" t-if="o.pack_operation_ids">
|
||||
<t t-set="has_serial_number" t-value="o.pack_operation_ids.filtered('pack_lot_ids')" groups="stock.group_production_lot"/>
|
||||
<thead>
|
||||
@@ -75,10 +74,7 @@
|
||||
<th name="lot_serial" t-if="has_serial_number">
|
||||
<span class="pull-left">Lot/Serial Number</span>
|
||||
</th>
|
||||
<th class="text-center"><strong>Ordered Quantity</strong></th>
|
||||
<th t-if="any([pack_operation.state == 'done' for pack_operation in o.pack_operation_ids])" class="text-right">
|
||||
<strong>Delivered Quantity</strong>
|
||||
</th>
|
||||
<th class="text-center"><strong>Quantity</strong></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@@ -116,18 +112,6 @@
|
||||
<td class="text-center">
|
||||
<span t-if="pack_operation.package_id">:</span>
|
||||
<span t-field="pack_operation.package_id"/>
|
||||
<span t-field="pack_operation.ordered_qty"/>
|
||||
<t t-if="pack_operation.linked_move_operation_ids">
|
||||
<span t-field="pack_operation.linked_move_operation_ids[0].move_id.product_uom"></span>
|
||||
</t>
|
||||
<t t-else="1">
|
||||
<span t-field="pack_operation.product_uom_id"></span>
|
||||
</t>
|
||||
</td>
|
||||
<td class="text-right" t-if="pack_operation.state == 'done'">
|
||||
<t t-if="pack_operation.ordered_qty != pack_operation.qty_done_uom_ordered">
|
||||
<t t-set="backorder" t-value="True"/>
|
||||
</t>
|
||||
<span t-field="pack_operation.qty_done_uom_ordered"/>
|
||||
<t t-if="pack_operation.linked_move_operation_ids">
|
||||
<span t-field="pack_operation.linked_move_operation_ids[0].move_id.product_uom"></span>
|
||||
@@ -143,7 +127,7 @@
|
||||
This shipment is a backorder of <t t-esc="o.backorder_id.name"/>.
|
||||
</p>
|
||||
<p>
|
||||
<t t-if="backorder">
|
||||
<t t-if="o.search([('backorder_id', '=', o.id), ('state', 'not in', ['cancel', 'done'])])">
|
||||
All items couldn't be shipped, the remaining ones will be shipped as soon as they become available.
|
||||
</t>
|
||||
</p>
|
||||
|
||||
@@ -44,6 +44,8 @@ class AccountInvoiceLine(models.Model):
|
||||
|
||||
def _get_anglo_saxon_price_unit(self):
|
||||
self.ensure_one()
|
||||
if not self.product_id:
|
||||
return self.price_unit
|
||||
return self.product_id._get_anglo_saxon_price_unit(uom=self.uom_id)
|
||||
|
||||
def _get_price(self, company_currency, price_unit):
|
||||
|
||||
@@ -46,7 +46,7 @@
|
||||
<field name="name">Public access to user_input</field>
|
||||
<field name="model_id" ref="survey.model_survey_user_input"/>
|
||||
<field name="domain_force">[('create_uid', '=', user.id)]</field>
|
||||
<field name="groups" eval="[(4, ref('base.group_public'))]"/>
|
||||
<field name="groups" eval="[(4, ref('base.group_user')), (4, ref('base.group_portal')), (4, ref('base.group_public'))]"/>
|
||||
<field eval="0" name="perm_unlink"/>
|
||||
<field eval="0" name="perm_write"/>
|
||||
<field eval="1" name="perm_read"/>
|
||||
|
||||
@@ -966,7 +966,7 @@ class Binary(http.Controller):
|
||||
'/web/content/<int:id>-<string:unique>/<string:filename>',
|
||||
'/web/content/<string:model>/<int:id>/<string:field>',
|
||||
'/web/content/<string:model>/<int:id>/<string:field>/<string:filename>'], type='http', auth="public")
|
||||
def content_common(self, xmlid=None, model='ir.attachment', id=None, field='datas', filename=None, filename_field='datas_fname', unique=None, mimetype=None, download=None, data=None, token=None):
|
||||
def content_common(self, xmlid=None, model='ir.attachment', id=None, field='datas', filename=None, filename_field='datas_fname', unique=None, mimetype=None, download=None, data=None, token=None, **kw):
|
||||
status, headers, content = binary_content(xmlid=xmlid, model=model, id=id, field=field, unique=unique, filename=filename, filename_field=filename_field, download=download, mimetype=mimetype)
|
||||
if status == 304:
|
||||
response = werkzeug.wrappers.Response(status=status, headers=headers)
|
||||
|
||||
@@ -1445,13 +1445,11 @@ var FieldStatus = common.AbstractField.extend({
|
||||
// For field type selection filter values according to
|
||||
// statusbar_visible attribute of the field. For example:
|
||||
// statusbar_visible="draft,open".
|
||||
var select = this.field.selection;
|
||||
for(var i=0; i < select.length; i++) {
|
||||
var key = select[i][0];
|
||||
if(key === this.get('value') || !this.options.visible || this.options.visible.indexOf(key) !== -1) {
|
||||
selection_unfolded.push(select[i]);
|
||||
}
|
||||
}
|
||||
var restriction = _.isString(this.options.visible) ? this.options.visible.split(',') : [];
|
||||
selection_unfolded = _.filter(this.field.selection, function (val) {
|
||||
return val[0] === self.get('value') || !self.options.visible || _.contains(restriction, val[0]);
|
||||
});
|
||||
|
||||
return $.when();
|
||||
}
|
||||
}, this);
|
||||
|
||||
@@ -104,8 +104,8 @@
|
||||
and main_object.website_meta_description or website_meta_description"/>
|
||||
<t t-set="meta_keywords" t-value="main_object and 'website_meta_keywords' in main_object
|
||||
and main_object.website_meta_keywords or website_meta_keywords"/>
|
||||
<meta t-if="meta_description" name="description" t-att-content="meta_description"/>
|
||||
<meta t-if="meta_keywords" name="keywords" t-att-content="meta_keywords"/>
|
||||
<meta t-if="meta_description or editable" name="description" t-att-content="meta_description"/>
|
||||
<meta t-if="meta_keywords or editable" name="keywords" t-att-content="meta_keywords"/>
|
||||
|
||||
<!-- OpenGraph tags for Facebook sharing -->
|
||||
<meta property="og:title" t-att-content="additional_title" />
|
||||
|
||||
@@ -224,7 +224,7 @@
|
||||
<select name="country_id" class="form-control">
|
||||
<option value="">Country...</option>
|
||||
<t t-foreach="countries or []" t-as="country">
|
||||
<option t-att-value="country.id" t-att-selected="country.id == partner.country_id.id">
|
||||
<option t-att-value="country.id" t-att-selected="country.id == int(country_id) if country_id else country.id == partner.country_id.id">
|
||||
<t t-esc="country.name" />
|
||||
</option>
|
||||
</t>
|
||||
|
||||
@@ -13,7 +13,11 @@ class Project(models.Model):
|
||||
""" Instead of the classic form view, redirect to website for portal users
|
||||
that can read the project. """
|
||||
self.ensure_one()
|
||||
if self.env.user.share:
|
||||
if self.env.context.get('uid'):
|
||||
user = self.env['res.users'].browse(self.env.context['uid'])
|
||||
else:
|
||||
user = self.env.user
|
||||
if user.share:
|
||||
try:
|
||||
self.check_access_rule('read')
|
||||
except exceptions.AccessError:
|
||||
@@ -51,7 +55,11 @@ class Task(models.Model):
|
||||
""" Instead of the classic form view, redirect to website for portal users
|
||||
that can read the task. """
|
||||
self.ensure_one()
|
||||
if self.env.user.share:
|
||||
if self.env.context.get('uid'):
|
||||
user = self.env['res.users'].browse(self.env.context['uid'])
|
||||
else:
|
||||
user = self.env.user
|
||||
if user.share:
|
||||
try:
|
||||
self.check_access_rule('read')
|
||||
except exceptions.AccessError:
|
||||
|
||||
@@ -26,7 +26,11 @@ class Issue(models.Model):
|
||||
""" Instead of the classic form view, redirect to website for portal users
|
||||
that can read the issue. """
|
||||
self.ensure_one()
|
||||
if self.env.user.share:
|
||||
if self.env.context.get('uid'):
|
||||
user = self.env['res.users'].browse(self.env.context['uid'])
|
||||
else:
|
||||
user = self.env.user
|
||||
if user.share:
|
||||
try:
|
||||
self.check_access_rule('read')
|
||||
except exceptions.AccessError:
|
||||
@@ -45,6 +49,9 @@ class Issue(models.Model):
|
||||
groups = super(Issue, self)._notification_recipients(message, groups)
|
||||
|
||||
for group_name, group_method, group_data in groups:
|
||||
if group_name in ["customer", "portal"]:
|
||||
continue
|
||||
|
||||
group_data['has_button_access'] = True
|
||||
|
||||
return groups
|
||||
|
||||
@@ -1349,7 +1349,8 @@
|
||||
<div t-esc="int(line.product_uom_qty) == line.product_uom_qty and int(line.product_uom_qty) or line.product_uom_qty" />
|
||||
</td>
|
||||
<td class="text-center td-price">
|
||||
<span t-field="line.price_unit" style="white-space: nowrap;" t-options="{'widget': 'monetary','from_currency': website_sale_order.pricelist_id.currency_id,'display_currency': website.currency_id}" />
|
||||
<span t-field="line.price_reduce_taxexcl" style="white-space: nowrap;" t-options="{'widget': 'monetary', 'from_currency': website_sale_order.pricelist_id.currency_id, 'display_currency': website.currency_id}" groups="sale.group_show_price_subtotal" />
|
||||
<span t-field="line.price_reduce_taxinc" style="white-space: nowrap;" t-options="{'widget': 'monetary', 'from_currency': website_sale_order.pricelist_id.currency_id, 'display_currency': website.currency_id}" groups="sale.group_show_price_total" />
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
|
||||
@@ -27,7 +27,10 @@ class SaleOrder(models.Model):
|
||||
@api.depends('order_line.price_unit', 'order_line.tax_id', 'order_line.discount', 'order_line.product_uom_qty')
|
||||
def _compute_amount_delivery(self):
|
||||
for order in self:
|
||||
order.amount_delivery = sum(order.order_line.filtered('is_delivery').mapped('price_subtotal'))
|
||||
if self.env.user.has_group('sale.group_show_price_subtotal'):
|
||||
order.amount_delivery = sum(order.order_line.filtered('is_delivery').mapped('price_subtotal'))
|
||||
else:
|
||||
order.amount_delivery = sum(order.order_line.filtered('is_delivery').mapped('price_total'))
|
||||
|
||||
@api.depends('order_line.is_delivery')
|
||||
def _compute_has_delivery(self):
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
Austria, 18th of March 2018
|
||||
|
||||
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,
|
||||
|
||||
Andreas Perhab bigbear.ap@gmx.at https://github.com/bigbear3001
|
||||
@@ -0,0 +1,11 @@
|
||||
Switzerland, 2018-03-20
|
||||
|
||||
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,
|
||||
|
||||
Andreas Hochuli a.hochuli@hispeed.ch https://github.com/Highcooley
|
||||
@@ -481,7 +481,7 @@ Source installation requires manually installing dependencies:
|
||||
|
||||
$ sudo npm install -g less
|
||||
|
||||
- on Windows, `install nodejs <http://nodejs.org/download/>`_, reboot (to
|
||||
- on Windows, `install nodejs <https://nodejs.org/en/download/>`_, reboot (to
|
||||
update the :envvar:`PATH`) and install less:
|
||||
|
||||
.. code-block:: ps1
|
||||
|
||||
@@ -125,7 +125,7 @@ class IrActionsReportXml(models.Model):
|
||||
def _compute_report_sxw(self):
|
||||
for report in self:
|
||||
if report.report_rml:
|
||||
self.report_sxw = report.report_rml.replace('.rml', '.sxw')
|
||||
report.report_sxw = report.report_rml.replace('.rml', '.sxw')
|
||||
|
||||
def _report_content(self, name):
|
||||
data = self[name + '_content_data']
|
||||
|
||||
Reference in New Issue
Block a user