Vincent Van Rossem
4 years ago
9 changed files with 86 additions and 10 deletions
-
1beesdoo_purchase/README.rst
-
14beesdoo_purchase/__manifest__.py
-
2beesdoo_purchase/models/__init__.py
-
14beesdoo_purchase/models/account_invoice.py
-
14beesdoo_purchase/models/res_config.py
-
1beesdoo_purchase/readme/DESCRIPTION.rst
-
9beesdoo_purchase/security/invoice_security.xml
-
18beesdoo_purchase/static/description/index.html
-
23beesdoo_purchase/views/res_config_settings_view.xml
@ -1,15 +1,21 @@ |
|||
{ |
|||
"name": "Bees Purchase", |
|||
"summary": """ |
|||
- Adds a 'Responsible' field to purchase orders, |
|||
- Adds a 'Responsible' field to purchase orders |
|||
- A filter w.r.t. the mail sellers is placed on the products field of a |
|||
purchase order. |
|||
purchase order |
|||
- Allow inverting the Purchase Order Reference on the invoice lines |
|||
""", |
|||
"author": "Beescoop - Cellule IT, " "Coop IT Easy SCRLfs", |
|||
"website": "https://github.com/beescoop/Obeesdoo", |
|||
"category": "Purchase", |
|||
"version": "12.0.1.1.0", |
|||
"version": "12.0.1.2.0", |
|||
"depends": ["base", "purchase", "beesdoo_product"], |
|||
"data": ["views/purchase_order.xml", "report/report_purchaseorder.xml"], |
|||
"data": [ |
|||
"security/invoice_security.xml", |
|||
"views/purchase_order.xml", |
|||
"views/res_config_settings_view.xml", |
|||
"report/report_purchaseorder.xml", |
|||
], |
|||
"license": "AGPL-3", |
|||
} |
@ -1 +1,3 @@ |
|||
from . import account_invoice |
|||
from . import purchase |
|||
from . import res_config |
@ -0,0 +1,14 @@ |
|||
from odoo import api, fields, models, _ |
|||
|
|||
|
|||
class AccountInvoice(models.Model): |
|||
_inherit = 'account.invoice' |
|||
|
|||
def _prepare_invoice_line_from_po_line(self, line): |
|||
""" Override parent's method to invert Purchase Order Reference on invoice line""" |
|||
invoice_line = super(AccountInvoice, self)._prepare_invoice_line_from_po_line(line) |
|||
if self.user_has_groups( |
|||
'beesdoo_purchase.' |
|||
'group_invert_po_ref_on_inv_line'): |
|||
invoice_line['name'] = line.name + ': ' + line.order_id.name |
|||
return invoice_line |
@ -0,0 +1,14 @@ |
|||
from odoo import fields, models |
|||
|
|||
|
|||
class ResConfigSettings(models.TransientModel): |
|||
_inherit = 'res.config.settings' |
|||
|
|||
group_invert_po_ref_on_inv_line = fields.Boolean( |
|||
"""Allow inverting the Purchase Order Reference on the |
|||
invoice lines""", |
|||
implied_group="beesdoo_purchase." |
|||
"group_invert_po_ref_on_inv_line", |
|||
help="""Allows you to invert Purchase Order Reference on the |
|||
invoice lines.""" |
|||
) |
@ -0,0 +1,9 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<odoo> |
|||
|
|||
<record id="group_invert_po_ref_on_inv_line" model="res.groups"> |
|||
<field name="name">Invert Purchase Order Reference on invoice line</field> |
|||
<field name="category_id" ref="base.module_category_hidden"/> |
|||
</record> |
|||
|
|||
</odoo> |
@ -0,0 +1,23 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
|
|||
<odoo> |
|||
<record id="res_config_settings_view_form" model="ir.ui.view"> |
|||
<field name="name">res invoice line description settings</field> |
|||
<field name="model">res.config.settings</field> |
|||
<field name="inherit_id" ref="account.res_config_settings_view_form"/> |
|||
<field name="arch" type="xml"> |
|||
<xpath |
|||
expr="//div[@id='invoicing_settings']" |
|||
position="inside"> |
|||
<div class="col-xs-12 col-md-6 o_setting_box"> |
|||
<div class="o_setting_left_pane"> |
|||
<field name="group_invert_po_ref_on_inv_line"/> |
|||
</div> |
|||
<div class="o_setting_right_pane"> |
|||
<label for="group_invert_po_ref_on_inv_line"/> |
|||
</div> |
|||
</div> |
|||
</xpath> |
|||
</field> |
|||
</record> |
|||
</odoo> |
Write
Preview
Loading…
Cancel
Save
Reference in new issue