[MERGE] forward port branch 10.0 up to fc06646cf9
This commit is contained in:
@@ -1217,11 +1217,11 @@ class AccountInvoiceLine(models.Model):
|
||||
string='Analytic Account')
|
||||
analytic_tag_ids = fields.Many2many('account.analytic.tag', string='Analytic Tags')
|
||||
company_id = fields.Many2one('res.company', string='Company',
|
||||
related='invoice_id.company_id', store=True, readonly=True)
|
||||
related='invoice_id.company_id', store=True, readonly=True, related_sudo=False)
|
||||
partner_id = fields.Many2one('res.partner', string='Partner',
|
||||
related='invoice_id.partner_id', store=True, readonly=True)
|
||||
currency_id = fields.Many2one('res.currency', related='invoice_id.currency_id', store=True)
|
||||
company_currency_id = fields.Many2one('res.currency', related='invoice_id.company_currency_id', readonly=True)
|
||||
related='invoice_id.partner_id', store=True, readonly=True, related_sudo=False)
|
||||
currency_id = fields.Many2one('res.currency', related='invoice_id.currency_id', store=True, related_sudo=False)
|
||||
company_currency_id = fields.Many2one('res.currency', related='invoice_id.company_currency_id', readonly=True, related_sudo=False)
|
||||
|
||||
@api.model
|
||||
def fields_view_get(self, view_id=None, view_type='form', toolbar=False, submenu=False):
|
||||
|
||||
@@ -10,6 +10,7 @@ var form_common = require('web.form_common');
|
||||
var Model = require('web.DataModel');
|
||||
var pyeval = require('web.pyeval');
|
||||
var ViewManager = require('web.ViewManager');
|
||||
var data_manager = require('web.data_manager');
|
||||
|
||||
var _t = core._t;
|
||||
var QWeb = core.qweb;
|
||||
@@ -174,6 +175,8 @@ var DashBoard = form_common.FormWidget.extend({
|
||||
this.rpc('/web/view/add_custom', {
|
||||
view_id: this.view.fields_view.view_id,
|
||||
arch: arch
|
||||
}).then(function() {
|
||||
data_manager.invalidate();
|
||||
});
|
||||
},
|
||||
on_load_action: function(result, index, action_attrs) {
|
||||
@@ -423,6 +426,7 @@ FavoriteMenu.include({
|
||||
}).then(function (r) {
|
||||
if (r) {
|
||||
self.do_notify(_.str.sprintf(_t("'%s' added to dashboard"), name), '');
|
||||
data_manager.invalidate();
|
||||
} else {
|
||||
self.do_warn(_t("Could not add filter to dashboard"));
|
||||
}
|
||||
|
||||
@@ -307,6 +307,7 @@ class MrpProduction(models.Model):
|
||||
'production_id': self.id,
|
||||
'origin': self.name,
|
||||
'group_id': self.procurement_group_id.id,
|
||||
'propagate': self.propagate,
|
||||
})
|
||||
move.action_confirm()
|
||||
return move
|
||||
|
||||
@@ -29,7 +29,7 @@ class MrpProductProduce(models.TransientModel):
|
||||
lines = []
|
||||
existing_lines = []
|
||||
for move in production.move_raw_ids.filtered(lambda x: (x.product_id.tracking != 'none') and x.state not in ('done', 'cancel')):
|
||||
if not move.move_lot_ids:
|
||||
if not move.move_lot_ids.filtered(lambda x: not x.lot_produced_id):
|
||||
qty = quantity / move.bom_line_id.bom_id.product_qty * move.bom_line_id.product_qty
|
||||
if move.product_id.tracking == 'serial':
|
||||
while float_compare(qty, 0.0, precision_rounding=move.product_uom.rounding) > 0:
|
||||
|
||||
@@ -289,12 +289,11 @@ class ProcurementOrder(models.Model):
|
||||
This is appropriate for batch jobs only.
|
||||
@return: Dictionary of values
|
||||
'''
|
||||
ProcurementSudo = self.env['procurement.order'].sudo()
|
||||
try:
|
||||
if use_new_cursor:
|
||||
cr = registry(self._cr.dbname).cursor()
|
||||
self = self.with_env(self.env(cr=cr)) # TDE FIXME
|
||||
|
||||
ProcurementSudo = self.env['procurement.order'].sudo()
|
||||
# Run confirmed procurements
|
||||
procurements = ProcurementSudo.search([('state', '=', 'confirmed')] + (company_id and [('company_id', '=', company_id)] or []))
|
||||
while procurements:
|
||||
|
||||
@@ -68,10 +68,7 @@ class AccountInvoice(models.Model):
|
||||
self.partner_id = self.purchase_id.partner_id.id
|
||||
|
||||
new_lines = self.env['account.invoice.line']
|
||||
for line in self.purchase_id.order_line:
|
||||
# Load a PO line only once
|
||||
if line in self.invoice_line_ids.mapped('purchase_line_id'):
|
||||
continue
|
||||
for line in self.purchase_id.order_line - self.invoice_line_ids.mapped('purchase_line_id'):
|
||||
data = self._prepare_invoice_line_from_po_line(line)
|
||||
new_line = new_lines.new(data)
|
||||
new_line._set_additional_fields(self)
|
||||
@@ -217,5 +214,5 @@ class AccountInvoiceLine(models.Model):
|
||||
_inherit = 'account.invoice.line'
|
||||
|
||||
purchase_line_id = fields.Many2one('purchase.order.line', 'Purchase Order Line', ondelete='set null', index=True, readonly=True)
|
||||
purchase_id = fields.Many2one('purchase.order', related='purchase_line_id.order_id', string='Purchase Order', store=False, readonly=True,
|
||||
purchase_id = fields.Many2one('purchase.order', related='purchase_line_id.order_id', string='Purchase Order', store=False, readonly=True, related_sudo=False,
|
||||
help='Associated Purchase Order. Filled in automatically when a PO is chosen on the vendor bill.')
|
||||
|
||||
@@ -40,6 +40,8 @@ var KanbanRecord = Widget.extend({
|
||||
this.sub_widgets = [];
|
||||
|
||||
this.init_content(record);
|
||||
// avoid quick multiple clicks
|
||||
this.on_kanban_action_clicked = _.debounce(this.on_kanban_action_clicked, 300, true);
|
||||
},
|
||||
|
||||
init_content: function (record) {
|
||||
|
||||
Reference in New Issue
Block a user