Skip to content
Snippets Groups Projects
Commit 8b91fd81 authored by Daniil Digtyar Vasilieva's avatar Daniil Digtyar Vasilieva :call_me:
Browse files

[REF] pre-commit formating

parent b4ada330
No related branches found
No related tags found
2 merge requests!196[REF] pre-commit formating,!195[REL] 14.0.2.0.0
Pipeline #45225 passed
This commit is part of merge request !195. Comments created here will be created in the context of that merge request.
Showing
with 463 additions and 461 deletions
{
"globals": {
"$": false,
"_": false,
"fuzzy": false,
"jQuery": false,
"moment": false,
"odoo": false,
"openerp": false,
"self": false
},
"env": {
"browser": true
},
"rules": {
"no-alert": "warn",
"no-array-constructor": "warn",
"no-bitwise": "off",
"no-caller": "warn",
"no-case-declarations": "warn",
"no-catch-shadow": "warn",
"no-class-assign": "warn",
"no-cond-assign": "warn",
"no-confusing-arrow": "warn",
"no-console": "off",
"no-const-assign": "warn",
"no-constant-condition": "warn",
"no-continue": "off",
"no-control-regex": "warn",
"no-debugger": "warn",
"no-delete-var": "warn",
"no-div-regex": "warn",
"no-dupe-args": "warn",
"no-dupe-class-members": "warn",
"no-dupe-keys": "warn",
"no-duplicate-case": "warn",
"no-duplicate-imports": "warn",
"no-else-return": "warn",
"no-empty": "warn",
"no-empty-character-class": "warn",
"no-empty-function": "warn",
"no-empty-pattern": "warn",
"no-eq-null": "warn",
"no-eval": "warn",
"no-ex-assign": "warn",
"no-extend-native": "warn",
"no-extra-bind": "warn",
"no-extra-boolean-cast": "warn",
"no-extra-label": "warn",
"no-extra-parens": "warn",
"no-extra-semi": "warn",
"no-fallthrough": "warn",
"no-floating-decimal": "warn",
"no-func-assign": "warn",
"no-implicit-coercion": [
"warn",
{
"allow": ["~"]
}
],
"no-implicit-globals": "warn",
"no-implied-eval": "warn",
"no-inline-comments": "warn",
"no-inner-declarations": "warn",
"no-invalid-regexp": "warn",
"no-invalid-this": "off",
"no-irregular-whitespace": "warn",
"no-iterator": "warn",
"no-label-var": "warn",
"no-labels": "warn",
"no-lone-blocks": "warn",
"no-lonely-if": "warn",
"no-loop-func": "off",
"no-magic-numbers": "off",
"no-mixed-operators": "warn",
"no-mixed-requires": "warn",
"no-mixed-spaces-and-tabs": "warn",
"no-multi-spaces": "warn",
"no-multi-str": "warn",
"no-multiple-empty-lines": "warn",
"no-native-reassign": "warn",
"no-negated-condition": "warn",
"no-negated-in-lhs": "warn",
"no-nested-ternary": "off",
"no-new": "warn",
"no-new-func": "warn",
"no-new-object": "warn",
"no-new-require": "warn",
"no-new-symbol": "warn",
"no-new-wrappers": "warn",
"no-obj-calls": "warn",
"no-octal": "warn",
"no-octal-escape": "warn",
"no-param-reassign": "warn",
"no-path-concat": "warn",
"no-plusplus": "off",
"no-process-env": "warn",
"no-process-exit": "warn",
"no-proto": "warn",
"no-prototype-builtins": "warn",
"no-redeclare": "warn",
"no-regex-spaces": "warn",
"no-restricted-globals": "warn",
"no-restricted-imports": "warn",
"no-restricted-modules": "warn",
"no-restricted-syntax": "warn",
"no-return-assign": "warn",
"no-script-url": "warn",
"no-self-assign": "warn",
"no-self-compare": "warn",
"no-sequences": "warn",
"no-shadow": "warn",
"no-shadow-restricted-names": "warn",
"no-whitespace-before-property": "warn",
"no-spaced-func": "warn",
"no-sparse-arrays": "warn",
"no-sync": "warn",
"no-tabs": "warn",
"no-ternary": "off",
"no-trailing-spaces": "warn",
"no-this-before-super": "warn",
"no-throw-literal": "warn",
"no-undef": "warn",
"no-undef-init": "warn",
"no-undefined": "off",
"no-unexpected-multiline": "warn",
"no-underscore-dangle": "off",
"no-unmodified-loop-condition": "warn",
"no-unneeded-ternary": "warn",
"no-unreachable": "warn",
"no-unsafe-finally": "warn",
"no-unused-expressions": "warn",
"no-unused-labels": "warn",
"no-unused-vars": "warn",
"no-use-before-define": "warn",
"no-useless-call": "warn",
"no-useless-computed-key": "warn",
"no-useless-concat": "warn",
"no-useless-constructor": "warn",
"no-useless-escape": "warn",
"no-useless-rename": "warn",
"no-void": "warn",
"no-var": "off",
"no-warning-comments": "off",
"no-with": "warn",
"array-bracket-spacing": "off",
"array-callback-return": "warn",
"arrow-body-style": "warn",
"arrow-parens": "warn",
"arrow-spacing": "off",
"accessor-pairs": "warn",
"block-scoped-var": "off",
"block-spacing": ["warn", "always"],
"brace-style": "warn",
"callback-return": "warn",
"camelcase": "off",
"capitalized-comments": [
"warn",
"always",
{
"ignoreConsecutiveComments": true,
"ignoreInlineComments": true
}
],
"comma-dangle": ["warn", "always-multiline"],
"comma-spacing": [
"warn",
{
"before": false,
"after": true
}
],
"comma-style": "warn",
"complexity": ["warn", 15],
"computed-property-spacing": "off",
"consistent-return": "off",
"consistent-this": "off",
"constructor-super": "warn",
"curly": "warn",
"default-case": "off",
"dot-location": ["warn", "property"],
"dot-notation": "warn",
"eol-last": "warn",
"eqeqeq": "warn",
"func-names": "off",
"func-style": "off",
"generator-star-spacing": "off",
"global-require": "warn",
"guard-for-in": "off",
"handle-callback-err": "warn",
"id-blacklist": "warn",
"id-length": "off",
"id-match": "warn",
"indent": "warn",
"init-declarations": "warn",
"jsx-quotes": "warn",
"key-spacing": "off",
"keyword-spacing": "warn",
"linebreak-style": ["warn", "unix"],
"lines-around-comment": "warn",
"max-depth": "warn",
"max-len": [
"warn",
{
"code": 88,
"ignorePattern": "odoo\\.define\\(",
"tabWidth": 4
}
],
"max-lines": "off",
"max-nested-callbacks": "warn",
"max-params": "off",
"max-statements": "off",
"max-statements-per-line": "warn",
"multiline-ternary": "off",
"new-cap": "off",
"new-parens": "warn",
"newline-after-var": "off",
"newline-before-return": "off",
"newline-per-chained-call": "off",
"object-curly-newline": ["warn", {"consistent": true}],
"object-curly-spacing": ["warn", "never"],
"object-property-newline": [
"warn",
{
"allowAllPropertiesOnSameLine": true
}
],
"object-shorthand": "off",
"one-var": "off",
"one-var-declaration-per-line": "off",
"operator-assignment": "warn",
"operator-linebreak": "warn",
"padded-blocks": "off",
"prefer-arrow-callback": "off",
"prefer-const": "warn",
"prefer-reflect": "off",
"prefer-rest-params": "off",
"prefer-spread": "off",
"prefer-template": "off",
"quote-props": "off",
"quotes": "off",
"radix": "warn",
"require-yield": "warn",
"rest-spread-spacing": "off",
"semi": ["warn", "always"],
"semi-spacing": "warn",
"sort-imports": "warn",
"sort-vars": "off",
"space-before-blocks": "warn",
"space-before-function-paren": "warn",
"space-in-parens": "off",
"space-infix-ops": "off",
"space-unary-ops": "off",
"spaced-comment": ["warn", "always"],
"strict": ["warn", "function"],
"template-curly-spacing": "off",
"unicode-bom": "warn",
"use-isnan": "warn",
"valid-jsdoc": [
"warn",
{
"prefer": {
"arg": "param",
"argument": "param",
"augments": "extends",
"constructor": "class",
"exception": "throws",
"func": "function",
"method": "function",
"prop": "property",
"return": "returns",
"virtual": "abstract",
"yield": "yields"
},
"preferType": {
"array": "Array",
"bool": "Boolean",
"boolean": "Boolean",
"number": "Number",
"object": "Object",
"str": "String",
"string": "String"
},
"requireParamDescription": false,
"requireReturn": false,
"requireReturnDescription": false,
"requireReturnType": false
}
],
"valid-typeof": "warn",
"vars-on-top": "off",
"wrap-iife": "warn",
"wrap-regex": "warn",
"yield-star-spacing": "off",
"yoda": "warn"
},
"parserOptions": {
"ecmaVersion": 2017
}
"globals": {
"$": false,
"_": false,
"fuzzy": false,
"jQuery": false,
"moment": false,
"odoo": false,
"openerp": false,
"self": false
},
"env": {
"browser": true
},
"rules": {
"no-alert": "warn",
"no-array-constructor": "warn",
"no-bitwise": "off",
"no-caller": "warn",
"no-case-declarations": "warn",
"no-catch-shadow": "warn",
"no-class-assign": "warn",
"no-cond-assign": "warn",
"no-confusing-arrow": "warn",
"no-console": "off",
"no-const-assign": "warn",
"no-constant-condition": "warn",
"no-continue": "off",
"no-control-regex": "warn",
"no-debugger": "warn",
"no-delete-var": "warn",
"no-div-regex": "warn",
"no-dupe-args": "warn",
"no-dupe-class-members": "warn",
"no-dupe-keys": "warn",
"no-duplicate-case": "warn",
"no-duplicate-imports": "warn",
"no-else-return": "warn",
"no-empty": "warn",
"no-empty-character-class": "warn",
"no-empty-function": "warn",
"no-empty-pattern": "warn",
"no-eq-null": "warn",
"no-eval": "warn",
"no-ex-assign": "warn",
"no-extend-native": "warn",
"no-extra-bind": "warn",
"no-extra-boolean-cast": "warn",
"no-extra-label": "warn",
"no-extra-parens": "warn",
"no-extra-semi": "warn",
"no-fallthrough": "warn",
"no-floating-decimal": "warn",
"no-func-assign": "warn",
"no-implicit-coercion": [
"warn",
{
"allow": ["~"]
}
],
"no-implicit-globals": "warn",
"no-implied-eval": "warn",
"no-inline-comments": "warn",
"no-inner-declarations": "warn",
"no-invalid-regexp": "warn",
"no-invalid-this": "off",
"no-irregular-whitespace": "warn",
"no-iterator": "warn",
"no-label-var": "warn",
"no-labels": "warn",
"no-lone-blocks": "warn",
"no-lonely-if": "warn",
"no-loop-func": "off",
"no-magic-numbers": "off",
"no-mixed-operators": "warn",
"no-mixed-requires": "warn",
"no-mixed-spaces-and-tabs": "warn",
"no-multi-spaces": "warn",
"no-multi-str": "warn",
"no-multiple-empty-lines": "warn",
"no-native-reassign": "warn",
"no-negated-condition": "warn",
"no-negated-in-lhs": "warn",
"no-nested-ternary": "off",
"no-new": "warn",
"no-new-func": "warn",
"no-new-object": "warn",
"no-new-require": "warn",
"no-new-symbol": "warn",
"no-new-wrappers": "warn",
"no-obj-calls": "warn",
"no-octal": "warn",
"no-octal-escape": "warn",
"no-param-reassign": "warn",
"no-path-concat": "warn",
"no-plusplus": "off",
"no-process-env": "warn",
"no-process-exit": "warn",
"no-proto": "warn",
"no-prototype-builtins": "warn",
"no-redeclare": "warn",
"no-regex-spaces": "warn",
"no-restricted-globals": "warn",
"no-restricted-imports": "warn",
"no-restricted-modules": "warn",
"no-restricted-syntax": "warn",
"no-return-assign": "warn",
"no-script-url": "warn",
"no-self-assign": "warn",
"no-self-compare": "warn",
"no-sequences": "warn",
"no-shadow": "warn",
"no-shadow-restricted-names": "warn",
"no-whitespace-before-property": "warn",
"no-spaced-func": "warn",
"no-sparse-arrays": "warn",
"no-sync": "warn",
"no-tabs": "warn",
"no-ternary": "off",
"no-trailing-spaces": "warn",
"no-this-before-super": "warn",
"no-throw-literal": "warn",
"no-undef": "warn",
"no-undef-init": "warn",
"no-undefined": "off",
"no-unexpected-multiline": "warn",
"no-underscore-dangle": "off",
"no-unmodified-loop-condition": "warn",
"no-unneeded-ternary": "warn",
"no-unreachable": "warn",
"no-unsafe-finally": "warn",
"no-unused-expressions": "warn",
"no-unused-labels": "warn",
"no-unused-vars": "warn",
"no-use-before-define": "warn",
"no-useless-call": "warn",
"no-useless-computed-key": "warn",
"no-useless-concat": "warn",
"no-useless-constructor": "warn",
"no-useless-escape": "warn",
"no-useless-rename": "warn",
"no-void": "warn",
"no-var": "off",
"no-warning-comments": "off",
"no-with": "warn",
"array-bracket-spacing": "off",
"array-callback-return": "warn",
"arrow-body-style": "warn",
"arrow-parens": "warn",
"arrow-spacing": "off",
"accessor-pairs": "warn",
"block-scoped-var": "off",
"block-spacing": ["warn", "always"],
"brace-style": "warn",
"callback-return": "warn",
"camelcase": "off",
"capitalized-comments": [
"warn",
"always",
{
"ignoreConsecutiveComments": true,
"ignoreInlineComments": true
}
],
"comma-dangle": ["warn", "always-multiline"],
"comma-spacing": [
"warn",
{
"before": false,
"after": true
}
],
"comma-style": "warn",
"complexity": ["warn", 15],
"computed-property-spacing": "off",
"consistent-return": "off",
"consistent-this": "off",
"constructor-super": "warn",
"curly": "warn",
"default-case": "off",
"dot-location": ["warn", "property"],
"dot-notation": "warn",
"eol-last": "warn",
"eqeqeq": "warn",
"func-names": "off",
"func-style": "off",
"generator-star-spacing": "off",
"global-require": "warn",
"guard-for-in": "off",
"handle-callback-err": "warn",
"id-blacklist": "warn",
"id-length": "off",
"id-match": "warn",
"indent": "warn",
"init-declarations": "warn",
"jsx-quotes": "warn",
"key-spacing": "off",
"keyword-spacing": "warn",
"linebreak-style": ["warn", "unix"],
"lines-around-comment": "warn",
"max-depth": "warn",
"max-len": [
"warn",
{
"code": 88,
"ignorePattern": "odoo\\.define\\(",
"tabWidth": 4
}
],
"max-lines": "off",
"max-nested-callbacks": "warn",
"max-params": "off",
"max-statements": "off",
"max-statements-per-line": "warn",
"multiline-ternary": "off",
"new-cap": "off",
"new-parens": "warn",
"newline-after-var": "off",
"newline-before-return": "off",
"newline-per-chained-call": "off",
"object-curly-newline": ["warn", {"consistent": true}],
"object-curly-spacing": ["warn", "never"],
"object-property-newline": [
"warn",
{
"allowAllPropertiesOnSameLine": true
}
],
"object-shorthand": "off",
"one-var": "off",
"one-var-declaration-per-line": "off",
"operator-assignment": "warn",
"operator-linebreak": "warn",
"padded-blocks": "off",
"prefer-arrow-callback": "off",
"prefer-const": "warn",
"prefer-reflect": "off",
"prefer-rest-params": "off",
"prefer-spread": "off",
"prefer-template": "off",
"quote-props": "off",
"quotes": "off",
"radix": "warn",
"require-yield": "warn",
"rest-spread-spacing": "off",
"semi": ["warn", "always"],
"semi-spacing": "warn",
"sort-imports": "warn",
"sort-vars": "off",
"space-before-blocks": "warn",
"space-before-function-paren": "warn",
"space-in-parens": "off",
"space-infix-ops": "off",
"space-unary-ops": "off",
"spaced-comment": ["warn", "always"],
"strict": ["warn", "function"],
"template-curly-spacing": "off",
"unicode-bom": "warn",
"use-isnan": "warn",
"valid-jsdoc": [
"warn",
{
"prefer": {
"arg": "param",
"argument": "param",
"augments": "extends",
"constructor": "class",
"exception": "throws",
"func": "function",
"method": "function",
"prop": "property",
"return": "returns",
"virtual": "abstract",
"yield": "yields"
},
"preferType": {
"array": "Array",
"bool": "Boolean",
"boolean": "Boolean",
"number": "Number",
"object": "Object",
"str": "String",
"string": "String"
},
"requireParamDescription": false,
"requireReturn": false,
"requireReturnDescription": false,
"requireReturnType": false
}
],
"valid-typeof": "warn",
"vars-on-top": "off",
"wrap-iife": "warn",
"wrap-regex": "warn",
"yield-star-spacing": "off",
"yoda": "warn"
},
"parserOptions": {
"ecmaVersion": 2017
}
\ No newline at end of file
}
......@@ -7,4 +7,4 @@ select = C,E,F,W,B,B9
# E203: whitespace before ':' (black behaviour)
# E501: flake8 line length (covered by bugbear B950)
# W503: line break before binary operator (black behaviour)
ignore = E203,E501,W503
\ No newline at end of file
ignore = E203,E501,W503
......@@ -6,8 +6,8 @@
# Note that environment variables can be set in several places
# See https://docs.gitlab.com/ee/ci/variables/#cicd-variable-precedence
stages:
- test
- test
sast:
stage: test
include:
- template: Security/SAST.gitlab-ci.yml
- template: Security/SAST.gitlab-ci.yml
......@@ -124,17 +124,12 @@ repos:
rev: v3.0.0a6
hooks:
- id: pylint
name: pylint with optional checks
name: pylint odoo with optional checks
args:
- --rcfile=.pylintrc
- --exit-zero
verbose: true
- id: pylint
name: pylint with mandatory checks
name: pylint odoo with mandatory checks
args:
- --rcfile=.pylintrc-mandatory
- repo: https://github.com/OCA/pylint-odoo
rev: v8.0.19
hooks:
- id: pylint_odoo
name: pylint odoo
......@@ -39,8 +39,6 @@ enable=anomalous-backslash-in-string,
method-required-super,
method-search,
openerp-exception-warning,
pointless-statement,
pointless-string-statement,
print-used,
redundant-keyword-arg,
redundant-modulename-xml,
......
# -*- coding: utf-8 -*-
from . import models
# -*- coding: utf-8 -*-
{
"name": "Cooperator Account Banking Mandate",
"version": "14.0.1.0.5",
......@@ -7,8 +6,13 @@
This module adds mandate selection to cooperator subscription request.""",
"author": "Som IT Cooperatiu SCCL",
"category": "Banking addons",
"depends": ["cooperator", "cooperator_account_payment", "account_banking_mandate",
"account_banking_sepa_direct_debit"],
"website": "https://coopdevs.org",
"depends": [
"cooperator",
"cooperator_account_payment",
"account_banking_mandate",
"account_banking_sepa_direct_debit",
],
"data": [
"views/subscription_request_views.xml",
],
......
# -*- coding: utf-8 -*-
from . import subscription_request
from odoo import api, models, fields, _
from odoo import _, api, fields, models
from odoo.exceptions import ValidationError
class SubscriptionRequest(models.Model):
_inherit = 'subscription.request'
_inherit = "subscription.request"
mandate_id = fields.Many2one(
"account.banking.mandate",
......@@ -16,53 +16,55 @@ class SubscriptionRequest(models.Model):
mandate_required = fields.Boolean(
related="payment_mode_id.payment_method_id.mandate_required",
)
mandate_approved = fields.Boolean(required=True, default=False, string="Approved creation of new mandate")
mandate_approved = fields.Boolean(
required=True, default=False, string="Approved creation of new mandate"
)
def create_invoice(self, partner):
if self.mandate_required and not self.mandate_id:
self.mandate_id = self.create_mandate()
return super(SubscriptionRequest, self).create_invoice(partner)
return super().create_invoice(partner)
def create_mandate(self):
if not self.partner_id:
raise ValidationError(_('Must assign a valid cooperator.'))
raise ValidationError(_("Must assign a valid cooperator."))
if not self.mandate_approved:
raise ValidationError(_('Must check the mandate creation.'))
return self.env['account.banking.mandate'].create(
self.get_mandate_values()
)
raise ValidationError(_("Must check the mandate creation."))
return self.env["account.banking.mandate"].create(self.get_mandate_values())
def get_invoice_vals(self, partner):
vals = super(SubscriptionRequest, self).get_invoice_vals(partner)
vals = super().get_invoice_vals(partner)
vals["mandate_id"] = self.mandate_id.id
return vals
def get_bank(self):
if not self.iban:
raise ValidationError(_('Must assign a valid iban.'))
bank_id = self.partner_id.bank_ids.search([('acc_number', '=', self.iban)]) # TODO normalize iban
raise ValidationError(_("Must assign a valid iban."))
bank_id = self.partner_id.bank_ids.search(
[("acc_number", "=", self.iban)]
) # TODO normalize iban
if bank_id:
return bank_id
return self.env['res.partner.bank'].create(
return self.env["res.partner.bank"].create(
{
'partner_id': self.partner_id.id,
'acc_number': self.iban,
"partner_id": self.partner_id.id,
"acc_number": self.iban,
}
)
def get_mandate_values(self):
bank_id = self.get_bank()
return {
'format': 'sepa',
'type': 'recurrent',
'state': 'valid',
'signature_date': self.date,
'partner_bank_id': bank_id.id,
'partner_id': self.partner_id.id,
'company_id': self.company_id.id,
"format": "sepa",
"type": "recurrent",
"state": "valid",
"signature_date": self.date,
"partner_bank_id": bank_id.id,
"partner_id": self.partner_id.id,
"company_id": self.company_id.id,
}
@api.onchange("partner_id")
def onchange_partner(self):
super(SubscriptionRequest, self).onchange_partner()
super().onchange_partner()
self.mandate_id = False
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8" ?>
<odoo>
<data>
<record id="subscription_request_form_inherit" model="ir.ui.view">
<field name="name">cooperator_account_banking_mandate.subscription_request.form</field>
<field
name="name"
>cooperator_account_banking_mandate.subscription_request.form</field>
<field name="model">subscription.request</field>
<field name="inherit_id" ref="cooperator_account_payment.subscription_request_form_inherit"/>
<field name="priority" eval="8"/>
<field
name="inherit_id"
ref="cooperator_account_payment.subscription_request_form_inherit"
/>
<field name="priority" eval="8" />
<field name="arch" type="xml">
<xpath expr="//field[@name='payment_mode_id']" position="after">
<field
name="mandate_id"
attrs="{'invisible': [('mandate_required', '=', False)]}"
/>
<field name="mandate_required" invisible="1"/>
<field name="mandate_approved"/>
name="mandate_id"
attrs="{'invisible': [('mandate_required', '=', False)]}"
/>
<field name="mandate_required" invisible="1" />
<field name="mandate_approved" />
</xpath>
</field>
</record>
......
# -*- coding: utf-8 -*-
from . import models
# -*- coding: utf-8 -*-
{
"name": "Cooperator Account Payment",
"version": "14.0.1.0.2",
......@@ -7,6 +6,7 @@
This module adds support for payment mode to cooperator.""",
"author": "Som IT Cooperatiu SCCL",
"category": "Banking addons",
"website": "https://coopdevs.org",
"depends": ["cooperator", "account_payment_partner"],
"data": [
"views/product_template_views.xml",
......
# -*- coding: utf-8 -*-
from . import product_template
from . import subscription_request
from odoo import fields, models, api
from odoo import api, fields, models
class ProductTemplate(models.Model):
......
from odoo import api, models, fields
from odoo import api, fields, models
class SubscriptionRequest(models.Model):
_inherit = 'subscription.request'
_inherit = "subscription.request"
payment_mode_id = fields.Many2one(
comodel_name="account.payment.mode",
compute="_compute_payment_mode",
store=True,
readonly=False, # must be set False to compute
states={"block": [("readonly", True)],
"done": [("readonly", True)],
"waiting": [("readonly", True)],
"transfer": [("readonly", True)],
"cancelled": [("readonly", True)],
"paid": [("readonly", True)]},
states={
"block": [("readonly", True)],
"done": [("readonly", True)],
"waiting": [("readonly", True)],
"transfer": [("readonly", True)],
"cancelled": [("readonly", True)],
"paid": [("readonly", True)],
},
check_company=True,
domain="[('payment_type', '=', 'inbound')]",
)
......@@ -24,12 +26,15 @@ class SubscriptionRequest(models.Model):
for request in self:
request.payment_mode_id = request.share_product_id.payment_mode_id
def get_invoice_vals(self, partner):
vals = super(SubscriptionRequest, self).get_invoice_vals(partner)
vals = super().get_invoice_vals(partner)
if self.payment_mode_id:
vals['payment_mode_id'] = self.payment_mode_id.id
if (self.payment_mode_id.bank_account_link == "fixed" and
self.payment_mode_id.payment_method_id.code == "manual"):
vals["partner_bank_id"] = self.payment_mode_id.fixed_journal_id.bank_account_id.id
vals["payment_mode_id"] = self.payment_mode_id.id
if (
self.payment_mode_id.bank_account_link == "fixed"
and self.payment_mode_id.payment_method_id.code == "manual"
):
vals[
"partner_bank_id"
] = self.payment_mode_id.fixed_journal_id.bank_account_id.id
return vals
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8" ?>
<odoo>
<data>
<record id="product_template_form_inherit" model="ir.ui.view">
<field name="name">energy_communities.product_template.form</field>
<field name="model">product.template</field>
<field name="inherit_id" ref="cooperator.product_template_form_view"/>
<field name="priority" eval="8"/>
<field name="inherit_id" ref="cooperator.product_template_form_view" />
<field name="priority" eval="8" />
<field name="arch" type="xml">
<xpath expr="//field[@name='minimum_quantity']" position="after">
<field name="payment_mode_id"/>
<field name="payment_mode_id" />
</xpath>
</field>
</record>
......
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8" ?>
<odoo>
<data>
<record id="subscription_request_form_inherit" model="ir.ui.view">
<field name="name">cooperator_account_payment.subscription_request.form</field>
<field
name="name"
>cooperator_account_payment.subscription_request.form</field>
<field name="model">subscription.request</field>
<field name="inherit_id" ref="cooperator.subscription_request_view_form"/>
<field name="priority" eval="8"/>
<field name="inherit_id" ref="cooperator.subscription_request_view_form" />
<field name="priority" eval="8" />
<field name="arch" type="xml">
<xpath expr="//field[@name='iban']" position="after">
<field name="payment_mode_id"/>
<field name="payment_mode_id" />
</xpath>
</field>
</record>
......
......@@ -3,4 +3,4 @@ from . import controllers
from . import services
from . import wizards
from . import tests
from .hooks import post_init_hook
\ No newline at end of file
from .hooks import post_init_hook
{
'name': "Energy Community",
'version': '14.0.1.1.13',
'depends': [
'account',
'cooperator_account_banking_mandate',
'account_lock_date_update',
'account_multicompany_easy_creation',
'cooperator_account_payment',
'account_payment_order',
'account_reconciliation_widget',
'auth_api_key',
'auth_oauth',
'auth_oidc',
'base_rest',
'base_technical_features',
'base_user_role',
'base_user_role_company',
'community_maps',
'contacts',
'cooperator',
'crm',
'crm_metadata',
'crm_metadata_rest_api',
'crm_rest_api',
'energy_project',
'energy_selfconsumption',
'energy_selfconsumption_cooperator',
'l10n_es_aeat',
'l10n_es_aeat_sii_oca',
'l10n_es_cooperator',
'mail_multicompany',
'mass_mailing',
'metadata',
'partner_multi_company',
'purchase',
'queue_job',
'sale_crm',
'sale_management',
"name": "Energy Community",
"version": "14.0.1.1.13",
"depends": [
"account",
"cooperator_account_banking_mandate",
"account_lock_date_update",
"account_multicompany_easy_creation",
"cooperator_account_payment",
"account_payment_order",
"account_reconciliation_widget",
"auth_api_key",
"auth_oauth",
"auth_oidc",
"base_rest",
"base_technical_features",
"base_user_role",
"base_user_role_company",
"community_maps",
"contacts",
"cooperator",
"crm",
"crm_metadata",
"crm_metadata_rest_api",
"crm_rest_api",
"energy_project",
"energy_selfconsumption",
"energy_selfconsumption_cooperator",
"l10n_es_aeat",
"l10n_es_aeat_sii_oca",
"l10n_es_cooperator",
"mail_multicompany",
"mass_mailing",
"metadata",
"partner_multi_company",
"purchase",
"queue_job",
"sale_crm",
"sale_management",
],
'author': "Coopdevs Treball SCCL & Som Energia SCCL",
'website': 'https://somenergia.coop',
'category': "Cooperative management",
'description': """
"author": "Coopdevs Treball SCCL & Som Energia SCCL",
"website": "https://coopdevs.org",
"category": "Cooperative management",
"description": """
Energy Communities customizations.
""",
"license": "AGPL-3",
'demo': [
'demo/res_lang_demo.xml',
'demo/res_company_demo.xml',
'demo/res_user_demo.xml',
'demo/subscription_request_demo.xml',
'demo/energy_selfconsumption_demo.xml',
"demo": [
"demo/res_lang_demo.xml",
"demo/res_company_demo.xml",
"demo/res_user_demo.xml",
"demo/subscription_request_demo.xml",
"demo/energy_selfconsumption_demo.xml",
],
'data': [
'security/ir_rule_data.xml',
'security/res_users_role_data.xml',
'security/ir.model.access.csv',
'data/utm_data.xml',
'data/crm_lead_tag.xml',
'data/product_data.xml',
'data/auth_oauth_provider_data.xml',
'data/ir_cron.xml',
'views/crm_lead_views.xml',
'views/landing_page_view.xml',
'views/res_company_views.xml',
'views/res_config_settings.xml',
'views/res_partner_views.xml',
'views/website_subscription_template.xml',
'views/ce_views.xml',
'views/utm_views.xml',
'views/auth_oauth_views.xml',
'views/view_users_form.xml',
'views/subscription_request_view.xml',
'views/res_users_view.xml',
'views/res_users_role_view.xml',
'views/menus.xml',
'data/mail_template_data.xml',
'data/mail_template_update_data.xml',
'wizards/assign_crm_to_coordinator_company.xml',
'wizards/multicompany_easy_creation.xml',
"data": [
"security/ir_rule_data.xml",
"security/res_users_role_data.xml",
"security/ir.model.access.csv",
"data/utm_data.xml",
"data/crm_lead_tag.xml",
"data/product_data.xml",
"data/auth_oauth_provider_data.xml",
"data/ir_cron.xml",
"views/crm_lead_views.xml",
"views/landing_page_view.xml",
"views/res_company_views.xml",
"views/res_config_settings.xml",
"views/res_partner_views.xml",
"views/website_subscription_template.xml",
"views/ce_views.xml",
"views/utm_views.xml",
"views/auth_oauth_views.xml",
"views/view_users_form.xml",
"views/subscription_request_view.xml",
"views/res_users_view.xml",
"views/res_users_role_view.xml",
"views/menus.xml",
"data/mail_template_data.xml",
"data/mail_template_update_data.xml",
"wizards/assign_crm_to_coordinator_company.xml",
"wizards/multicompany_easy_creation.xml",
],
'installable': True,
'application': True,
'auto_install': False,
'post_init_hook': 'post_init_hook',
"installable": True,
"application": True,
"auto_install": False,
"post_init_hook": "post_init_hook",
}
from . import website_subscription_main
from . import website_subscription_voluntary_share
from . import controllers
\ No newline at end of file
from . import controllers
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment