Merge pull request #1171 from expsa/dev_odex25_transactions

Dev odex25 transactions
This commit is contained in:
zainab2097 2024-09-15 20:58:07 +03:00 committed by GitHub
commit a7ed5dbe88
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
8 changed files with 28 additions and 6 deletions

View File

@ -50,8 +50,9 @@ class IncomingTransaction(models.Model):
attachment_rule_ids = fields.One2many('cm.attachment.rule', 'incoming_transaction_id', string='Attaches')
attachment_ids = fields.One2many('cm.attachment', 'incoming_transaction_id', string='Attachments')
trace_ids = fields.One2many('cm.transaction.trace', 'incoming_transaction_id', string='Trace Log')
is_branch = fields.Boolean(string='Is Branch?')
to_ids = fields.Many2many(comodel_name='cm.entity', relation='incoming_entity_rel', column1='incoming_id'
, column2='entity_id', string='Send To')
, column2='entity_id', string='Send To',domain=[('is_branch','=',is_branch)])
cc_ids = fields.Many2many(comodel_name='cm.entity', relation='incoming_entity_cc_rel',
column1='incoming_id', column2='entity_id', string='CC To')
tran_tag = fields.Many2many(comodel_name='transaction.tag', string='Tags')
@ -69,6 +70,7 @@ class IncomingTransaction(models.Model):
column1='transaction_id', column2='outgoing_id',
string='Process Transactions Outgoing')
attachment_count = fields.Integer(compute='count_attachments')
# attachment_file = fields.Many2many(
# comodel_name='ir.attachment',
# string='')

View File

@ -28,6 +28,7 @@ class InternalTransaction(models.Model):
project_domain = fields.Many2many('project.project', string='Project Domain')
processing_ids = fields.Many2many(comodel_name='internal.transaction', relation='transaction_internal_rel',
column1='transaction_id', column2='internal_id', string='Process Transactions')
is_branch = fields.Boolean(string='Is Branch?')
def _normalize_arabic_text(self, text):
translation_map = str.maketrans({
# Define a dictionary to replace different forms of characters

View File

@ -15,8 +15,9 @@ class OutgoingTransaction(models.Model):
is_partner = fields.Boolean()
partner_id = fields.Many2one('res.partner')
incoming_transaction_id = fields.Many2one('incoming.transaction', string='Related Incoming')
is_branch = fields.Boolean(string='Is Branch?')
to_ids = fields.Many2many(comodel_name='cm.entity', relation='outgoing_entity_rel', column1='outgoing_id'
, column2='entity_id', string='Send To')
, column2='entity_id', string='Send To',domain=[('is_branch','=',is_branch)])
company_name = fields.Many2one('res.partner',string='Delivery Company')
tran_tag = fields.Many2many(comodel_name='transaction.tag', string='Tags')

View File

@ -53,6 +53,7 @@ class Transaction(models.Model):
string='')
current_is_manager = fields.Boolean(string='Is Manager', compute="set_is_manager")
current_is_forward_user = fields.Boolean(string='Is Manager', compute="set_is_forward_user")
is_branch = fields.Boolean(string='Is Branch?')
current_user = fields.Boolean("current user", compute='_default_current_user')
reason = fields.Text(string="Reject Reason")
forward_user_id = fields.Many2one(comodel_name='res.users', string='Forward User')

View File

@ -22,9 +22,13 @@
<filter string="State" name="state" domain="[('state', 'in', ('complete','draft'))]"/>
<filter string="Unread Transaction" name="unread" domain="[('is_reade','=',False)]"/>
<filter string="Favorite" name="favorite" domain="[('is_favorite','=','1')]"/>
<filter name="Is Branch" string="Is Branch" domain="[('is_branch','=',True)]"/>
<filter name="NOT Branch" string="NOT Branch" domain="[('is_branch','=',False)]"/>
<group expand="1" string="Group By">
<filter string="State" name="group_by_state" context="{'group_by':'state'}"/>
<filter string="Subject Type" name="group_by_subject_type" context="{'group_by':'subject_type_id'}"/>
<filter string="Is Branch" name="group_by_is_branch" domain="[('is_branch', '=', True)]" context="{'group_by':'is_branch'}"/>
<filter string="Not Branch" name="group_by_noy_is_branch" domain="[('is_branch', '=', False)]" context="{'group_by':'is_branch'}"/>
</group>
<!-- <group expand="0" string="Group By">-->
<!-- <filter name="group_manager" string="Manager" domain="[]" context="{'group_by':'parent_id'}"/>-->

View File

@ -17,9 +17,13 @@
<filter string="Favorite" name="favorite" domain="[('is_favorite','=','1')]"/>
<filter string="Subject Type" name="subject_type" domain="[('subject_type_id','=',False)]"/>
<filter string="State" name="state" domain="[('state', 'in', ('complete','draft'))]"/>
<filter name="Is Branch" string="Is Branch" domain="[('is_branch','=',True)]"/>
<filter name="NOT Branch" string="NOT Branch" domain="[('is_branch','=',False)]"/>
<group expand="1" string="Group By">
<filter string="State" name="group_by_state" context="{'group_by':'state'}"/>
<filter string="Subject Type" name="group_by_subject_type" context="{'group_by':'subject_type_id'}"/>
<filter string="Is Branch" name="group_by_is_branch" domain="[('is_branch', '=', True)]" context="{'group_by':'is_branch'}"/>
<filter string="Not Branch" name="group_by_noy_is_branch" domain="[('is_branch', '=', False)]" context="{'group_by':'is_branch'}"/>
</group>
@ -174,7 +178,7 @@
</header>
</xpath>
<xpath expr="//field[@name='to_ids']" position="attributes">
<attribute name="domain">[('type', '=', type_sender)]</attribute>
<attribute name="domain">[('is_branch', '=', is_branch),('type', '=', type_sender)]</attribute>
</xpath>
<xpath expr="//field[@name='to_ids']" position="after">
<field name="partner_id"/>

View File

@ -13,12 +13,16 @@
<field name="name" string="Transaction" filter_domain="[('name','ilike',self)]"/>
<field name="tran_tag" string="tag" filter_domain="[('tran_tag','ilike',self)]"/>
<field name="is_reade"/>
<filter name="Is Branch" string="Is Branch" domain="[('is_branch','=',True)]"/>
<filter name="NOT Branch" string="NOT Branch" domain="[('is_branch','=',False)]"/>
<field name="is_favorite"/>
<filter string="Subject Type" name="subject_type" domain="[('subject_type_id','=',False)]"/>
<filter string="State" name="state" domain="[('state', 'in',('complete','draft'))]"/>
<filter string="Unread Transaction" name="unread" domain="[('is_reade','=',False)]"/>
<filter string="Favorite" name="favorite" domain="[('is_favorite','=','1')]"/>
<group expand="1" string="Group By">
<filter string="Is Branch" name="group_by_is_branch" domain="[('is_branch', '=', True)]" context="{'group_by':'is_branch'}"/>
<filter string="Not Branch" name="group_by_noy_is_branch" domain="[('is_branch', '=', False)]" context="{'group_by':'is_branch'}"/>
<filter string="State" name="group_by_state" context="{'group_by':'state'}"/>
<filter string="Subject Type" name="group_by_subject_type" context="{'group_by':'subject_type_id'}"/>
</group>

View File

@ -71,11 +71,13 @@
<field name="inherit_id" ref="exp_transaction_documents.common_transactions_form"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='subject']" position="after">
<field name="is_branch"/>
<field name="to_ids" widget="many2many_tags"
attrs="{'required':True,'readonly':[('state','not in', ['draft'])]}"
domain="[('type', 'in', ['unit','employee'])]" options="{'no_create':True,'no_open':True}"/>
domain="[('type', 'in', ['unit','employee']),('is_branch','=',is_branch)]" options="{'no_create':True,'no_open':True}"/>
<field name="tran_tag" widget="many2many_tags"
options="{'no_create':True}"/>
</xpath>
<xpath expr="//field[@name='important_id']" position="after">
<field name="project_domain" widget="many2many_tags"
@ -183,7 +185,8 @@
<field name="partner_id"/>
</xpath>
<xpath expr="//field[@name='subject']" position="after">
<field name="to_ids" widget="many2many_tags" domain="[('type', 'in', ['employee','unit'])]"
<field name="is_branch"/>
<field name="to_ids" widget="many2many_tags" domain="[('is_branch','=',is_branch),('type', 'in', ['employee','unit'])]"
options="{'no_create':True,'no_open':True}"/>
</xpath>
<xpath expr="//field[@name='transaction_date_hijri']" position="after">
@ -292,10 +295,12 @@
<attribute name="invisible">1</attribute>
</xpath>
<xpath expr="//field[@name='subject']" position="after">
<field name="is_branch"/>
<field name="to_ids" widget="many2many_tags" options="{'no_create':True,'no_open':True}"
attrs="{'required':True,'readonly':[('state','not in', ['draft'])]}"
domain="[('type', '=', 'external')]"/>
domain="[('is_branch','=',is_branch),('type', '=', 'external')]"/>
<field name="to_name"/>
</xpath>
<xpath expr="//field[@name='transaction_date_hijri']" position="after">
<field name="cc_ids" widget="many2many_tags" domain="[('type', 'in', ['employee', 'unit'])]"