[IMP] account: add chatter in account.journal and account.move
Task 1915154
The chatter will mainly be used for communication / messages
Add the chatter to account.move
Do not generate message at the record creation
Do not track any field
closes odoo/odoo#29274
This commit is contained in:
@@ -396,6 +396,7 @@ class AccountJournal(models.Model):
|
||||
_name = "account.journal"
|
||||
_description = "Journal"
|
||||
_order = 'sequence, type, code'
|
||||
_inherit = ['mail.thread', 'mail.activity.mixin']
|
||||
|
||||
def _default_inbound_payment_methods(self):
|
||||
return self.env.ref('account.account_payment_method_manual_in')
|
||||
@@ -778,7 +779,7 @@ class AccountJournal(models.Model):
|
||||
vals.update({'sequence_id': self.sudo()._create_sequence(vals).id})
|
||||
if vals.get('type') in ('sale', 'purchase') and vals.get('refund_sequence') and not vals.get('refund_sequence_id'):
|
||||
vals.update({'refund_sequence_id': self.sudo()._create_sequence(vals, refund=True).id})
|
||||
journal = super(AccountJournal, self).create(vals)
|
||||
journal = super(AccountJournal, self.with_context(mail_create_nolog=True)).create(vals)
|
||||
if journal.type == 'purchase':
|
||||
# create a mail alias for purchase journals (always, deactivated if alias_name isn't set)
|
||||
journal._update_mail_alias(vals)
|
||||
|
||||
@@ -20,6 +20,7 @@ class AccountMove(models.Model):
|
||||
_name = "account.move"
|
||||
_description = "Journal Entries"
|
||||
_order = 'date desc, id desc'
|
||||
_inherit = ['mail.thread', 'mail.activity.mixin']
|
||||
|
||||
@api.multi
|
||||
@api.depends('name', 'state')
|
||||
@@ -286,7 +287,7 @@ class AccountMove(models.Model):
|
||||
|
||||
@api.model
|
||||
def create(self, vals):
|
||||
move = super(AccountMove, self.with_context(check_move_validity=False, partner_id=vals.get('partner_id'))).create(vals)
|
||||
move = super(AccountMove, self.with_context(mail_create_nolog=True, check_move_validity=False, partner_id=vals.get('partner_id'))).create(vals)
|
||||
move.assert_balanced()
|
||||
return move
|
||||
|
||||
|
||||
@@ -313,6 +313,11 @@
|
||||
</page>
|
||||
</notebook>
|
||||
</sheet>
|
||||
<div class="oe_chatter">
|
||||
<field name="message_follower_ids" widget="mail_followers"/>
|
||||
<field name="activity_ids" widget="mail_activity"/>
|
||||
<field name="message_ids" widget="mail_thread"/>
|
||||
</div>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
@@ -1641,6 +1646,11 @@
|
||||
</page>
|
||||
</notebook>
|
||||
</sheet>
|
||||
<div class="oe_chatter">
|
||||
<field name="message_follower_ids" widget="mail_followers"/>
|
||||
<field name="activity_ids" widget="mail_activity"/>
|
||||
<field name="message_ids" widget="mail_thread"/>
|
||||
</div>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
Reference in New Issue
Block a user