Compare commits
2 Commits
18.0
...
invoice-up
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
14d0b31f91 | ||
|
|
b18487adcd |
@@ -14,6 +14,7 @@ class AccountMoveUpdate(models.TransientModel):
|
|||||||
invoice_id = fields.Many2one(
|
invoice_id = fields.Many2one(
|
||||||
'account.move', string='Invoice', required=True,
|
'account.move', string='Invoice', required=True,
|
||||||
readonly=True)
|
readonly=True)
|
||||||
|
bank_partner_id = fields.Many2one(related="invoice_id.bank_partner_id")
|
||||||
move_type = fields.Selection(related='invoice_id.move_type')
|
move_type = fields.Selection(related='invoice_id.move_type')
|
||||||
company_id = fields.Many2one(related='invoice_id.company_id')
|
company_id = fields.Many2one(related='invoice_id.company_id')
|
||||||
partner_id = fields.Many2one(related='invoice_id.partner_id')
|
partner_id = fields.Many2one(related='invoice_id.partner_id')
|
||||||
@@ -56,17 +57,6 @@ class AccountMoveUpdate(models.TransientModel):
|
|||||||
}])
|
}])
|
||||||
return res
|
return res
|
||||||
|
|
||||||
@api.onchange('move_type')
|
|
||||||
def move_type_on_change(self):
|
|
||||||
res = {'domain': {}}
|
|
||||||
if self.move_type in ('out_invoice', 'out_refund'):
|
|
||||||
res['domain']['partner_bank_id'] =\
|
|
||||||
"[('partner_id.ref_company_ids', 'in', [company_id])]"
|
|
||||||
else:
|
|
||||||
res['domain']['partner_bank_id'] =\
|
|
||||||
"[('partner_id', '=', partner_id)]"
|
|
||||||
return res
|
|
||||||
|
|
||||||
def _prepare_invoice(self):
|
def _prepare_invoice(self):
|
||||||
vals = {}
|
vals = {}
|
||||||
inv = self.invoice_id
|
inv = self.invoice_id
|
||||||
@@ -217,3 +207,5 @@ class AccountMoveLineUpdate(models.TransientModel):
|
|||||||
"Percentage Analytic"
|
"Percentage Analytic"
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
|
# needed because of analytic widget in view
|
||||||
|
company_id = fields.Many2one(related='invoice_line_id.company_id')
|
||||||
|
|||||||
@@ -22,7 +22,7 @@
|
|||||||
<field name="invoice_origin" invisible="move_type == 'entry'"/>
|
<field name="invoice_origin" invisible="move_type == 'entry'"/>
|
||||||
<!-- update of payment term is broken -->
|
<!-- update of payment term is broken -->
|
||||||
<!-- <field name="invoice_payment_term_id" widget="selection"/>-->
|
<!-- <field name="invoice_payment_term_id" widget="selection"/>-->
|
||||||
<field name="partner_bank_id" invisible="move_type == 'entry'"/>
|
<field name="partner_bank_id" invisible="move_type == 'entry'" domain="[('partner_id', '=', bank_partner_id)]"/>
|
||||||
<field name="invoice_user_id" options="{'no_open': True, 'no_create': True, 'no_create_edit': True}" invisible="move_type == 'entry'"/>
|
<field name="invoice_user_id" options="{'no_open': True, 'no_create': True, 'no_create_edit': True}" invisible="move_type == 'entry'"/>
|
||||||
</group>
|
</group>
|
||||||
<group name="lines">
|
<group name="lines">
|
||||||
|
|||||||
@@ -17,5 +17,8 @@ With this module, when Odoo sends an outgoing email, it adds the sender as Bcc (
|
|||||||
'author': 'Akretion',
|
'author': 'Akretion',
|
||||||
'website': 'https://github.com/akretion/odoo-usability',
|
'website': 'https://github.com/akretion/odoo-usability',
|
||||||
'depends': ['base'],
|
'depends': ['base'],
|
||||||
'installable': True,
|
# I set it to False, because this module doesn't work because of send_validated_to in context
|
||||||
|
# cf method _prepare_email_message()
|
||||||
|
# We should now use the module mail_composer_cc_bcc from OCA/social (moved to OCA/mail)
|
||||||
|
'installable': False,
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
# @author: Alexis de Lattre <alexis.delattre@akretion.com>
|
# @author: Alexis de Lattre <alexis.delattre@akretion.com>
|
||||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||||
|
|
||||||
from odoo import models, tools
|
from odoo import models
|
||||||
|
|
||||||
|
|
||||||
class IrMailServer(models.Model):
|
class IrMailServer(models.Model):
|
||||||
@@ -25,13 +25,3 @@ class IrMailServer(models.Model):
|
|||||||
message_id=message_id, references=references, object_id=object_id,
|
message_id=message_id, references=references, object_id=object_id,
|
||||||
subtype=subtype, headers=headers,
|
subtype=subtype, headers=headers,
|
||||||
body_alternative=body_alternative, subtype_alternative=subtype_alternative)
|
body_alternative=body_alternative, subtype_alternative=subtype_alternative)
|
||||||
|
|
||||||
def _prepare_email_message(self, message, smtp_session):
|
|
||||||
validated_to = self.env.context.get('send_validated_to') or []
|
|
||||||
if message['Bcc']:
|
|
||||||
email_bcc_normalized = tools.email_normalize_all(message['Bcc'])
|
|
||||||
for email in email_bcc_normalized:
|
|
||||||
if email not in validated_to:
|
|
||||||
validated_to.append(email)
|
|
||||||
return super(IrMailServer, self.with_context(send_validated_to=validated_to))._prepare_email_message(
|
|
||||||
message, smtp_session)
|
|
||||||
|
|||||||
@@ -1,11 +1,10 @@
|
|||||||
[project]
|
[project]
|
||||||
name = "odoo-addons-akretion-odoo-usability"
|
name = "odoo-addons-akretion-odoo-usability"
|
||||||
version = "18.0.20251212.0"
|
version = "18.0.20251201.0"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"odoo-addon-account_invoice_update_wizard==18.0.*",
|
"odoo-addon-account_invoice_update_wizard==18.0.*",
|
||||||
"odoo-addon-account_usability_akretion==18.0.*",
|
"odoo-addon-account_usability_akretion==18.0.*",
|
||||||
"odoo-addon-base_company_extension==18.0.*",
|
"odoo-addon-base_company_extension==18.0.*",
|
||||||
"odoo-addon-base_mail_sender_bcc==18.0.*",
|
|
||||||
"odoo-addon-base_partner_ref==18.0.*",
|
"odoo-addon-base_partner_ref==18.0.*",
|
||||||
"odoo-addon-base_profile_akretion==18.0.*",
|
"odoo-addon-base_profile_akretion==18.0.*",
|
||||||
"odoo-addon-base_usability_akretion==18.0.*",
|
"odoo-addon-base_usability_akretion==18.0.*",
|
||||||
|
|||||||
Reference in New Issue
Block a user