[PATCH] Upstream patch - 30112021

This commit is contained in:
Parthiv Patel committed 2021-11-30 10:49:32 +00:00
1 parent 41933db083
commit b89d2d201b
11 files changed
+38 -19

No files matched your search

+3 -4
View File
@@ -12,7 +12,9 @@
<field name="inherit_id" ref="base.view_users_form_simple_modif"/>
<field name="mode">primary</field>
<field name="arch" type="xml">
<footer position="replace"/>
<footer position="attributes">
<attribute name="invisible">1</attribute>
</footer>
<h1 position="replace"/>
<xpath expr="//field[@name='image_1920']" position="replace"/>
<xpath expr="//field[@name='company_id']" position="attributes">
@@ -41,9 +43,6 @@
<attribute name="create">false</attribute>
<attribute name="js_class">hr_employee_profile_form</attribute>
</form>
<footer position="attributes">
<attribute name="invisible">1</attribute>
</footer>
<notebook position="replace">
<field name="hr_presence_state" invisible="1"/>
<header>
+1
View File
@@ -5,6 +5,7 @@
'summary': "PCGE Simplified",
'category': 'Accounting/Localizations/Account Charts',
'author': 'Vauxoo, Flectra',
'website': 'https://doc.flectrahq.com/2.0/accounting/fiscal_localizations/localizations/peru.html',
'license': 'LGPL-3',
'depends': [
'base_vat',
+10 -5
View File
@@ -229,12 +229,17 @@ class MassMailing(models.Model):
@api.depends('mailing_model_id')
def _compute_model(self):
for record in self:
record.mailing_model_real = (record.mailing_model_name != 'mailing.list') and record.mailing_model_name or 'mailing.contact'
record.mailing_model_real = (record.mailing_model_id.model != 'mailing.list') and record.mailing_model_id.model or 'mailing.contact'
@api.depends('mailing_model_real')
@api.depends('mailing_model_id')
def _compute_reply_to_mode(self):
""" For main models not really using chatter to gather answers (contacts
and mailing contacts), set reply-to as email-based. Otherwise answers
by default go on the original discussion thread (business document). Note
that mailing_model being mailing.list means contacting mailing.contact
(see mailing_model_name versus mailing_model_real). """
for mailing in self:
if mailing.mailing_model_real in ['res.partner', 'mailing.contact']:
if mailing.mailing_model_id.model in ['res.partner', 'mailing.list']:
mailing.reply_to_mode = 'email'
else:
mailing.reply_to_mode = 'thread'
@@ -247,10 +252,10 @@ class MassMailing(models.Model):
elif mailing.reply_to_mode == 'thread':
mailing.reply_to = False
@api.depends('mailing_model_name', 'contact_list_ids')
@api.depends('mailing_model_id', 'contact_list_ids', 'mailing_type')
def _compute_mailing_domain(self):
for mailing in self:
if not mailing.mailing_model_name:
if not mailing.mailing_model_id:
mailing.mailing_domain = ''
else:
mailing.mailing_domain = repr(mailing._get_default_mailing_domain())
@@ -190,6 +190,14 @@ class PosSession(models.Model):
raise UserError(_("Some Cash Registers are already posted. Please reset them to new in order to close the session.\n"
"Cash Registers: %r", list(statement.name for statement in closed_statement_ids)))
def _check_invoices_are_posted(self):
unposted_invoices = self.order_ids.account_move.filtered(lambda x: x.state != 'posted')
if unposted_invoices:
raise UserError(_('You cannot close the POS when invoices are not posted.\n'
'Invoices: %s') % str.join('\n',
['%s - %s' % (invoice.name, invoice.state) for invoice in
unposted_invoices]))
@api.model
def create(self, values):
config_id = values.get('config_id') or self.env.context.get('default_config_id')
@@ -318,6 +326,7 @@ class PosSession(models.Model):
if self.state == 'closed':
raise UserError(_('This session is already closed.'))
self._check_if_no_draft_orders()
self._check_invoices_are_posted()
if self.update_stock_at_closing:
self._create_picking_at_end_of_session()
# Users without any accounting rights won't be able to create the journal entry. If this
+1 -1
View File
@@ -36,7 +36,7 @@ class ResConfigSettings(models.TransientModel):
], string='Customer Account', default='b2b', config_parameter='auth_signup.invitation_scope')
module_delivery = fields.Boolean("Delivery Methods")
module_delivery_dhl = fields.Boolean("DHL USA Connector")
module_delivery_dhl = fields.Boolean("DHL Express Connector")
module_delivery_fedex = fields.Boolean("FedEx Connector")
module_delivery_ups = fields.Boolean("UPS Connector")
module_delivery_usps = fields.Boolean("USPS Connector")
@@ -128,7 +128,9 @@ class SaleAdvancePaymentInv(models.TransientModel):
if order.fiscal_position_id:
invoice_vals['fiscal_position_id'] = order.fiscal_position_id.id
invoice = self.env['account.move'].sudo().create(invoice_vals).with_user(self.env.uid)
invoice = self.env['account.move'].with_company(order.company_id)\
.sudo().create(invoice_vals).with_user(self.env.uid)
invoice.message_post_with_view('mail.message_origin_link',
values={'self': invoice, 'origin': order},
subtype_id=self.env.ref('mail.mt_note').id)
+1 -1
View File
@@ -34,7 +34,7 @@ class ResConfigSettings(models.TransientModel):
stock_mail_confirmation_template_id = fields.Many2one(related='company_id.stock_mail_confirmation_template_id', readonly=False)
module_stock_sms = fields.Boolean("SMS Confirmation")
module_delivery = fields.Boolean("Delivery Methods")
module_delivery_dhl = fields.Boolean("DHL USA Connector")
module_delivery_dhl = fields.Boolean("DHL Express Connector")
module_delivery_fedex = fields.Boolean("FedEx Connector")
module_delivery_ups = fields.Boolean("UPS Connector")
module_delivery_usps = fields.Boolean("USPS Connector")
+6 -5
View File
@@ -489,16 +489,17 @@ class Picking(models.Model):
})
picking_move_lines[picking_id.id].add(move.id)
for picking in self:
if not picking_moves_state_map[picking.id]:
picking_id = (picking.ids and picking.ids[0]) or picking.id
if not picking_moves_state_map[picking_id]:
picking.state = 'draft'
elif picking_moves_state_map[picking.id]['any_draft']:
elif picking_moves_state_map[picking_id]['any_draft']:
picking.state = 'draft'
elif picking_moves_state_map[picking.id]['all_cancel']:
elif picking_moves_state_map[picking_id]['all_cancel']:
picking.state = 'cancel'
elif picking_moves_state_map[picking.id]['all_cancel_done']:
elif picking_moves_state_map[picking_id]['all_cancel_done']:
picking.state = 'done'
else:
relevant_move_state = self.env['stock.move'].browse(picking_move_lines[picking.id])._get_relevant_state_among_moves()
relevant_move_state = self.env['stock.move'].browse(picking_move_lines[picking_id])._get_relevant_state_among_moves()
if picking.immediate_transfer and relevant_move_state not in ('draft', 'cancel', 'done'):
picking.state = 'assigned'
elif relevant_move_state == 'partially_available':
@@ -96,6 +96,8 @@
<field name="model">stock.move.line</field>
<field name="arch" type="xml">
<kanban class="o_kanban_mobile">
<field name="location_id" invisible="1"/>
<field name="location_dest_id" invisible="1"/>
<templates>
<t t-name="kanban-box">
<div t-attf-class="oe_kanban_card oe_kanban_global_click">
@@ -177,7 +177,7 @@ const FontFamilyPickerUserValueWidget = SelectUserValueWidget.extend({
let isValidFamily = false;
try {
const result = await fetch("https://fonts.googleapis.com/css?family=" + m[1], {method: 'HEAD'});
const result = await fetch("https://fonts.googleapis.com/css?family=" + m[1]+':300,300i,400,400i,700,700i', {method: 'HEAD'});
// Google fonts server returns a 400 status code if family is not valid.
if (result.ok) {
isValidFamily = true;
@@ -201,7 +201,7 @@
<field name="module_delivery_dhl" widget="upgrade_boolean"/>
</div>
<div class="o_setting_right_pane">
<label string="DHL" for="module_delivery_dhl"/>
<label string="DHL Express Connector" for="module_delivery_dhl"/>
<div class="text-muted" id="website_delivery_dhl">
Compute shipping costs and ship with DHL
</div>