Skip to content

Commit

Permalink
Merge pull request #13 from ursais/10.0
Browse files Browse the repository at this point in the history
[ADD] l10n_us_form_1099
  • Loading branch information
Maxime Chambreuil committed Jun 26, 2017
2 parents e0b72d9 + 82aebc3 commit c600760
Show file tree
Hide file tree
Showing 8 changed files with 218 additions and 0 deletions.
63 changes: 63 additions & 0 deletions l10n_us_form_1099/README.rst
@@ -0,0 +1,63 @@
.. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3

============
US Form 1099
============

This module extends the functionality of res partner to support indicating 1099s.

Usage
=====

To use this module, you need to:

#. Go to a partner and check the "Is a 1099?" box

.. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas
:alt: Try me on Runbot
:target: https://runbot.odoo-community.org/runbot/203/10.0

Bug Tracker
===========

Bugs are tracked on `GitHub Issues
<https://github.com/OCA/l10n-usa/issues>`_. In case of trouble, please
check there if your issue has already been reported. If you spotted it first,
help us smash it by providing detailed and welcomed feedback.

Credits
=======

Images
------

* Odoo Community Association: `Icon <https://github.com/OCA/maintainer-tools/blob/master/template/module/static/description/icon.svg>`_.

Contributors
------------

* Jenny Wu <jwu@ursainfosystems.com>

Funders
-------

The development of this module has been financially supported by:

* Ursa Information Systems <http://www.ursainfosystems.com>

Maintainer
----------

.. image:: https://odoo-community.org/logo.png
:alt: Odoo Community Association
:target: https://odoo-community.org

This module is maintained by the OCA.

OCA, or the Odoo Community Association, is a nonprofit organization whose
mission is to support the collaborative development of Odoo features and
promote its widespread use.

To contribute to this module, please visit https://odoo-community.org.
5 changes: 5 additions & 0 deletions l10n_us_form_1099/__init__.py
@@ -0,0 +1,5 @@
# -*- coding: utf-8 -*-
# Copyright 2017 Ursa Information Systems <http://www.ursainfosystems.com>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

from . import models
21 changes: 21 additions & 0 deletions l10n_us_form_1099/__manifest__.py
@@ -0,0 +1,21 @@
# -*- coding: utf-8 -*-
# Copyright 2017 Ursa Information Systems <http://www.ursainfosystems.com>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

{
"name": "l10n_us_form_1099",
"version": "10.0.1.0.0",
"author": "Ursa Information Systems, Odoo Community Association (OCA)",
"license": "AGPL-3",
"summary": "Add 1099 field to res.partner that will auto-check supplier",
"category": "Customers",
"maintainer": "Ursa Information Systems",
"website": "http://www.ursainfosystems.com",
"depends": ["base"],
"data": [
"views/res_partner.xml",
],
"qweb": [
],
"installable": True,
}
5 changes: 5 additions & 0 deletions l10n_us_form_1099/models/__init__.py
@@ -0,0 +1,5 @@
# -*- coding: utf-8 -*-
# Copyright 2017 Ursa Information Systems <http://www.ursainfosystems.com>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

from . import res_partner
28 changes: 28 additions & 0 deletions l10n_us_form_1099/models/res_partner.py
@@ -0,0 +1,28 @@
# -*- coding: utf-8 -*-
# Copyright 2017 Ursa Information Systems <http://www.ursainfosystems.com>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

from odoo import api, fields, models


class ResPartner(models.Model):
_inherit = "res.partner"

is1099 = fields.Boolean('Is a 1099')
supplier = fields.Boolean(string='Is a Vendor',
help="Check this box if\
contact is a vendor."
"If not checked, purchase people will\
not see it when encoding purchase order.")

@api.onchange('is1099')
def _on_change_is1099(self):

if self.is1099 and not self.supplier:
self.supplier = True

@api.onchange('supplier')
def _on_change_supplier(self):

if self.is1099 and not self.supplier:
self.is1099 = False
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
79 changes: 79 additions & 0 deletions l10n_us_form_1099/static/description/l10n_us_form_1099.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
17 changes: 17 additions & 0 deletions l10n_us_form_1099/views/res_partner.xml
@@ -0,0 +1,17 @@
<?xml version="1.0"?>
<odoo>

<record id="res_partner_view_form" model="ir.ui.view">
<field name="name">res_partner_view_form</field>
<field name="model">res.partner</field>
<field name="inherit_id" ref="base.view_partner_form"/>
<field name="arch" type="xml">
<data>
<xpath expr="/form/sheet/notebook/page[@name='sales_purchases']/group/group[2]/field[@name='supplier']" position="after">
<field name="is1099"/>
</xpath>
</data>
</field>
</record>

</odoo>

0 comments on commit c600760

Please sign in to comment.