[MERGE] forward port branch saas-13 up to c813dbf
This commit is contained in:
@@ -20,7 +20,13 @@ class AccountInvoice(models.Model):
|
||||
asset_ids = self.env['account.asset.asset'].sudo().search([('invoice_id', '=', inv.id), ('company_id', '=', inv.company_id.id)])
|
||||
if asset_ids:
|
||||
asset_ids.write({'active': False})
|
||||
inv.invoice_line_ids.asset_create()
|
||||
context = dict(self.env.context)
|
||||
# Within the context of an invoice,
|
||||
# this default value is for the type of the invoice, not the type of the asset.
|
||||
# This has to be cleaned from the context before creating the asset,
|
||||
# otherwise it tries to create the asset with the type of the invoice.
|
||||
context.pop('default_type', None)
|
||||
inv.invoice_line_ids.with_context(context).asset_create()
|
||||
return result
|
||||
|
||||
|
||||
|
||||
@@ -100,7 +100,7 @@ class CompanyLDAP(models.Model):
|
||||
_logger.warning('Could not format LDAP filter. Your filter should contain one \'%s\'.')
|
||||
return False
|
||||
try:
|
||||
results = self.query(conf, filter)
|
||||
results = self.query(conf, tools.ustr(filter))
|
||||
|
||||
# Get rid of (None, attrs) for searchResultReference replies
|
||||
results = [i for i in results if i[0]]
|
||||
|
||||
@@ -701,7 +701,7 @@ msgstr "R.S.Z. 4de kwartaal"
|
||||
#. module: l10n_be
|
||||
#: model:account.account.template,name:l10n_be.a4540
|
||||
msgid "ONSS. Arriérés"
|
||||
msgstr ""
|
||||
msgstr "Achterstallige bijdragen RSZ"
|
||||
|
||||
#. module: l10n_be
|
||||
#: model:account.account.template,name:l10n_be.a4553
|
||||
@@ -879,7 +879,7 @@ msgstr "Waardeverminderingen op voorraden"
|
||||
#. module: l10n_be
|
||||
#: model:account.fiscal.position.template,name:l10n_be.fiscal_position_template_4
|
||||
msgid "Régime Cocontractant"
|
||||
msgstr ""
|
||||
msgstr "Medecontractant"
|
||||
|
||||
#. module: l10n_be
|
||||
#: model:account.fiscal.position.template,name:l10n_be.fiscal_position_template_2
|
||||
|
||||
@@ -441,11 +441,14 @@ class MailThread(models.AbstractModel):
|
||||
- a set of updated column names
|
||||
- a list of changes (initial value, new value, column name, column info) """
|
||||
self.ensure_one()
|
||||
changes = set()
|
||||
changes = set() # contains always and onchange tracked fields that changed
|
||||
displays = set() # contains always tracked field that did not change but displayed for information
|
||||
tracking_value_ids = []
|
||||
display_values_ids = []
|
||||
|
||||
# generate tracked_values data structure: {'col_name': {col_info, new_value, old_value}}
|
||||
for col_name, col_info in tracked_fields.items():
|
||||
track_visibility = getattr(self._fields[col_name], 'track_visibility', 'onchange')
|
||||
initial_value = initial[col_name]
|
||||
new_value = getattr(self, col_name)
|
||||
|
||||
@@ -456,6 +459,16 @@ class MailThread(models.AbstractModel):
|
||||
|
||||
if col_name in tracked_fields:
|
||||
changes.add(col_name)
|
||||
# 'always' tracked fields in separate variable; added if other changes
|
||||
elif new_value == initial_value and track_visibility == 'always' and col_name in tracked_fields:
|
||||
tracking = self.env['mail.tracking.value'].create_tracking_values(initial_value, initial_value, col_name, col_info)
|
||||
if tracking:
|
||||
display_values_ids.append([0, 0, tracking])
|
||||
displays.add(col_name)
|
||||
|
||||
if changes and displays:
|
||||
tracking_value_ids = display_values_ids + tracking_value_ids
|
||||
|
||||
return changes, tracking_value_ids
|
||||
|
||||
@api.multi
|
||||
|
||||
@@ -10,6 +10,7 @@ class MailTracking(models.Model):
|
||||
_name = 'mail.tracking.value'
|
||||
_description = 'Mail Tracking Value'
|
||||
|
||||
# TDE CLEANME: why not a m2o to ir model field ?
|
||||
field = fields.Char('Changed Field', required=True, readonly=1)
|
||||
field_desc = fields.Char('Field Description', required=True, readonly=1)
|
||||
field_type = fields.Char('Field Type')
|
||||
|
||||
@@ -128,7 +128,8 @@ function make_message (data) {
|
||||
subtype_description: data.subtype_description,
|
||||
is_author: data.author_id && data.author_id[0] === session.partner_id,
|
||||
is_note: data.is_note,
|
||||
is_system_notification: data.message_type === 'notification' && data.model === 'mail.channel',
|
||||
is_system_notification: (data.message_type === 'notification' && data.model === 'mail.channel')
|
||||
|| data.info === 'transient_message',
|
||||
attachment_ids: data.attachment_ids || [],
|
||||
subject: data.subject,
|
||||
email_from: data.email_from,
|
||||
|
||||
@@ -154,9 +154,11 @@
|
||||
<t t-esc="value.changed_field"/>:
|
||||
<t t-if="value.old_value">
|
||||
<span> <t t-esc="value.old_value || ((value.field_type !== 'boolean') and '')"/> </span>
|
||||
<span class="fa fa-long-arrow-right"/>
|
||||
<span t-if="value.old_value != value.new_value" class="fa fa-long-arrow-right"/>
|
||||
</t>
|
||||
<span> <t t-esc="value.new_value || ((value.field_type !== 'boolean') and '')"/> </span>
|
||||
<span t-if="value.old_value != value.new_value">
|
||||
<t t-esc="value.new_value || ((value.field_type !== 'boolean') and '')"/>
|
||||
</span>
|
||||
</li>
|
||||
</t>
|
||||
</ul>
|
||||
|
||||
@@ -122,10 +122,10 @@ class TestTracking(TestMail):
|
||||
self.assertEqual(len(self.group_pigs.message_ids), 3)
|
||||
last_msg = self.group_pigs.message_ids[0]
|
||||
self.assertEqual(last_msg.subtype_id, mt_group_public_set)
|
||||
self.assertEqual(len(last_msg.tracking_value_ids), 2)
|
||||
self.assertEqual(set(last_msg.tracking_value_ids.mapped('field')), set(['group_public_id', 'public']))
|
||||
self.assertEqual(set(last_msg.tracking_value_ids.mapped('field_desc')), set(['Authorized Group', 'Privacy']))
|
||||
self.assertEqual(set(last_msg.tracking_value_ids.mapped('old_value_char')), set([group_user.name_get()[0][1], 'Invited people only']))
|
||||
self.assertEqual(set(last_msg.tracking_value_ids.mapped('new_value_char')), set([group_system.name_get()[0][1], 'Everyone']))
|
||||
self.assertEqual(len(last_msg.tracking_value_ids), 3)
|
||||
self.assertEqual(set(last_msg.tracking_value_ids.mapped('field')), set(['group_public_id', 'public', 'name']))
|
||||
self.assertEqual(set(last_msg.tracking_value_ids.mapped('field_desc')), set(['Authorized Group', 'Privacy', 'Name']))
|
||||
self.assertEqual(set(last_msg.tracking_value_ids.mapped('old_value_char')), set([group_user.name_get()[0][1], 'Invited people only', 'supername']))
|
||||
self.assertEqual(set(last_msg.tracking_value_ids.mapped('new_value_char')), set([group_system.name_get()[0][1], 'Everyone', 'supername']))
|
||||
self.assertEqual(set(last_msg.tracking_value_ids.mapped('old_value_integer')), set([0, group_user.id]))
|
||||
self.assertEqual(set(last_msg.tracking_value_ids.mapped('new_value_integer')), set([0, group_system.id]))
|
||||
|
||||
@@ -69,30 +69,8 @@
|
||||
<field name="parent_id" eval="ref('mt_mat_assign')"/>
|
||||
<field name="relation_field">category_id</field>
|
||||
</record>
|
||||
|
||||
<record id="equipment_computer" model="maintenance.equipment.category">
|
||||
<field name="name">Computers</field>
|
||||
<field name="alias_id" ref="mail_alias_equipment"/>
|
||||
</record>
|
||||
<record id="equipment_software" model="maintenance.equipment.category">
|
||||
<field name="name">Software</field>
|
||||
<field name="alias_id" ref="mail_alias_equipment"/>
|
||||
</record>
|
||||
<record id="equipment_printer" model="maintenance.equipment.category">
|
||||
<field name="name">Printers</field>
|
||||
<field name="alias_id" ref="mail_alias_equipment"/>
|
||||
</record>
|
||||
|
||||
<record id="equipment_team_maintenance" model="maintenance.team">
|
||||
<field name="name">Internal Maintenance</field>
|
||||
</record>
|
||||
|
||||
<record id="equipment_team_metrology" model="maintenance.team">
|
||||
<field name="name">Metrology</field>
|
||||
</record>
|
||||
|
||||
<record id="equipment_team_subcontractor" model="maintenance.team">
|
||||
<field name="name">Subcontractor</field>
|
||||
</record>
|
||||
</data>
|
||||
</odoo>
|
||||
|
||||
@@ -2,7 +2,28 @@
|
||||
<odoo>
|
||||
<data noupdate="1">
|
||||
|
||||
|
||||
<!-- Maintenance teams -->
|
||||
<record id="equipment_team_metrology" model="maintenance.team">
|
||||
<field name="name">Metrology</field>
|
||||
</record>
|
||||
<record id="equipment_team_subcontractor" model="maintenance.team">
|
||||
<field name="name">Subcontractor</field>
|
||||
</record>
|
||||
|
||||
<!-- Equipment categories -->
|
||||
<record id="equipment_computer" model="maintenance.equipment.category">
|
||||
<field name="name">Computers</field>
|
||||
<field name="alias_id" ref="mail_alias_equipment"/>
|
||||
</record>
|
||||
<record id="equipment_software" model="maintenance.equipment.category">
|
||||
<field name="name">Software</field>
|
||||
<field name="alias_id" ref="mail_alias_equipment"/>
|
||||
</record>
|
||||
<record id="equipment_printer" model="maintenance.equipment.category">
|
||||
<field name="name">Printers</field>
|
||||
<field name="alias_id" ref="mail_alias_equipment"/>
|
||||
</record>
|
||||
<record id="equipment_monitor" model="maintenance.equipment.category">
|
||||
<field name="name">Monitors</field>
|
||||
<field name="technician_user_id" ref="base.user_root"/>
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
import werkzeug
|
||||
|
||||
from odoo import http
|
||||
from odoo import http, _
|
||||
from odoo.http import request
|
||||
|
||||
|
||||
|
||||
@@ -66,6 +66,7 @@ Dashboard / Reports for MRP will include:
|
||||
'demo': [
|
||||
'data/mrp_demo.xml',
|
||||
'data/mrp_lot_demo.yml'],
|
||||
'qweb': ['static/src/xml/mrp.xml'],
|
||||
'test': [],
|
||||
'application': True,
|
||||
}
|
||||
|
||||
@@ -90,7 +90,7 @@
|
||||
<field name="name">Manual Assembly</field>
|
||||
<field name="time_cycle">60</field>
|
||||
<field name="sequence">5</field>
|
||||
<field name="worksheet" type="base64" file="mrp/static/img/assebly-worksheet.jpg"/>
|
||||
<field name="worksheet" type="base64" file="mrp/static/img/assebly-worksheet.pdf"/>
|
||||
</record>
|
||||
|
||||
<record id="mrp_routing_workcenter_1" model="mrp.routing.workcenter">
|
||||
@@ -99,7 +99,7 @@
|
||||
<field name="name">Long time assembly</field>
|
||||
<field name="time_cycle">180</field>
|
||||
<field name="sequence">15</field>
|
||||
<field name="worksheet" type="base64" file="mrp/static/img/cutting-worksheet.jpg"/>
|
||||
<field name="worksheet" type="base64" file="mrp/static/img/cutting-worksheet.pdf"/>
|
||||
</record>
|
||||
|
||||
<record id="mrp_routing_workcenter_3" model="mrp.routing.workcenter">
|
||||
@@ -108,7 +108,7 @@
|
||||
<field name="name">Testing</field>
|
||||
<field name="time_cycle">60</field>
|
||||
<field name="sequence">10</field>
|
||||
<field name="worksheet" type="base64" file="mrp/static/img/assebly-worksheet.jpg"/>
|
||||
<field name="worksheet" type="base64" file="mrp/static/img/assebly-worksheet.pdf"/>
|
||||
</record>
|
||||
|
||||
<record id="mrp_routing_workcenter_4" model="mrp.routing.workcenter">
|
||||
@@ -117,7 +117,7 @@
|
||||
<field name="name">Packing</field>
|
||||
<field name="time_cycle">30</field>
|
||||
<field name="sequence">5</field>
|
||||
<field name="worksheet" type="base64" file="mrp/static/img/cutting-worksheet.jpg"/>
|
||||
<field name="worksheet" type="base64" file="mrp/static/img/cutting-worksheet.pdf"/>
|
||||
</record>
|
||||
|
||||
<record id="mrp_routing_workcenter_2" model="mrp.routing.workcenter">
|
||||
@@ -126,7 +126,7 @@
|
||||
<field name="time_cycle">120</field>
|
||||
<field name="sequence">5</field>
|
||||
<field name="name">Manual Assembly</field>
|
||||
<field name="worksheet" type="base64" file="mrp/static/img/assebly-worksheet.jpg"/>
|
||||
<field name="worksheet" type="base64" file="mrp/static/img/assebly-worksheet.pdf"/>
|
||||
</record>
|
||||
|
||||
<record id="mrp_routing_workcenter_5" model="mrp.routing.workcenter">
|
||||
@@ -135,7 +135,7 @@
|
||||
<field name="time_cycle">120</field>
|
||||
<field name="sequence">10</field>
|
||||
<field name="name">Cutting</field>
|
||||
<field name="worksheet" type="base64" file="mrp/static/img/cutting-worksheet.jpg"/>
|
||||
<field name="worksheet" type="base64" file="mrp/static/img/cutting-worksheet.pdf"/>
|
||||
</record>
|
||||
|
||||
<record id="mrp_routing_workcenter_6" model="mrp.routing.workcenter">
|
||||
@@ -144,7 +144,7 @@
|
||||
<field name="time_cycle">120</field>
|
||||
<field name="sequence">15</field>
|
||||
<field name="name">Drilling</field>
|
||||
<field name="worksheet" type="base64" file="mrp/static/img/drill-worksheet.jpg"/>
|
||||
<field name="worksheet" type="base64" file="mrp/static/img/drill-worksheet.pdf"/>
|
||||
</record>
|
||||
|
||||
<record id="mrp_routing_workcenter_7" model="mrp.routing.workcenter">
|
||||
@@ -153,7 +153,7 @@
|
||||
<field name="time_cycle">120</field>
|
||||
<field name="sequence">20</field>
|
||||
<field name="name">Assembly</field>
|
||||
<field name="worksheet" type="base64" file="mrp/static/img/assebly-worksheet.jpg"/>
|
||||
<field name="worksheet" type="base64" file="mrp/static/img/assebly-worksheet.pdf"/>
|
||||
</record>
|
||||
|
||||
<!-- Resource: mrp.bom -->
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 76 KiB |
Binary file not shown.
Binary file not shown.
|
Before Width: | Height: | Size: 89 KiB |
Binary file not shown.
Binary file not shown.
|
Before Width: | Height: | Size: 66 KiB |
Binary file not shown.
@@ -5,6 +5,8 @@ var core = require('web.core');
|
||||
var common = require('web.form_common');
|
||||
var Model = require('web.Model');
|
||||
var time = require('web.time');
|
||||
var utils = require('web.utils');
|
||||
var FieldBinaryFile = core.form_widget_registry.get('binary');
|
||||
|
||||
var _t = core._t;
|
||||
|
||||
@@ -72,6 +74,74 @@ var TimeCounter = common.AbstractField.extend(common.ReinitializeFieldMixin, {
|
||||
},
|
||||
});
|
||||
|
||||
core.form_widget_registry.add('bullet_state', SetBulletStatus)
|
||||
.add('mrp_time_counter', TimeCounter);
|
||||
var FieldPdfViewer = FieldBinaryFile.extend({
|
||||
template: 'FieldPdfViewer',
|
||||
init: function(){
|
||||
this._super.apply(this, arguments);
|
||||
this.PDFViewerApplication = false;
|
||||
},
|
||||
get_uri: function(){
|
||||
var query_obj = {
|
||||
model: this.view.dataset.model,
|
||||
field: this.name,
|
||||
id: this.view.datarecord.id
|
||||
};
|
||||
var query_string = $.param(query_obj);
|
||||
var url = encodeURIComponent('/web/image?' + query_string);
|
||||
var viewer_url = '/web/static/lib/pdfjs/web/viewer.html?file=';
|
||||
return viewer_url + url;
|
||||
},
|
||||
on_file_change: function(ev) {
|
||||
this._super.apply(this, arguments);
|
||||
if(this.PDFViewerApplication){
|
||||
var files = ev.target.files;
|
||||
if (!files || files.length === 0) {
|
||||
return;
|
||||
}
|
||||
var file = files[0];
|
||||
// TOCheck: is there requirement to fallback on FileReader if browser don't support URL
|
||||
this.PDFViewerApplication.open(URL.createObjectURL(file), 0);
|
||||
}
|
||||
},
|
||||
render_value: function() {
|
||||
var $pdf_viewer = this.$('.o_form_pdf_controls').children().add(this.$('.o_pdfview_iframe')),
|
||||
$select_upload_el = this.$('.o_select_file_button').first(),
|
||||
$iFrame = this.$('.o_pdfview_iframe'),
|
||||
value = this.get('value'),
|
||||
self = this;
|
||||
|
||||
var bin_size = utils.is_bin_size(value);
|
||||
$iFrame.on('load', function(){
|
||||
self.PDFViewerApplication = this.contentWindow.window.PDFViewerApplication;
|
||||
self.disable_buttons(this);
|
||||
});
|
||||
if (this.get("effective_readonly")) {
|
||||
if (value) {
|
||||
this.$el.off('click'); // off click event(on_save_as) of FieldBinaryFile
|
||||
$iFrame.attr('src', this.get_uri());
|
||||
}
|
||||
} else {
|
||||
if (value) {
|
||||
$pdf_viewer.removeClass('o_hidden');
|
||||
$select_upload_el.addClass('o_hidden');
|
||||
if(bin_size){
|
||||
$iFrame.attr('src', this.get_uri());
|
||||
}
|
||||
} else {
|
||||
$pdf_viewer.addClass('o_hidden');
|
||||
$select_upload_el.removeClass('o_hidden');
|
||||
}
|
||||
}
|
||||
},
|
||||
disable_buttons: function(iframe){
|
||||
if (this.get("effective_readonly")){
|
||||
$(iframe).contents().find('button#download').hide();
|
||||
}
|
||||
$(iframe).contents().find('button#openFile').hide();
|
||||
}
|
||||
|
||||
});
|
||||
core.form_widget_registry.add('bullet_state', SetBulletStatus)
|
||||
.add('mrp_time_counter', TimeCounter)
|
||||
.add('pdf_viewer', FieldPdfViewer);
|
||||
});
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
.o_form_view {
|
||||
.o_form_field_pdfviewer {
|
||||
width: 100%;
|
||||
height: 450px;
|
||||
border: 0;
|
||||
margin-top: 10px;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<templates id="template" xml:space="preserve">
|
||||
<t t-name="FieldPdfViewer">
|
||||
<div class="o_form_field_pdfviewer">
|
||||
<div t-if="!widget.get('effective_readonly')" class="o_form_pdf_controls mt8">
|
||||
<span class="o_form_binary_progress">Uploading...</span>
|
||||
<button type="button" class="btn btn-sm btn-primary o_select_file_button" title="Select">Upload your file</button>
|
||||
<button class="btn btn-sm btn-default fa fa-pencil o_select_file_button" title="Select" type="button"></button>
|
||||
<button class="btn btn-sm btn-default fa fa-trash-o o_clear_file_button" title="Clear" type="button"></button>
|
||||
</div>
|
||||
<iframe class="o_pdfview_iframe o_form_field_pdfviewer"/>
|
||||
<t t-call="HiddenInputPDFFile">
|
||||
<t t-set="fileupload_id" t-value="widget.fileupload_id"/>
|
||||
<t t-set="fileupload_style" t-translation="off">overflow-x: hidden</t>
|
||||
</t>
|
||||
</div>
|
||||
</t>
|
||||
<t t-extend="HiddenInputFile" t-name="HiddenInputPDFFile">
|
||||
<t t-jquery="input[type='file']:first" t-operation="replace">
|
||||
<input type="file" class="o_form_input_file" name="ufile" accept="application/pdf" />
|
||||
</t>
|
||||
</t>
|
||||
</templates>
|
||||
@@ -47,7 +47,7 @@
|
||||
<field name="note"/>
|
||||
</page>
|
||||
<page string="Work Sheet">
|
||||
<field name="worksheet" widget="image"/>
|
||||
<field name="worksheet" widget="pdf_viewer"/>
|
||||
</page>
|
||||
</notebook>
|
||||
</sheet>
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
<template id="assets_backend" name="mrp assets" inherit_id="web.assets_backend">
|
||||
<xpath expr="." position="inside">
|
||||
<script type="text/javascript" src="/mrp/static/src/js/mrp.js"></script>
|
||||
<link rel="stylesheet" type="text/less" href="/mrp/static/src/less/mrp.less"/>
|
||||
</xpath>
|
||||
</template>
|
||||
|
||||
|
||||
@@ -140,7 +140,7 @@
|
||||
</group>
|
||||
<notebook>
|
||||
<page string="Work Instruction" attrs="{'invisible': [('worksheet', '=', False)]}">
|
||||
<field name="worksheet" widget="image"/>
|
||||
<field name="worksheet" widget="pdf_viewer"/>
|
||||
</page>
|
||||
<page string="Current Production">
|
||||
<group>
|
||||
|
||||
@@ -322,7 +322,7 @@ class Task(models.Model):
|
||||
return stages.browse(stage_ids)
|
||||
|
||||
active = fields.Boolean(default=True)
|
||||
name = fields.Char(string='Task Title', track_visibility='onchange', required=True, index=True)
|
||||
name = fields.Char(string='Task Title', track_visibility='always', required=True, index=True)
|
||||
description = fields.Html(string='Description')
|
||||
priority = fields.Selection([
|
||||
('0','Normal'),
|
||||
@@ -371,7 +371,7 @@ class Task(models.Model):
|
||||
user_id = fields.Many2one('res.users',
|
||||
string='Assigned to',
|
||||
default=lambda self: self.env.uid,
|
||||
index=True, track_visibility='onchange')
|
||||
index=True, track_visibility='always')
|
||||
partner_id = fields.Many2one('res.partner',
|
||||
string='Customer',
|
||||
default=_get_default_partner)
|
||||
|
||||
@@ -180,9 +180,7 @@ class SaleOrder(models.Model):
|
||||
"""
|
||||
Trigger the change of fiscal position when the shipping address is modified.
|
||||
"""
|
||||
fiscal_position = self.env['account.fiscal.position'].get_fiscal_position(self.partner_id.id, self.partner_shipping_id.id)
|
||||
if fiscal_position:
|
||||
self.fiscal_position_id = fiscal_position
|
||||
self.fiscal_position_id = self.env['account.fiscal.position'].get_fiscal_position(self.partner_id.id, self.partner_shipping_id.id)
|
||||
return {}
|
||||
|
||||
@api.multi
|
||||
|
||||
@@ -13,4 +13,5 @@ class MailComposeMessage(models.TransientModel):
|
||||
order = self.env['sale.order'].browse([self._context['default_res_id']])
|
||||
if order.state == 'draft':
|
||||
order.state = 'sent'
|
||||
return super(MailComposeMessage, self.with_context(mail_post_autofollow=True)).send_mail(auto_commit=auto_commit)
|
||||
self = self.with_context(mail_post_autofollow=True)
|
||||
return super(MailComposeMessage, self).send_mail(auto_commit=auto_commit)
|
||||
|
||||
@@ -48,7 +48,8 @@ class AccountInvoice(models.Model):
|
||||
'account_id':dacc,
|
||||
'product_id':i_line.product_id.id,
|
||||
'uom_id':i_line.uom_id.id,
|
||||
'account_analytic_id': False,
|
||||
'account_analytic_id': i_line.account_analytic_id.id,
|
||||
'analytic_tag_ids': i_line.analytic_tag_ids.ids and [(6, 0, i_line.analytic_tag_ids.ids)] or False,
|
||||
},
|
||||
|
||||
{
|
||||
@@ -60,7 +61,8 @@ class AccountInvoice(models.Model):
|
||||
'account_id':cacc,
|
||||
'product_id':i_line.product_id.id,
|
||||
'uom_id':i_line.uom_id.id,
|
||||
'account_analytic_id': False,
|
||||
'account_analytic_id': i_line.account_analytic_id.id,
|
||||
'analytic_tag_ids': i_line.analytic_tag_ids.ids and [(6, 0, i_line.analytic_tag_ids.ids)] or False,
|
||||
},
|
||||
]
|
||||
return []
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
<field name="inherit_id" ref="account.view_category_property_form"/>
|
||||
<field name="arch" type="xml">
|
||||
<group name="account_property" position="inside">
|
||||
<group name="account_stock_property" string="Account Stock Properties" attrs="{'invisible': [('property_valuation', '=', 'manual_periodic')]}">
|
||||
<group name="account_stock_property" string="Account Stock Properties">
|
||||
<field name="property_stock_account_input_categ_id" domain="[('deprecated', '=', False)]"/>
|
||||
<field name="property_stock_account_output_categ_id" domain="[('deprecated', '=', False)]"/>
|
||||
<field name="property_stock_valuation_account_id" domain="[('deprecated', '=', False)]"/>
|
||||
|
||||
@@ -2,11 +2,14 @@
|
||||
# Part of Odoo. See LICENSE file for full copyright and licensing details.
|
||||
|
||||
import copy
|
||||
import logging
|
||||
from lxml import etree, html
|
||||
|
||||
from odoo.exceptions import AccessError
|
||||
from odoo import api, models
|
||||
|
||||
_logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
class IrUiView(models.Model):
|
||||
_inherit = 'ir.ui.view'
|
||||
@@ -180,10 +183,12 @@ class IrUiView(models.Model):
|
||||
user = self.env.user
|
||||
user_groups = set(user.groups_id)
|
||||
views = self.with_context(active_test=False)._views_get(key, bundles=bundles)
|
||||
|
||||
view_theme_id = self.env['ir.model.data'].xmlid_to_res_id('website.theme')
|
||||
done = set()
|
||||
result = []
|
||||
for view in views:
|
||||
if full:
|
||||
if full or (view.customize_show and view.inherit_id.id != view_theme_id):
|
||||
if not user_groups.issuperset(view.groups_id):
|
||||
continue
|
||||
if view.inherit_id not in done:
|
||||
|
||||
@@ -261,7 +261,7 @@ class Website(Home):
|
||||
return request.redirect(redirect)
|
||||
|
||||
@http.route('/website/customize_template_get', type='json', auth='user', website=True)
|
||||
def customize_template_get(self, key, full=True, bundles=False):
|
||||
def customize_template_get(self, key, full=False, bundles=False):
|
||||
""" Get inherit view's informations of the template ``key``. By default, only
|
||||
:returns ``customize_show`` templates (which can be active or not), if
|
||||
``full=True`` returns inherit view's informations of the template ``key``.
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<odoo>
|
||||
<data noupdate="1">
|
||||
<record id="default_website" model="website">
|
||||
<field name="name">Website localhost</field>
|
||||
<field name="name">My Website</field>
|
||||
<field name="domain">localhost</field>
|
||||
<field name="company_id" ref="base.main_company"/>
|
||||
<field name="user_id" ref="base.public_user"/>
|
||||
|
||||
@@ -128,6 +128,9 @@ response = request.render("website.template_partner_comment", {
|
||||
<field name="type">ir.actions.server</field>
|
||||
</record>
|
||||
|
||||
<record id="default_website" model="website">
|
||||
<field name="name">Website localhost</field>
|
||||
</record>
|
||||
<record id="website2" model="website">
|
||||
<field name="name">Website 0.0.0.0</field>
|
||||
<field name="domain">0.0.0.0</field>
|
||||
|
||||
@@ -72,6 +72,7 @@ website.TopBarCustomize = Widget.extend({
|
||||
var $menu = this.$el.children("ul");
|
||||
ajax.jsonRpc('/website/customize_template_get', 'call', {
|
||||
key: this.view_name,
|
||||
full: false
|
||||
}).then(function (result) {
|
||||
_.each(result, function (item) {
|
||||
if (item.header) {
|
||||
|
||||
@@ -9,10 +9,11 @@ from odoo.addons.website_mail.controllers.main import _message_post_helper
|
||||
|
||||
|
||||
class sale_quote(http.Controller):
|
||||
@http.route([
|
||||
"/quote/<int:order_id>",
|
||||
"/quote/<int:order_id>/<token>"
|
||||
], type='http', auth="public", website=True)
|
||||
@http.route("/quote/<int:order_id>", type='http', auth="user", website=True)
|
||||
def view_user(self, *args, **kwargs):
|
||||
return self.view(*args, **kwargs)
|
||||
|
||||
@http.route("/quote/<int:order_id>/<token>", type='http', auth="public", website=True)
|
||||
def view(self, order_id, pdf=None, token=None, message=False, **post):
|
||||
# use sudo to allow accessing/viewing orders for public user
|
||||
# only if he knows the private token
|
||||
|
||||
@@ -586,11 +586,8 @@ class WebsiteSale(http.Controller):
|
||||
order.onchange_partner_id()
|
||||
elif mode[1] == 'shipping':
|
||||
order.partner_shipping_id = partner_id
|
||||
order.onchange_partner_shipping_id()
|
||||
|
||||
order.order_line._compute_tax_id()
|
||||
order.message_partner_ids = [(4, partner_id), (3, request.website.partner_id.id)]
|
||||
|
||||
if not errors:
|
||||
return request.redirect(kw.get('callback') or '/shop/checkout')
|
||||
|
||||
@@ -638,6 +635,9 @@ class WebsiteSale(http.Controller):
|
||||
if redirection:
|
||||
return redirection
|
||||
|
||||
|
||||
order.onchange_partner_shipping_id()
|
||||
order.order_line._compute_tax_id()
|
||||
request.session['sale_last_order_id'] = order.id
|
||||
request.website.sale_get_order(update_pricelist=True)
|
||||
extra_step = request.env.ref('website_sale.extra_info_option')
|
||||
|
||||
+1
-1
@@ -619,7 +619,7 @@ class JsonRequest(WebRequest):
|
||||
# If we use jsonp, that's mean we are called from another host
|
||||
# Some browser (IE and Safari) do no allow third party cookies
|
||||
# We need then to manage http sessions manually.
|
||||
response['session_id'] = self.session_id
|
||||
response['session_id'] = self.session.sid
|
||||
mime = 'application/javascript'
|
||||
body = "%s(%s);" % (self.jsonp, json.dumps(response),)
|
||||
else:
|
||||
|
||||
Reference in New Issue
Block a user