Merge pull request #1625 from expsa/pla-454454-project-petty-invoice

add petty invoice base
This commit is contained in:
Mostafa Abdo 2024-10-26 21:32:55 -07:00 committed by GitHub
commit 3341bde624
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
7 changed files with 86 additions and 1 deletions

View File

@ -1,7 +1,7 @@
from odoo import api, fields, models, _
import cairo
# import cairo
import base64

View File

@ -0,0 +1,2 @@
# -*- coding: utf-8 -*-
from . import models

View File

@ -0,0 +1,14 @@
# -*- coding: utf-8 -*-
{
'name': "Project Petty Invoice",
'summary': """Project/Account""",
'category': 'Odex25-Project/Odex25-Project',
'description': """
Mark invoice as created from petty project
""",
'version': '0.1',
'depends': ['petty_invoice','project_base'],
'data': [
'views/project_invoice_view.xml',
],
}

View File

@ -0,0 +1,27 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * project_petty_invoice
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 14.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-10-27 03:55+0000\n"
"PO-Revision-Date: 2024-10-27 03:55+0000\n"
"Last-Translator: \n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: \n"
#. module: project_petty_invoice
#: model:ir.model.fields,field_description:project_petty_invoice.field_project_invoice__is_petty_paid
#: model_terms:ir.ui.view,arch_db:project_petty_invoice.view_project_invoice_filter
msgid "Paid by Petty Cash"
msgstr "منصرفه من العهد"
#. module: project_petty_invoice
#: model:ir.model,name:project_petty_invoice.model_project_invoice
msgid "Project Invoice Request"
msgstr "طلب فاتورة"

View File

@ -0,0 +1,3 @@
# -*- coding: utf-8 -*-
from . import project_invoice

View File

@ -0,0 +1,13 @@
# -*- coding: utf-8 -*-
from odoo import models, fields
class ProjectInvoice(models.Model):
_inherit = "project.invoice"
is_petty_paid = fields.Boolean(string='Paid by Petty Cash', default=False)
def create_invoice(self):
res = super(ProjectInvoice, self).create_invoice()
self.invoice_id.is_petty_paid = self.is_petty_paid
return res

View File

@ -0,0 +1,26 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<record id="project_invoice_form_view" model="ir.ui.view">
<field name="name">project.invoice.paid.petty.inherit.form</field>
<field name="model">project.invoice</field>
<field name="inherit_id" ref="project_base.project_invoice_form_view"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='plan_date']" position="after">
<field name="is_petty_paid"/>
</xpath>
</field>
</record>
<record id="view_project_invoice_filter" model="ir.ui.view">
<field name="name">project.invoice.paid.petty.inherit.search</field>
<field name="model">project.invoice</field>
<field name="inherit_id" ref="project_base.view_project_invoice_filter"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='plan_date']" position="after">
<field name="is_petty_paid"/>
<filter name="is_petty_paid" string="Paid by Petty Cash"
domain="[('is_petty_paid', '=',True)]"/>
</xpath>
</field>
</record>
</odoo>