mirror of
https://github.com/OCA/account-reconcile.git
synced 2025-01-20 12:27:39 +02:00
[IMP] account_mass_reconcile_by_purchase_line: black, isort, prettier
This commit is contained in:
@@ -5,17 +5,12 @@
|
||||
"name": "Account Mass Reconcile by Purchase Line",
|
||||
"summary": "Allows to reconcile based on the PO line",
|
||||
"version": "12.0.1.0.0",
|
||||
"author": "Eficent, "
|
||||
"Odoo Community Association (OCA)",
|
||||
"author": "Eficent, " "Odoo Community Association (OCA)",
|
||||
"website": "https://github.com/OCA/account-reconcile",
|
||||
"category": "Finance",
|
||||
"depends": ["account_mass_reconcile",
|
||||
"account_move_line_purchase_info",
|
||||
],
|
||||
"depends": ["account_mass_reconcile", "account_move_line_purchase_info",],
|
||||
"license": "AGPL-3",
|
||||
"data": [
|
||||
"views/mass_reconcile.xml",
|
||||
],
|
||||
"data": ["views/mass_reconcile.xml",],
|
||||
"installable": True,
|
||||
"auto_install": False,
|
||||
}
|
||||
|
||||
@@ -5,8 +5,8 @@ from odoo import models
|
||||
|
||||
|
||||
class MassReconcileAdvancedByPurchaseLine(models.TransientModel):
|
||||
_name = 'mass.reconcile.advanced.by.purchase.line'
|
||||
_inherit = 'mass.reconcile.advanced'
|
||||
_name = "mass.reconcile.advanced.by.purchase.line"
|
||||
_inherit = "mass.reconcile.advanced"
|
||||
|
||||
@staticmethod
|
||||
def _skip_line(move_line):
|
||||
@@ -15,15 +15,16 @@ class MassReconcileAdvancedByPurchaseLine(models.TransientModel):
|
||||
will be skipped for reconciliation. Can be inherited to
|
||||
skip on some conditions. ie: ref or partner_id is empty.
|
||||
"""
|
||||
return not (move_line.get('product_id') and
|
||||
move_line.get('purchase_line_id'))
|
||||
return not (move_line.get("product_id") and move_line.get("purchase_line_id"))
|
||||
|
||||
@staticmethod
|
||||
def _matchers(move_line):
|
||||
return (('product_id', move_line['product_id']),
|
||||
('purchase_line_id', move_line['purchase_line_id']))
|
||||
return (
|
||||
("product_id", move_line["product_id"]),
|
||||
("purchase_line_id", move_line["purchase_line_id"]),
|
||||
)
|
||||
|
||||
@staticmethod
|
||||
def _opposite_matchers(move_line):
|
||||
yield ('product_id', move_line['product_id'])
|
||||
yield ('purchase_line_id', move_line['purchase_line_id'])
|
||||
yield ("product_id", move_line["product_id"])
|
||||
yield ("purchase_line_id", move_line["purchase_line_id"])
|
||||
|
||||
@@ -5,10 +5,10 @@ from odoo import models
|
||||
|
||||
|
||||
class MassReconcileAdvanced(models.AbstractModel):
|
||||
_inherit = 'mass.reconcile.advanced'
|
||||
_inherit = "mass.reconcile.advanced"
|
||||
|
||||
def _selection_columns(self):
|
||||
aml_cols = super(MassReconcileAdvanced, self)._selection_columns()
|
||||
aml_cols.append('account_move_line.purchase_line_id')
|
||||
aml_cols.append('account_move_line.product_id')
|
||||
aml_cols.append("account_move_line.purchase_line_id")
|
||||
aml_cols.append("account_move_line.product_id")
|
||||
return aml_cols
|
||||
|
||||
@@ -5,12 +5,14 @@ from odoo import models
|
||||
|
||||
|
||||
class AccountMassReconcileMethod(models.Model):
|
||||
_inherit = 'account.mass.reconcile.method'
|
||||
_inherit = "account.mass.reconcile.method"
|
||||
|
||||
def _selection_name(self):
|
||||
methods = super(AccountMassReconcileMethod, self)._selection_name()
|
||||
methods += [
|
||||
('mass.reconcile.advanced.by.purchase.line',
|
||||
'Advanced. Product, purchase order line.'),
|
||||
(
|
||||
"mass.reconcile.advanced.by.purchase.line",
|
||||
"Advanced. Product, purchase order line.",
|
||||
),
|
||||
]
|
||||
return methods
|
||||
|
||||
@@ -1,18 +1,25 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<odoo>
|
||||
<record id="account_mass_reconcile_form" model="ir.ui.view">
|
||||
<field name="name">account.mass.reconcile.form</field>
|
||||
<field name="priority">20</field>
|
||||
<field name="model">account.mass.reconcile</field>
|
||||
<field name="inherit_id" ref="account_mass_reconcile.account_mass_reconcile_form"/>
|
||||
<field name="arch" type="xml">
|
||||
<page name="information" position="inside">
|
||||
<group colspan="2" col="2">
|
||||
<separator colspan="4" string="Advanced. Purchase Order Line"/>
|
||||
<label for="reconcile_method" string="Match multiple debit vs multiple credit entries. Allow partial reconciliation.
|
||||
The lines should have the same partner, product and PO lines to be reconciled." colspan="4"/>
|
||||
</group>
|
||||
</page>
|
||||
</field>
|
||||
</record>
|
||||
<record id="account_mass_reconcile_form" model="ir.ui.view">
|
||||
<field name="name">account.mass.reconcile.form</field>
|
||||
<field name="priority">20</field>
|
||||
<field name="model">account.mass.reconcile</field>
|
||||
<field
|
||||
name="inherit_id"
|
||||
ref="account_mass_reconcile.account_mass_reconcile_form"
|
||||
/>
|
||||
<field name="arch" type="xml">
|
||||
<page name="information" position="inside">
|
||||
<group colspan="2" col="2">
|
||||
<separator colspan="4" string="Advanced. Purchase Order Line" />
|
||||
<label
|
||||
for="reconcile_method"
|
||||
string="Match multiple debit vs multiple credit entries. Allow partial reconciliation.
|
||||
The lines should have the same partner, product and PO lines to be reconciled."
|
||||
colspan="4"
|
||||
/>
|
||||
</group>
|
||||
</page>
|
||||
</field>
|
||||
</record>
|
||||
</odoo>
|
||||
|
||||
Reference in New Issue
Block a user