mirror of
https://github.com/OCA/account-financial-tools.git
synced 2025-02-02 12:47:26 +02:00
[BKP] account_move_post_date_user
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
{
|
||||
"name": "Account Move Post Date User",
|
||||
"summary": "Trace journal entry posting date and user.",
|
||||
"version": "13.0.1.0.0",
|
||||
"version": "12.0.1.0.0",
|
||||
"category": "Accounting",
|
||||
"website": "https://github.com/OCA/account-financial-tools",
|
||||
"author": "ForgeFlow S.L., Odoo Community Association (OCA)",
|
||||
|
||||
@@ -14,8 +14,8 @@ class AccountMove(models.Model):
|
||||
"res.users", string="Last Posted by", readonly=True, tracking=True
|
||||
)
|
||||
|
||||
def post(self):
|
||||
res = super().post()
|
||||
def post(self, invoice=False):
|
||||
res = super().post(invoice=invoice)
|
||||
self.write(
|
||||
{
|
||||
"last_post_date": fields.Datetime.now(),
|
||||
|
||||
@@ -3,19 +3,38 @@
|
||||
|
||||
from odoo import fields
|
||||
from odoo.tests import tagged
|
||||
|
||||
from odoo.addons.account.tests.account_test_savepoint import AccountTestInvoicingCommon
|
||||
from odoo.addons.account.tests.account_test_classes import AccountingTestCase
|
||||
|
||||
|
||||
@tagged("post_install", "-at_install")
|
||||
class TestAccountMovePostDateUser(AccountTestInvoicingCommon):
|
||||
class TestAccountMovePostDateUser(AccountingTestCase):
|
||||
def setUp(self):
|
||||
super(TestAccountMovePostDateUser, self).setUp()
|
||||
self.account_move_obj = self.env["account.move"]
|
||||
self.partner = self.browse_ref("base.res_partner_12")
|
||||
self.account = self.company_data["default_account_revenue"]
|
||||
self.account2 = self.company_data["default_account_expense"]
|
||||
self.journal = self.company_data["default_journal_bank"]
|
||||
self.user_type_revenue = self.env.ref('account.data_account_type_revenue')
|
||||
self.account = self.env['account.account'].create({
|
||||
'code': 'NC1114',
|
||||
'name': 'Revenue Account',
|
||||
'user_type_id': self.user_type_revenue.id,
|
||||
'reconcile': True
|
||||
})
|
||||
self.account2 = self.account_expense = self.env['account.account'].search([
|
||||
('user_type_id', '=', self.env.ref(
|
||||
'account.data_account_type_expenses').id)
|
||||
], limit=1)
|
||||
self.bank = self.env['res.partner.bank'].create({
|
||||
'acc_number': '123456',
|
||||
'partner_id': self.env.ref('base.main_partner').id,
|
||||
'company_id': self.env.ref('base.main_company').id,
|
||||
'bank_id': self.env.ref('base.res_bank_1').id,
|
||||
})
|
||||
self.journal = self.env['account.journal'].create({
|
||||
'name': 'Bank Journal TEST OFX',
|
||||
'code': 'BNK12',
|
||||
'type': 'bank',
|
||||
'bank_account_id': self.bank.id,
|
||||
})
|
||||
|
||||
# create a move and post it
|
||||
self.move = self.account_move_obj.create(
|
||||
|
||||
@@ -5,11 +5,7 @@
|
||||
<field name="model">account.move</field>
|
||||
<field name="inherit_id" ref="account.view_move_form" />
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//group[@name='accounting_info_group']" position="inside">
|
||||
<field name="last_post_date" />
|
||||
<field name="last_post_uid" />
|
||||
</xpath>
|
||||
<xpath expr="//group[@name='misc_group']" position="inside">
|
||||
<xpath expr="//field[@name='reverse_entry_id']" position="after">
|
||||
<field name="last_post_date" />
|
||||
<field name="last_post_uid" />
|
||||
</xpath>
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
../../../../account_move_post_date_user
|
||||
6
setup/account_move_post_date_user/setup.py
Normal file
6
setup/account_move_post_date_user/setup.py
Normal file
@@ -0,0 +1,6 @@
|
||||
import setuptools
|
||||
|
||||
setuptools.setup(
|
||||
setup_requires=['setuptools-odoo'],
|
||||
odoo_addon=True,
|
||||
)
|
||||
Reference in New Issue
Block a user